本文整理汇总了PHP中Kurogo::getThemeConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getThemeConfig方法的具体用法?PHP Kurogo::getThemeConfig怎么用?PHP Kurogo::getThemeConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::getThemeConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getThemeVars
public static function getThemeVars()
{
if ($config = Kurogo::getThemeConfig()) {
$pagetype = Kurogo::deviceClassifier()->getPagetype();
$platform = Kurogo::deviceClassifier()->getPlatform();
$browser = Kurogo::deviceClassifier()->getBrowser();
$sections = array('common', $pagetype, "{$pagetype}-{$platform}", "{$pagetype}-{$platform}-{$browser}");
$themeVars = array();
foreach ($sections as $section) {
if ($sectionVars = $config->getOptionalSection($section)) {
$themeVars = array_merge($themeVars, $sectionVars);
}
}
}
return $themeVars;
}
示例2: getMinifyGroupsConfig
function getMinifyGroupsConfig()
{
$minifyConfig = array();
$key = $_GET['g'];
// javascript and css search directory order
$dirs = array(APP_DIR, SHARED_APP_DIR, SITE_APP_DIR, SHARED_THEME_DIR, THEME_DIR);
//
// Check for specific file request
//
if (strpos($key, MIN_FILE_PREFIX) === 0) {
// file path relative to either templates or the theme (check theme first)
$path = substr($key, strlen(MIN_FILE_PREFIX));
$files = array();
foreach ($dirs as $dir) {
if ($dir) {
$files[] = $dir . $path;
}
}
$config = array('include' => 'all', 'files' => $files);
return array($key => buildFileList($config));
}
//
// Page request
//
$pageOnly = isset($_GET['pageOnly']) && $_GET['pageOnly'];
$noCommon = $pageOnly || isset($_GET['noCommon']) && $_GET['noCommon'];
// if this is a copied module also pull in files from that module
$configModule = isset($_GET['config']) ? $_GET['config'] : '';
list($ext, $module, $page, $pagetype, $platform, $browser, $pathHash) = explode('-', $key);
$cache = new DiskCache(CACHE_DIR . '/minify', Kurogo::getOptionalSiteVar('MINIFY_CACHE_TIMEOUT', 30), true);
$cacheName = "group_{$key}";
$Kurogo = Kurogo::sharedInstance();
$Kurogo->setCurrentModuleID($module);
if ($configModule) {
$Kurogo->setCurrentConfigModule($configModule);
$cacheName .= "-{$configModule}";
}
if ($pageOnly) {
$cacheName .= "-pageOnly";
}
if ($cache->isFresh($cacheName)) {
$minifyConfig = $cache->read($cacheName);
} else {
if ($noCommon) {
// Info module does not inherit from common files
$subDirs = array('/modules/' . $module);
} else {
$subDirs = array('/common', '/modules/' . $module);
}
if ($configModule && $configModule !== $module) {
$subDirs[] = '/modules/' . $configModule;
}
$checkFiles = array('css' => getFileConfigForDirs('css', 'css', $page, $pagetype, $platform, $browser, $dirs, $subDirs, $pageOnly), 'js' => getFileConfigForDirs('js', 'javascript', $page, $pagetype, $platform, $browser, $dirs, $subDirs, $pageOnly));
//error_log(print_r($checkFiles, true));
$minifyConfig[$key] = buildFileList($checkFiles[$ext]);
//error_log(__FUNCTION__."($pagetype-$platform-$browser) scanned filesystem for $key");
$cache->write($minifyConfig, $cacheName);
}
// Add minify source object for the theme config
if ($ext == 'css') {
$themeConfig = Kurogo::getThemeConfig();
if ($themeConfig) {
$minifyConfig[$key][] = new Minify_Source(array('id' => 'themeConfigModTimeChecker', 'getContentFunc' => 'minifyThemeConfigModTimeCheckerContent', 'minifier' => '', 'contentType' => Minify::TYPE_CSS, 'lastModified' => $themeConfig->getLastModified()));
}
}
//error_log(__FUNCTION__."($pagetype-$platform-$browser) returning: ".print_r($minifyConfig, true));
return $minifyConfig;
}