Source of file MinimalistThemeExtensions.php
Size: 2,356 Bytes - Last Modified: 2021-12-23T10:25:42+00:00
/var/www/docs.ssmods.com/process/src/code/extensions/MinimalistThemeExtensions.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php /** * * * @author <marcus@symbiote.com.au> * @license BSD License http://www.silverstripe.org/bsd-license */ class PageControllerThemeExtension extends Extension { private static $include_requirements = true; private static $supported_themes = array( 'symbiote-minimalist' ); public function onAfterInit() { $config = Config::inst(); $theme = $config->get('SSViewer', 'theme'); $supported = $config->get('PageControllerThemeExtension', 'supported_themes'); if (Config::inst()->get('PageControllerThemeExtension', 'include_requirements') && in_array($theme, $supported)) { // we'll use the frontend dashboard jquery Requirements::block(THIRDPARTY_DIR .'/jquery/jquery.js'); // block frontend dashboards' js, we have our own Requirements::block('frontend-dashboards/javascript/dashboards.js'); Requirements::javascript('frontend-dashboards/javascript/jquery-1.10.2.min.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript('frontend-dashboards/javascript/jquery-migrate-1.2.1.min.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js'); Requirements::javascript("themes/{$theme}/js/modernizr.js"); Requirements::javascript("themes/{$theme}/js/foundation.min.js"); Requirements::javascript("themes/{$theme}/js/jquery.slides.min.js"); Requirements::javascript("themes/{$theme}/js/general.js"); if (defined('BA_SIS_COMMUNITY_PATH')) { Requirements::javascript(BA_SIS_COMMUNITY_PATH . '/javascript/info-lists.js'); Requirements::javascript(BA_SIS_COMMUNITY_PATH . '/javascript/info-lists-foundation.js'); } if ($this->owner instanceof DashboardController) { Requirements::javascript("themes/{$theme}/js/dashboards.js"); } } } /** * Allows concrete controllers to provide implementations */ public function PreLayout() { } public function PostLayout() { } } |