Source of file BetterPageIcons.php
Size: 0,793 Bytes - Last Modified: 2018-11-27T11:02:28+00:00
/var/www/docs.ssmods.com/process/src/src/traits/BetterPageIcons.php
1234567891011121314151617181920212223242526272829303132 | <?php namespace StyleHack\BetterPageIcons\Traits; use SilverStripe\Core\Config\Config; trait BetterPageIcons { /** * Add FA Icon in MenuTree * * @return string */ public function getTreeTitle() { $treeTitle = parent::getTreeTitle(); $icon = $this->config()->get('fa_icon'); $type = $this->config()->get('fa_type'); $color = $this->config()->get('fa_color'); $defaults = Config::inst()->get('BetterPageIcons'); $defaultIcon = $defaults['default_icon']; $defaultType = $defaults['default_type']; $defaultColor = $defaults['default_icon_color']; $faIcon = $icon ?: $defaultIcon; $faType = $type ?: $defaultType; $faColor = $color ?: $defaultColor; return "<i style='color: $faColor;' class=\"fa-icon $faType fa-$faIcon\"></i>" . $treeTitle; } } |