本文整理汇总了PHP中Kurogo::getThemeVars方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getThemeVars方法的具体用法?PHP Kurogo::getThemeVars怎么用?PHP Kurogo::getThemeVars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::getThemeVars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPageVariables
//.........这里部分代码省略.........
$this->assign('webBridgeConfig', KurogoWebBridge::getServerConfig($this->configModule, $this->page, $this->args));
$moduleStrings = $this->getOptionalModuleSection('strings');
$this->assign('moduleStrings', $moduleStrings);
$this->assign('homeLink', $this->buildURLForModule($this->getHomeModuleID(), '', array()));
$this->assign('homeModuleID', $this->getHomeModuleID());
$this->assignLocalizedStrings();
if ($this->page == 'help') {
// Module Help
$this->assign('hasHelp', false);
$template = 'common/templates/' . $this->page;
} else {
if ($this->page == self::WEB_BRIDGE_BUILD_TEMPLATES_PAGE) {
$template = 'common/templates/staticContent';
} else {
if (KurogoWebBridge::useWrapperPageTemplate()) {
// Web bridge page wrapper
$template = 'common/templates/webBridge';
$this->assign('webBridgeJSLocalizedStrings', json_encode(Kurogo::getLocalizedStrings()));
} else {
$this->assign('hasHelp', isset($moduleStrings['help']));
$this->assign('helpLink', $this->buildBreadcrumbURL('help', array()));
$this->assign('helpLinkText', $this->getLocalizedString('HELP_TEXT', $this->getModuleName()));
$template = 'modules/' . $this->templateModule . '/templates/' . $this->templatePage;
}
}
}
Kurogo::log(LOG_DEBUG, "Template file is {$template}", 'module');
// Pager support
if (isset($this->htmlPager)) {
$this->assign('pager', $this->getPager());
}
// Tab support
if (isset($this->tabbedView)) {
$this->assign('tabbedView', $this->tabbedView);
}
$this->assign('imageExt', $this->imageExt);
$this->assign(Kurogo::getThemeVars());
// Access Key Start
$accessKeyStart = count($this->breadcrumbs);
if ($this->configModule != $this->getHomeModuleID()) {
$accessKeyStart++;
// Home link
}
$this->assign('accessKeyStart', $accessKeyStart);
if (Kurogo::getSiteVar('AUTHENTICATION_ENABLED')) {
Kurogo::includePackage('Authentication');
$this->setCacheMaxAge(0);
$session = $this->getSession();
$this->assign('session', $session);
$this->assign('session_isLoggedIn', $this->isLoggedIn());
$this->assign('showLogin', Kurogo::getSiteVar('AUTHENTICATION_ENABLED') && $this->showLogin());
if ($this->isLoggedIn()) {
$user = $session->getUser();
$authority = $user->getAuthenticationAuthority();
$this->assign('session_userID', $user->getUserID());
$this->assign('session_fullName', $user->getFullname());
if (count($session->getUsers()) == 1) {
$this->assign('session_logout_url', $this->buildURLForModule($this->getLoginModuleID(), 'logout', array('authority' => $user->getAuthenticationAuthorityIndex())));
$this->assign('footerLoginLink', $this->buildURLForModule($this->getLoginModuleID(), '', array()));
$this->assign('footerLoginText', $this->getLocalizedString('SIGNED_IN_SINGLE', $authority->getAuthorityTitle(), $user->getFullName()));
$this->assign('footerLoginClass', $authority->getAuthorityClass());
} else {
$this->assign('footerLoginClass', 'login_multiple');
$this->assign('session_logout_url', $this->buildURLForModule($this->getLoginModuleID(), 'logout', array()));
$this->assign('footerLoginLink', $this->buildURLForModule($this->getLoginModuleID(), 'logout', array()));
$this->assign('footerLoginText', $this->getLocalizedString('SIGNED_IN_MULTIPLE'));
}
if ($session_max_idle = intval(Kurogo::getOptionalSiteVar('AUTHENTICATION_IDLE_TIMEOUT', 0))) {
$this->setRefresh($session_max_idle + 60);
}
} else {
$this->assign('footerLoginClass', 'noauth');
$this->assign('footerLoginLink', $this->buildURLForModule($this->getLoginModuleID(), '', array()));
$this->assign('footerLoginText', $this->getLocalizedString('SIGN_IN_SITE', Kurogo::getSiteString('SITE_NAME')));
}
}
/* set cache age. Modules that present content that rarely changes can set this value
to something higher */
header(sprintf("Cache-Control: max-age=%d", $this->cacheMaxAge));
/*
* Date is set by apache (or your webserver of choice). Under apache, and possibly other
* webservers, it is impossible to either manually set this header or read the value of it.
* Here, we want to set the Expires header such that disable caching. One method of doing
* this is to set Expires to the same value as Date.
* Because of execution time up to this point, very occasionally these two values are off by
* 1 second. The net result is that with a $this->cacheMaxAge of 0, the Date and Expires
* headers are different by 1 second. Combined with Pragma: no-cache and
* Cache-Control: no-cache, you get conflicting behavior which can (in theory) be exploited.
* It also causes security tools to complain about the difference.
*
* The only reliable thing to do when explicitly attempting to avoid caching is to set
* Expires to a time in the past. The best way to do that is to set it to Unix epoch.
*/
if ($this->cacheMaxAge > 0) {
header("Expires: " . gmdate('D, d M Y H:i:s', time() + $this->cacheMaxAge) . ' GMT');
} else {
header("Expires: " . gmdate('D, d M Y H:i:s', 0) . ' GMT');
}
return $template;
}
示例2: getOptionalThemeVar
protected function getOptionalThemeVar($var, $default = '')
{
$vars = Kurogo::getThemeVars();
return isset($vars[$var]) ? $vars[$var] : $default;
}
示例3: minifyPostProcess
function minifyPostProcess($content, $type)
{
if ($type === Minify::TYPE_CSS) {
$urlPrefix = URL_PREFIX;
if (Kurogo::getSiteVar('DEVICE_DEBUG') && URL_PREFIX == URL_BASE) {
// if device debugging is on, always append device classification
$urlPrefix .= 'device/' . Kurogo::deviceClassifier()->getDevice() . '/';
}
// Theme variable replacement
$themeVars = Kurogo::getThemeVars();
if ($themeVars) {
$content = preg_replace_callback(';@@@([^@]+)@@@;', 'minifyThemeVarReplace', $content);
}
$content = "/* Adding url prefix '" . $urlPrefix . "' */\n\n" . preg_replace(';url\\("?\'?/([^"\'\\)]+)"?\'?\\);', 'url("' . $urlPrefix . '\\1")', $content);
}
return $content;
}