diff --git a/public_html/classes/render-adminlte.class.php b/public_html/classes/render-adminlte.class.php index a67afe5c1b88dc87bb20f4faa0791b7bdab3d4cc..fadb90986b594ade60fb8a322d8b52c8f3e5852e 100755 --- a/public_html/classes/render-adminlte.class.php +++ b/public_html/classes/render-adminlte.class.php @@ -571,8 +571,12 @@ class renderadminlte { * https://adminlte.io/docs/3.2/components/boxes.html * * @param type $aOptions hash with keys for all options + * styling: * - type - color of the box; one of [none]|danger|dark|info|primary|secondary|success|warning - * - bgcolor - background color of icon; use type OR bgcolor + * - iconbg - background color or type of icon; use it for default type (type="") + * - shadow - size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large + * + * content * - icon - icon class * - text - information text * - number - value (comes in bold text) @@ -581,17 +585,25 @@ class renderadminlte { * @return string */ public function getInfobox($aOptions){ - $aOptions=$this->_ensureOptions($aOptions, ['type', 'bgcolor', 'icon', 'text', 'number', 'progressvalue', 'progresstext']); + $aOptions=$this->_ensureOptions($aOptions, ['type', 'bgcolor', 'shadow', 'icon', 'text', 'number', 'progressvalue', 'progresstext']); + $aShadows=[ + 'default' => '', + 'none' => 'shadow-none', + 'small' => 'shadow-small', + 'regular' => 'shadow', + 'large' => 'shadow-lg', + ]; // print_r($aOptions); $sClass='info-box' .($aOptions['class'] ? ' '.$aOptions['class'] : '') .($aOptions['type'] ? ' bg-'.$aOptions['type'] : '') + .($aOptions['shadow'] && isset($aShadows) && $aShadows[$aOptions['shadow']] ? ' '.$aShadows[$aOptions['shadow']] : '') ; // build parts $sIcon=$aOptions['icon'] ? $this->addWrapper("span", [ - 'class'=>'info-box-icon'.($aOptions['bgcolor'] ? ' bg-'.$aOptions['bgcolor'] : '') + 'class'=>'info-box-icon'.($aOptions['iconbg'] ? ' bg-'.$aOptions['iconbg'] : '') ], $this->_tag('i',['class'=>$aOptions['icon']])) : '' ;