本文整理汇总了PHP中Kurogo::getOptionalModuleVar方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getOptionalModuleVar方法的具体用法?PHP Kurogo::getOptionalModuleVar怎么用?PHP Kurogo::getOptionalModuleVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::getOptionalModuleVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeForPage
protected function initializeForPage()
{
//get links from module.ini [links]
$links = $this->getOptionalModuleSection('links');
$this->assign('links', $links);
//get app Data
$appData = Kurogo::getAppData();
$this->assign('appData', $appData);
//get module data from modules.ini
$modulesData = $this->getOptionalModuleSections('modules');
foreach ($modulesData as $moduleID => &$moduleData) {
$moduleData['icon'] = Kurogo::getOptionalModuleVar('icon', $moduleID, $moduleID, 'module', 'module');
}
$this->assign('modulesData', $modulesData);
$args = array();
if (Kurogo::getSiteVar('COMPUTER_TABLET_ENABLED', 'themes')) {
$args['setdevice'] = 'compliant';
}
$previewURL = $this->buildURLForModule($this->getHomeModuleID(), 'index', $args);
$this->assign('previewURL', $previewURL);
}
示例2: getParentModuleID
public static function getParentModuleID($moduleID)
{
return Kurogo::getOptionalModuleVar('id', $moduleID, $moduleID, 'module', 'module');
}
示例3: setPageVariables
private function setPageVariables()
{
$this->loadTemplateEngineIfNeeded();
$this->loadPageConfig();
// Set variables common to all modules
$this->assign('moduleID', $this->id);
$this->assign('configModule', $this->configModule);
$this->assign('templateModule', $this->templateModule);
$this->assign('moduleName', $this->moduleName);
$this->assign('navImageID', $this->getModuleIcon());
$this->assign('page', $this->page);
$this->assign('isModuleHome', $this->page == 'index');
$this->assign('request_uri', $_SERVER['REQUEST_URI']);
$this->assign('hideFooterLinks', $this->hideFooterLinks);
$this->assign('ajaxContentLoad', $this->ajaxContentLoad);
$this->assign('charset', Kurogo::getCharset());
$this->assign('http_protocol', HTTP_PROTOCOL);
$this->assign('webBridgeAjaxContentLoad', KurogoWebBridge::isAjaxContentLoad());
// Font size for template
$this->assign('fontsizes', $this->fontsizes);
$this->assign('fontsize', $this->fontsize);
$this->assign('fontsizeCSS', $this->getFontSizeCSS());
$this->assign('fontSizeURLs', $this->getFontSizeURLs());
// Minify URLs
$this->assign('minify', $this->getMinifyUrls());
// Google Analytics. This probably needs to be moved
if ($gaID = Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_ID')) {
$this->assign('GOOGLE_ANALYTICS_ID', $gaID);
$this->assign('GOOGLE_ANALYTICS_DOMAIN', Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_DOMAIN'));
$this->assign('gaImageURL', $this->googleAnalyticsGetImageUrl($gaID));
}
// Breadcrumbs
$this->loadBreadcrumbs();
// Tablet iScroll
if ($this->pagetype == 'tablet') {
$this->addInternalJavascript('/common/javascript/lib/iscroll-4.2.js');
// Module nav list
if ($this->shouldShowNavigation()) {
$this->assign('navigationModules', $this->getModuleNavlist());
$allowCustomize = Kurogo::getOptionalModuleVar('ALLOW_CUSTOMIZE', true, $this->getHomeModuleID());
$this->assignUserContexts($allowCustomize);
}
}
if ($this->page == self::WEB_BRIDGE_BUILD_TEMPLATES_PAGE) {
$title = 'Error!';
$message = '';
try {
if (!Kurogo::isLocalhost()) {
throw new KurogoException("{$this->page} command can only be run from localhost");
}
$platforms = array_filter(array_map('trim', explode(',', $this->getArg('platform', ''))));
if (!$platforms) {
throw new KurogoException("No platforms specified");
}
foreach ($platforms as $platform) {
$this->buildNativeWebTemplatesForPlatform($platform);
}
$title = 'Success!';
$message = 'Generated native web templates for ' . implode(' and ', $platforms);
} catch (Exception $e) {
$message = $e->getMessage();
}
$this->assign('contentTitle', $title);
$this->assign('contentBody', $message);
} else {
if (KurogoWebBridge::useNativeTemplatePageInitializer()) {
Kurogo::log(LOG_DEBUG, "Calling initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
$this->initializeForNativeTemplatePage();
//subclass behavior
Kurogo::log(LOG_DEBUG, "Returned from initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
} else {
Kurogo::log(LOG_DEBUG, "Calling initializeForPage for {$this->configModule} - {$this->page}", 'module');
$this->initializeForPage();
//subclass behavior
Kurogo::log(LOG_DEBUG, "Returned from initializeForPage for {$this->configModule} - {$this->page}", 'module');
}
}
// Set variables for each page
$this->assign('pageTitle', $this->pageTitle);
// Variables which may have been modified by the module subclass
$this->assign('inlineCSSBlocks', $this->inlineCSSBlocks);
$this->assign('cssURLs', $this->cssURLs);
$this->assign('inlineJavascriptBlocks', $this->inlineJavascriptBlocks);
$this->assign('onOrientationChangeBlocks', $this->onOrientationChangeBlocks);
$this->assign('onLoadBlocks', $this->onLoadBlocks);
$this->assign('inlineJavascriptFooterBlocks', $this->inlineJavascriptFooterBlocks);
$this->assign('javascriptURLs', $this->javascriptURLs);
$this->assign('breadcrumbs', $this->breadcrumbs);
$this->assign('breadcrumbArgs', $this->getBreadcrumbArgs());
$this->assign('breadcrumbSamePageArgs', $this->getBreadcrumbArgs(false));
$this->assign('breadcrumbsShowAll', $this->getOptionalThemeVar('breadcrumbs_show', true));
if (Kurogo::getSiteVar('MODULE_DEBUG')) {
$this->addModuleDebugString('Config Mode', implode(', ', Kurogo::sharedInstance()->getConfigModes()));
$this->addModuleDebugString('Version', KUROGO_VERSION);
if (SITE_VERSION) {
$this->addModuleDebugString('Site Version', SITE_VERSION);
}
if (SITE_BUILD) {
$this->addModuleDebugString('Site Build', SITE_BUILD);
}
//.........这里部分代码省略.........