cms-niceties/src/Extensions/LeftAndMainExtension.php

32 lines
923 B
PHP
Raw Normal View History

2021-06-19 21:30:03 +02:00
<?php
namespace A2nt\CMSNiceties\Extensions;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Extension;
use SilverStripe\FontAwesome\FontAwesomeField;
use SilverStripe\View\Requirements;
use A2nt\CMSNiceties\Templates\DeferredRequirements;
2022-05-10 13:09:06 +02:00
/**
* Class \A2nt\CMSNiceties\Extensions\LeftAndMainExtension
*
* @property \A2nt\CMSNiceties\Extensions\LeftAndMainExtension $owner
*/
2021-06-19 21:30:03 +02:00
class LeftAndMainExtension extends Extension
{
public function init()
{
$config = Config::inst()->get(DeferredRequirements::class);
// App libs
if (!$config['nofontawesome']) {
$v = !isset($config['fontawesome_version']) || !$config['fontawesome_version']
? Config::inst()->get(FontAwesomeField::class, 'version')
: $config['fontawesome_version'];
Requirements::css('//use.fontawesome.com/releases/v'.$v.'/css/all.css');
}
}
}