/** * Parse system keys. * * @param string $sKey key * @return string value associated with the key. */ function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { global $site; global $_page; global $oFunctions; global $oTemplConfig; global $logged; $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); $sRet = ''; switch ($sKey) { case 'page_charset': $sRet = 'UTF-8'; break; case 'page_keywords': if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) { $sRet = '<meta name="keywords" content="' . bx_html_attribute(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />'; } break; case 'page_description': if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) { $sRet = '<meta name="description" content="' . bx_html_attribute($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />'; } break; case 'page_header': if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle']; } else { if (isset($_page['header'])) { $sRet = $_page['header']; } } //$sRet = process_line_output($sRet); break; case 'page_header_text': if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']; } else { if (isset($_page['header_text'])) { $sRet = $_page['header_text']; } } //$sRet = process_line_output($sRet); break; case 'main_div_width': if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']); } break; case 'main_logo': $sRet = $GLOBALS['oFunctions']->genSiteLogo(); break; case 'main_splash': $sRet = $GLOBALS['oFunctions']->genSiteSplash(); break; case 'top_menu': $sRet = $GLOBALS['oTopMenu']->getCode(); break; case 'top_menu_breadcrumb': $sRet = !empty($GLOBALS['oTopMenu']->sBreadCrumb) ? $GLOBALS['oTopMenu']->sBreadCrumb : $GLOBALS['oTopMenu']->genBreadcrumb(); break; case 'extra_top_menu': $iProfileId = getLoggedId(); if ($iProfileId && getParam('ext_nav_menu_enabled')) { bx_import('BxTemplMemberMenu'); $oMemberMenu = new BxTemplMemberMenu(); $sRet = $oMemberMenu->genMemberMenu($iProfileId); } break; case 'bottom_links': $sRet = $oFunctions->genSiteBottomMenu(); break; case 'switch_skin_block': $sRet = getParam("enable_template") ? templates_select_txt() : ''; break; case 'dol_images': $sRet = $this->_processJsImages(); break; case 'dol_lang': $sRet = $this->_processJsTranslations(); break; case 'dol_options': $sRet = $this->_processJsOptions(); break; case 'bottom_text': $sRet = _t('_bottom_text', date('Y')); break; case 'copyright': $sRet = _t('_copyright', date('Y')) . getVersionComment(); break; case 'flush_header': //TODO: add some variable to disable it if needed //flush(); break; case 'extra_js': $sRet = empty($_page['extra_js']) ? '' : $_page['extra_js']; break; case 'is_profile_page': $sRet = defined('BX_PROFILE_PAGE') ? 'true' : 'false'; break; default: $sRet = ($sTemplAdd = $oFunctions->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right']; } $sRet = BxDolTemplate::processInjection($_page['name_index'], $sKey, $sRet); return $sRet; }
/** * Parse system keys. * * @param string $sKey key * @return string value associated with the key. */ function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { global $logged; $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); $sRet = ''; switch ($sKey) { case 'version': $sRet = $GLOBALS['site']['ver']; break; case 'current_version': $sRet = $GLOBALS['site']['ver'] . '.' . $GLOBALS['site']['build']; break; case 'page_charset': $sRet = 'UTF-8'; break; case 'page_keywords': if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) { $sRet = '<meta name="keywords" content="' . process_line_output(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />'; } break; case 'page_description': if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) { $sRet = '<meta name="description" content="' . process_line_output($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />'; } break; case 'page_header': if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle']; } else { if (isset($GLOBALS['_page']['header'])) { $sRet = $GLOBALS['_page']['header']; } } $sRet = process_line_output($sRet); break; case 'page_header_text': if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']); } else { if (isset($GLOBALS['_page']['header_text'])) { $sRet = $GLOBALS['_page']['header_text']; } } $sRet = process_line_output($sRet); break; case 'main_div_width': if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']); } break; case 'top_menu': $sRet = BxDolAdminMenu::getTopMenu(); break; case 'main_menu': $sRet = BxDolAdminMenu::getMainMenu(); break; case 'dol_images': $sRet = $this->_processJsImages(); break; case 'dol_lang': $sRet = $this->_processJsTranslations(); break; case 'dol_options': $sRet = $this->_processJsOptions(); break; case 'promo_code': if (defined('BX_PROMO_CODE')) { $sRet = BX_PROMO_CODE; } else { $sRet = ' '; } break; case 'copyright': $sRet = _t('_copyright', date('Y')) . getVersionComment(); break; } $sRet = BxDolTemplate::processInjection($GLOBALS['_page']['name_index'], $sKey, $sRet); return $sRet; }