diff --git a/docs/50_Components/Callout.md b/docs/50_Components/Callout.md index 0ffde9578401ebfd93210db6b3f9642beaeaefd3..75af2be2c3bc044f7a6a390787e289cf5c903d26 100644 --- a/docs/50_Components/Callout.md +++ b/docs/50_Components/Callout.md @@ -24,6 +24,7 @@ Key | Description --- | --- class | optional: additional css classes type | one of [none]\|danger\|dark\|info\|primary\|secondary\|success\|warning +shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large Content: diff --git a/docs/50_Components/Card.md b/docs/50_Components/Card.md index f87efe03a8dfc67d0bcf643647c6f3536889bf9b..f39527ebd690b603d5e2eaa86b5b36cde17d05b8 100644 --- a/docs/50_Components/Card.md +++ b/docs/50_Components/Card.md @@ -27,6 +27,7 @@ Key | Description class | optional: additional css classes type | one of [none]\|danger\|dark\|info\|primary\|secondary\|success\|warning variant | kind of coloring: one of<br>- "default" - titlebar is colored<br>- "outline" - a small stripe on top border is colored<br>- "solid" - whole card is colored<br>- "gradient" - whole card is colored with a gradient +shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large state | window state. one of [none]\|collapsed\|maximized Toolbar icons: diff --git a/docs/50_Components/Infobox.md b/docs/50_Components/Infobox.md index 6ce5e79d71b00987d048bc2d546c0f45ccd12e4d..a8fba30b119b613623d3a1782c7a57d19b135f7e 100644 --- a/docs/50_Components/Infobox.md +++ b/docs/50_Components/Infobox.md @@ -23,7 +23,7 @@ Styling: Key | Description --- | --- type | one of [none]\|danger\|dark\|info\|primary\|secondary\|success\|warning -shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large +shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large iconbg | background color or type of icon; use it for default type (type="") Content: diff --git a/docs/50_Components/Smallbox.md b/docs/50_Components/Smallbox.md index 9393b4f705c31f681c951dc1ae9432542f9fb8c3..ecbb43736a1df512f5f641f06c3c6f2e520a0b06 100644 --- a/docs/50_Components/Smallbox.md +++ b/docs/50_Components/Smallbox.md @@ -23,7 +23,7 @@ Styling: Key | Description --- | --- type | one of [none]\|danger\|dark\|info\|primary\|secondary\|success\|warning -shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large +shadow | size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large Content: diff --git a/public_html/classes/render-adminlte.class.php b/public_html/classes/render-adminlte.class.php index 9c1c095ee13d60e106bbdeb43e7d73d22022c747..7a9a9cee4c43e5f7304b6a5a452a68d0366f006e 100755 --- a/public_html/classes/render-adminlte.class.php +++ b/public_html/classes/render-adminlte.class.php @@ -7,6 +7,8 @@ require_once 'htmlelements.class.php'; * DOCS: https://adminlte.io/docs/3.2/ * https://adminlte.io/themes/v3/index3.html * + * ---------------------------------------------------------------------- + * 2023-09-11 <axel.hahn@unibe.ch> add shadows on card + callout * ====================================================================== * * @author Axel @@ -262,6 +264,7 @@ class renderadminlte { 'params'=>[ 'type' => ['select'=>$this->aPresets['type'], 'example_value'=>'danger'], + 'shadow' => ['select'=>$this->aPresets['shadow'], 'example_value'=>''], 'class' => [ 'group'=>'styling', 'description'=>'optional: css classes', @@ -288,6 +291,7 @@ class renderadminlte { 'params'=>[ 'type' => ['select'=>$this->aPresets['type'], 'example_value'=>'primary'], 'variant' => ['select'=>$this->aPresets['variant'], 'example_value'=>'outline'], + 'shadow' => ['select'=>$this->aPresets['shadow'], 'example_value'=>''], 'class' => [ 'group'=>'styling', 'description'=>'optional: css classes', @@ -868,7 +872,7 @@ class renderadminlte { * >> styling * - type - one of [none]|danger|dark|info|primary|secondary|success|warning * - class - optional css class - * + * - shadow - size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large * * >> texts/ html content * - title - text: title of the card * - text - text: content of the card @@ -879,6 +883,8 @@ class renderadminlte { $sClass='callout' . $this->_addClassValue($aOptions['type'], 'callout-') . $this->_addClassValue($aOptions['class'], '') + .($aOptions['shadow'] && isset($this->_aValueMappings['shadow'][$aOptions['shadow']]) + ? ' '.$this->_aValueMappings['shadow'][$aOptions['shadow']] : '') ; return $this->addWrapper( @@ -900,6 +906,7 @@ class renderadminlte { * "solid" - whole card is colored * "gradient" - whole card is colored with a gradient * - type - one of [none]|danger|dark|info|primary|secondary|success|warning + * - shadow - size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large * - class - any css class for customizing, eg. "disabled" * - state - one of [none]|collapsed|maximized * @@ -947,6 +954,8 @@ class renderadminlte { $sVariantPrefix=$aVariants[$aOptions['variant']] ? $aVariants[$aOptions['variant']] : $aVariants['default']; $sClass='card' . $this->_addClassValue($aOptions['type'], $sVariantPrefix) + .($aOptions['shadow'] && isset($this->_aValueMappings['shadow'][$aOptions['shadow']]) + ? ' '.$this->_aValueMappings['shadow'][$aOptions['shadow']] : '') . $this->_addClassValue($aOptions['class'], '') ; @@ -1032,7 +1041,7 @@ class renderadminlte { /** - * return an info-box: + * return a small box: * A colored box with large icon, text and a value. * https://adminlte.io/docs/3.2/components/boxes.html * https://adminlte.io/themes/v3/pages/widgets.html @@ -1040,7 +1049,7 @@ class renderadminlte { * @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 - + * - shadow - size of shadow; one of [none] (=default: between small and regular)|none|small|regular|large * content * - icon - icon class for icon on the right * - text - information text @@ -1051,13 +1060,6 @@ class renderadminlte { */ public function getSmallbox($aOptions){ $aOptions=$this->_ensureOptions('smallbox', $aOptions); - $aShadows=[ - 'default' => '', - 'none' => 'shadow-none', - 'small' => 'shadow-small', - 'regular' => 'shadow', - 'large' => 'shadow-lg', - ]; // print_r($aOptions); $sClass='small-box' . $this->_addClassValue($aOptions['type'], 'bg-')