/** * Initialize template engine. * Note. The method is executed with the system, you shouldn't execute it in your subclasses. */ function init() { //--- Load page elements related static variables ---// $this->aPage = array('name_index' => BX_PAGE_DEFAULT, 'header' => '', 'header_text' => '', 'keywords' => array(), 'location' => array(), 'description' => '', 'robots' => '', 'css_name' => array(), 'css_compiled' => array(), 'css_system' => array(), 'js_name' => array(), 'js_compiled' => array(), 'js_system' => array(), 'js_options' => array(), 'js_translations' => array(), 'js_images' => array(), 'injections' => array()); //--- Load default CSS ---// $this->addCssSystem(array('common.css', 'default.less', 'general.css', 'icons.css', 'colors.css', 'forms.css', 'media-desktop.css', 'media-tablet.css', 'media-phone.css', 'media-print.css', BX_DOL_URL_PLUGINS_PUBLIC . 'marka/marka.min.css')); //--- Load default JS ---// $this->addJsSystem(array('jquery/jquery.min.js', 'jquery/jquery-migrate.min.js', 'jquery-ui/jquery.ui.position.min.js', 'spin.min.js', 'jquery.easing.js', 'jquery.cookie.min.js', 'moment-with-langs.js', 'functions.js', 'jquery.webForms.js', 'jquery.dolPopup.js', 'elementQuery.min.js', 'marka/marka.min.js')); //--- Load default JS ---// bx_import('BxDolLanguages'); $this->addJsTranslation(array('_are you sure?', '_error occured', '_sys_loading')); //--- Load injection's cache ---// if (getParam('sys_db_cache_enable')) { $oDb = BxDolDb::getInstance(); $oCache = $oDb->getDbCacheObject(); $sCacheKey = $oDb->genDbCacheKey($this->_sInjectionsCache); $aInjections = $oCache->getData($sCacheKey); if ($aInjections === null) { $aInjections = $this->getInjectionsData(); $oCache->setData($sCacheKey, $aInjections); } } else { $aInjections = $this->getInjectionsData(); } $this->aPage['injections'] = $aInjections; bx_import('BxTemplConfig'); $this->_oConfigTemplate = BxTemplConfig::getInstance(); }
function uriFilter($s, $sEmpty = '-') { bx_import('BxTemplConfig'); if (BxTemplConfig::getInstance()->bAllowUnicodeInPreg) { $s = get_mb_replace('/[^\\pL^\\pN]+/u', '-', $s); } else { $s = get_mb_replace('/([^\\d^\\w]+)/u', '-', $s); } // latin characters only $s = get_mb_replace('/([-^]+)/', '-', $s); $s = get_mb_replace('/([-]+)$/', '', $s); // remove trailing dash if (!$s) { $s = $sEmpty; } return $s; }