/** * @param bool $bAdmin = false * * @return array */ private function indexTemplateParameters($bAdmin = false) { $sLanguage = 'en'; $sTheme = 'Default'; list($sLanguage, $sTheme) = $this->oActions->GetLanguageAndTheme($bAdmin); $bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false); $bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false); $sStaticPrefix = \RainLoop\Utils::WebStaticPath(); $aData = array('Language' => $sLanguage, 'Theme' => $sTheme, 'FaviconIcoLink' => $sStaticPrefix . 'favicon.ico', 'FaviconPngLink' => $sStaticPrefix . 'favicon.png', 'AppleTouchLink' => $sStaticPrefix . 'apple-touch-icon.png', 'AppCssLink' => $sStaticPrefix . 'css/app' . ($bAppCssDebug ? '' : '.min') . '.css', 'BootJsLink' => $sStaticPrefix . 'js/min/boot.js', 'ComponentsJsLink' => $sStaticPrefix . 'js/' . ($bAppJsDebug ? '' : 'min/') . 'components.js', 'LibJsLink' => $sStaticPrefix . 'js/min/libs.js', 'EditorJsLink' => $sStaticPrefix . 'ckeditor/ckeditor.js', 'OpenPgpJsLink' => $sStaticPrefix . 'js/min/openpgp.min.js', 'AppJsCommonLink' => $sStaticPrefix . 'js/' . ($bAppJsDebug ? '' : 'min/') . 'common.js', 'AppJsLink' => $sStaticPrefix . 'js/' . ($bAppJsDebug ? '' : 'min/') . ($bAdmin ? 'admin' : 'app') . '.js'); $aTemplateParameters = array('{{BaseAppDataScriptLink}}' => $bAdmin ? './?/AdminAppData/' : './?/AppData/', '{{BaseAppFaviconIcoFile}}' => $aData['FaviconIcoLink'], '{{BaseAppFaviconPngFile}}' => $aData['FaviconPngLink'], '{{BaseAppAppleTouchFile}}' => $aData['AppleTouchLink'], '{{BaseAppMainCssLink}}' => $aData['AppCssLink'], '{{BaseAppBootScriptLink}}' => $aData['BootJsLink'], '{{BaseAppComponentsScriptLink}}' => $aData['ComponentsJsLink'], '{{BaseAppLibsScriptLink}}' => $aData['LibJsLink'], '{{BaseAppEditorScriptLink}}' => $aData['EditorJsLink'], '{{BaseAppOpenPgpScriptLink}}' => $aData['OpenPgpJsLink'], '{{BaseAppMainCommonScriptLink}}' => $aData['AppJsCommonLink'], '{{BaseAppMainScriptLink}}' => $aData['AppJsLink'], '{{BaseDir}}' => \in_array($aData['Language'], array('ar', 'he', 'ur')) ? 'rtl' : 'ltr'); $aTemplateParameters['{{BaseHash}}'] = \md5(\implode('~', array($bAdmin ? '1' : '0', \md5($this->oActions->Config()->Get('cache', 'index', '')), $this->oActions->Plugins()->Hash(), \RainLoop\Utils::WebVersionPath(), APP_VERSION)) . \implode('~', $aTemplateParameters)); return $aTemplateParameters; }
/** * @param bool $bAdmin * * @return array */ private function startUpData($bAdmin) { $sLanguage = 'en'; $sTheme = 'Default'; if (!$bAdmin) { list($sLanguage, $sTheme) = $this->oActions->GetLanguageAndTheme(); } $sLanguage = $this->oActions->ValidateLanguage($sLanguage); $sTheme = $this->oActions->ValidateTheme($sTheme); $bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false); $bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false); $sStaticPrefix = APP_WEB_STATIC_PATH; return array('Language' => $sLanguage, 'Theme' => $sTheme, 'Hash' => $this->generateIndexCacheHash($bAppJsDebug, $bAdmin), 'LoadingDescription' => $this->oActions->Config()->Get('webmail', 'loading_description', 'RainLoop'), 'FaviconIcoLink' => $sStaticPrefix . 'favicon.ico', 'FaviconPngLink' => $sStaticPrefix . 'favicon.png', 'AppleTouchLink' => $sStaticPrefix . 'apple-touch-icon.png', 'AppCssLink' => $sStaticPrefix . 'css/app' . ($bAppCssDebug ? '' : '.min') . '.css', 'LibJsLink' => $sStaticPrefix . 'js/libs.js', 'EditorJsLink' => $sStaticPrefix . 'ckeditor/ckeditor.js', 'AppJsLink' => $sStaticPrefix . 'js/' . ($bAdmin ? 'admin' : 'app') . ($bAppJsDebug ? '' : '.min') . '.js'); }
/** * @param bool $bAdmin * * @return array */ private function indexTemplateParameters($bAdmin) { $sLanguage = 'en'; $sTheme = 'Default'; if (!$bAdmin) { list($sLanguage, $sTheme) = $this->oActions->GetLanguageAndTheme(); } $sLanguage = $this->oActions->ValidateLanguage($sLanguage); $sTheme = $this->oActions->ValidateTheme($sTheme); $bAppJsDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_js', false); $bAppCssDebug = !!$this->oActions->Config()->Get('labs', 'use_app_debug_css', false); $sStaticPrefix = APP_WEB_STATIC_PATH; $aData = array('Language' => $sLanguage, 'Theme' => $sTheme, 'LoadingDescription' => $this->oActions->Config()->Get('webmail', 'loading_description', 'RainLoop'), 'FaviconIcoLink' => $sStaticPrefix . 'favicon.ico', 'FaviconPngLink' => $sStaticPrefix . 'favicon.png', 'AppleTouchLink' => $sStaticPrefix . 'apple-touch-icon.png', 'AppCssLink' => $sStaticPrefix . 'css/app' . ($bAppCssDebug ? '' : '.min') . '.css', 'BootJsLink' => $sStaticPrefix . 'js/min/boot.js', 'LibJsLink' => $sStaticPrefix . 'js/min/libs.js', 'EditorJsLink' => $sStaticPrefix . 'ckeditor/ckeditor.js', 'OpenPgpJsLink' => $sStaticPrefix . 'js/min/openpgp.min.js', 'AppJsLink' => $sStaticPrefix . 'js/' . ($bAppJsDebug ? '' : 'min/') . ($bAdmin ? 'admin' : 'app') . '.js'); $aTemplateParameters = array('{{BaseAppDataScriptLink}}' => $bAdmin ? './?/AdminAppData/' : './?/AppData/', '{{BaseAppFaviconIcoFile}}' => $aData['FaviconIcoLink'], '{{BaseAppFaviconPngFile}}' => $aData['FaviconPngLink'], '{{BaseAppAppleTouchFile}}' => $aData['AppleTouchLink'], '{{BaseAppMainCssLink}}' => $aData['AppCssLink'], '{{BaseAppBootScriptLink}}' => $aData['BootJsLink'], '{{BaseAppLibsScriptLink}}' => $aData['LibJsLink'], '{{BaseAppEditorScriptLink}}' => $aData['EditorJsLink'], '{{BaseAppOpenPgpScriptLink}}' => $aData['OpenPgpJsLink'], '{{BaseAppMainScriptLink}}' => $aData['AppJsLink'], '{{BaseAppLoadingDescription}}' => \htmlspecialchars($aData['LoadingDescription'], ENT_QUOTES | ENT_IGNORE, 'UTF-8'), '{{BaseDir}}' => \in_array($aData['Language'], array('ar', 'he', 'ur')) ? 'rtl' : 'ltr'); $aTemplateParameters['{{BaseHash}}'] = \md5(\implode('~', array(\md5($this->oActions->Config()->Get('cache', 'index', '')), $this->oActions->Plugins()->Hash(), APP_WEB_PATH, APP_VERSION)) . \implode('~', $aTemplateParameters)); return $aTemplateParameters; }