Skip to content
Snippets Groups Projects
Commit 6d878d2e authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update infobox: add shadow parameter

parent 5e2492ce
No related branches found
No related tags found
No related merge requests found
......@@ -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']]))
: ''
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment