/** * */ protected static function _mergeBlocks($page, $blocks, $type) { static::$_fireEvent = true; $blocks = is_array($blocks) ? $blocks : array($blocks); $string = null; $a = 0; $lang = Manager::getLang('js'); if ('js' === $type && \App::option('website.use_app_prototype_js')) { $string .= "\t" . '<!-- js app prototype included automatically -->' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/App.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/BaseModel.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/BaseController.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/BaseContainer.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/BaseElements.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/BaseForm.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; $path = Manager::getPath() . '/js/website-helper/app/Validator.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; } $helpers = \App::option('website.app_prototype_helpers'); if ('js' === $type && $helpers) { $helpers = explode('|', $helpers); $string .= "\t" . '<!-- js app prototype helpers included automatically -->' . "\n"; foreach ($helpers as $helper) { $path = Manager::getPath() . '/js/website-helper/app/helpers/' . $helper . '.js'; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; } } if ('js' === $type && \App::option('website.auto_include_js_lang') && $lang && file_exists(\App::option('website.language_files_path') . '/' . $lang . '.js')) { $path = Manager::getPath() . '/js/website-helper/lang/' . $lang . '.js'; $string .= "\t" . '<!-- js language file included automaticaly -->' . "\n"; $string .= "\t" . '<script type="text/javascript" src="' . $path . '"></script>' . "\n"; } foreach ($blocks as $block_id) { $string .= static::_getBlock($page, $block_id, $type); } return ltrim($string); }
public function raw() { Manager::currentRoute() && Manager::getLang('suffix') ? str_replace('_' . Manager::getLang('suffix'), '', Manager::currentRoute()) : null; }