当前位置: 首页>>代码示例>>PHP>>正文


PHP Kurogo::getModuleConfig方法代码示例

本文整理汇总了PHP中Kurogo::getModuleConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::getModuleConfig方法的具体用法?PHP Kurogo::getModuleConfig怎么用?PHP Kurogo::getModuleConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kurogo的用法示例。


在下文中一共展示了Kurogo::getModuleConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHomeModulePortletConfig

 protected function getHomeModulePortletConfig()
 {
     static $homePortletConfig;
     if (!$homePortletConfig) {
         $homePortletConfig = Kurogo::getModuleConfig('portlets', $this->getHomeModuleID());
     }
     return $homePortletConfig;
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:8,代码来源:Module.php

示例2: getAllModuleNavigationData

 protected function getAllModuleNavigationData($includeHidden = self::INCLUDE_HIDDEN_MODULES, $iconSetType = 'navigation')
 {
     $modules = $moduleNavData = array('primary' => array(), 'secondary' => array());
     $navModules = Kurogo::getSiteSections('navigation', Config::APPLY_CONTEXTS_NAVIGATION);
     foreach ($navModules as $moduleID => $moduleData) {
         $type = Kurogo::arrayVal($moduleData, 'type', 'primary');
         $moduleNavData[$type][$moduleID] = $moduleData;
     }
     if ($iconSet = $this->getOptionalThemeVar($iconSetType . '_icon_set')) {
         $iconSetSize = $this->getOptionalThemeVar($iconSetType . '_icon_size');
         $imgPrefix = "/common/images/iconsets/{$iconSet}/{$iconSetSize}/";
     } else {
         $homeModuleID = $this->getHomeModuleID();
         $imgPrefix = "/modules/{$homeModuleID}/images/";
     }
     //this is fixed for now
     $modulesThatCannotBeHidden = array('customize');
     $allModuleData = array();
     $userNavData = $this->getUserNavData();
     foreach ($moduleNavData as $type => $modulesOfType) {
         foreach ($modulesOfType as $moduleID => $navData) {
             $icon = $moduleID;
             $selected = $this->configModule == $moduleID;
             $primary = $type == 'primary';
             $classes = array();
             if ($selected) {
                 $classes[] = 'selected';
             }
             if (!$primary) {
                 $classes[] = 'utility';
             }
             $hidable = !in_array($moduleID, $modulesThatCannotBeHidden);
             $imgSuffix = $this->pagetype == 'tablet' && $selected ? '' : '';
             $linkTarget = Kurogo::arrayVal($navData, 'linkTarget');
             // customize is implemented as a page on the home module
             if ($moduleID == 'customize') {
                 $visible = true;
                 $icon = $moduleID;
                 $moduleData = array('type' => $type, 'selected' => $selected, 'title' => $this->getLocalizedString('CUSTOMIZE_TITLE'), 'shortTitle' => $this->getLocalizedString('CUSTOMIZE_SHORT_TITLE'), 'url' => "/" . $this->getHomeModuleID() . "/customize", 'hideable' => $hidable, 'visible' => true, 'img' => $imgPrefix . "{$icon}{$imgSuffix}" . $this->imageExt, 'class' => implode(' ', $classes), 'linkTarget' => $linkTarget);
             } else {
                 //this will throw an exception if a module is not available, so watch out
                 $moduleConfig = Kurogo::getModuleConfig('module', $moduleID);
                 $title = Kurogo::arrayVal($navData, 'title', $moduleConfig->getVar('title'));
                 $shortTitle = Kurogo::arrayVal($navData, 'shortTitle', $title);
                 $icon = $moduleConfig->getOptionalVar('icon', $moduleID);
                 $visible = Kurogo::arrayVal($userNavData, $moduleID, Kurogo::arrayVal($navData, 'visible', 1));
                 $moduleData = array('type' => $type, 'selected' => $selected, 'title' => $title, 'shortTitle' => $shortTitle, 'url' => "/{$moduleID}/", 'hideable' => $hidable, 'visible' => $visible, 'img' => $imgPrefix . "{$icon}{$imgSuffix}" . $this->imageExt, 'class' => implode(' ', $classes), 'linkTarget' => $linkTarget);
                 if (Kurogo::getOptionalSiteVar('DYNAMIC_MODULE_NAV_DATA', false)) {
                     $module = WebModule::factory($moduleID, false, array(), false);
                     // do not initialize
                     $moduleData = $module->getModuleNavigationData($moduleData);
                 }
             }
             if ($visible || $includeHidden || $type == 'primary' && isset($userNavData['visible'])) {
                 $modules[$type][$moduleID] = $moduleData;
             }
         }
     }
     if (isset($userNavData['visible'])) {
         $userModuleNavData = array();
         foreach ($userNavData['visible'] as $moduleID => $visible) {
             if (isset($modules['primary'][$moduleID])) {
                 if ($visible || $includeHidden) {
                     $userModuleNavData[$moduleID] = $modules['primary'][$moduleID];
                     $userModuleNavData[$moduleID]['visible'] = $visible;
                 }
             }
         }
         // make sure all primary modules are defined in userNavData
         // this ensures that new modules show up if a user has customized their layout
         $userModules = array_keys($userNavData['visible']);
         $navModules = array_keys($modules['primary']);
         if ($diff = array_diff($navModules, $userModules)) {
             foreach ($diff as $moduleID) {
                 $userModuleNavData[$moduleID] = $modules['primary'][$moduleID];
             }
         }
         $modules['primary'] = $userModuleNavData;
     }
     return $modules;
 }
开发者ID:sponto,项目名称:msbm-mobile,代码行数:81,代码来源:WebModule.php

示例3: themeConfig

 public function themeConfig()
 {
     if (!$this->themeConfig) {
         $this->themeConfig = new ConfigGroup('theme', 'site');
         if ($config = Kurogo::getSiteConfig('theme')) {
             $this->themeConfig->addConfig($config);
         }
         if ($this->configModule) {
             if ($config = Kurogo::getModuleConfig('theme', $this->module, Config::OPTION_DO_NOT_CREATE)) {
                 $this->themeConfig->addConfig($config);
             }
         }
     }
     return $this->themeConfig;
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:15,代码来源:Kurogo.php

示例4: initializeForCommand


//.........这里部分代码省略.........
                     if (preg_match("/^(.*?)_prefix\$/", $key, $bits)) {
                         continue;
                     }
                     $prefix = isset($fields[$key . '_prefix']) ? $fields[$key . '_prefix'] : '';
                     if ($prefix && defined($prefix)) {
                         $value = constant($prefix) . '/' . $value;
                     }
                     $this->setConfigVar($type, $section, $subsection, $key, $value);
                 }
             }
             if ($sectionorder = $this->getArg('sectionorder')) {
                 foreach ($sectionorder as $section => $order) {
                     $this->setSectionOrder($type, $section, $subsection, $order);
                 }
             }
             foreach ($this->changedConfigs as $config) {
                 Kurogo::sharedInstance()->saveConfig($config);
             }
             $this->setResponse(true);
             $this->setResponseVersion(1);
             break;
         case 'removeconfigsection':
             $type = $this->getArg('type');
             $section = $this->getArg('section', '');
             $key = $this->getArg('key', null);
             switch ($type) {
                 case 'site':
                     $subsection = $this->getArg('subsection', null);
                     $sectionData = $this->getAdminData($type, $section, $subsection);
                     $config = Kurogo::getSiteConfig($sectionData['config'], 'site');
                     break;
                 case 'module':
                     $moduleID = $this->getArg('module', '');
                     $module = WebModule::factory($moduleID);
                     $sectionData = $this->getAdminData($module, $section);
                     $config = Kurogo::getModuleConfig($sectionData['config'], $moduleID);
                     $subsection = $moduleID;
                     break;
                 default:
                     throw new KurogoConfigurationException(__LINE__ . ": Invalid type {$type}");
             }
             if (!isset($sectionData['sections']) || (!isset($sectionData['sectiondelete']) || !$sectionData['sectiondelete'])) {
                 throw new KurogoConfigurationException(__LINE__ . ": Section '{$section}' does not permit removal of items");
             }
             if (!isset($sectionData['sections'][$key])) {
                 throw new KurogoConfigurationException(__LINE__ . ": Section {$key} not found in config '{$section}' of {$type} {$subsection}");
             }
             Kurogo::log(LOG_NOTICE, "Removing section {$key} from {$type} {$section} {$subsection}", 'admin');
             if (!($result = $config->removeSection($key))) {
                 throw new KurogoException(__LINE__ . ": Error removing item {$key} from config '" . $sectionData['config'] . "'");
             } else {
                 Kurogo::sharedInstance()->saveConfig($config);
             }
             $this->setResponse(true);
             $this->setResponseVersion(1);
             break;
         case 'addNewModule':
             $moduleData = $this->getArg('newModule');
             $module = $this->addNewModule($moduleData);
             $this->setResponseVersion(1);
             $this->setResponse(true);
             break;
         case 'removeModule':
             $moduleID = $this->getArg('configModule');
             try {
                 $module = WebModule::factory($moduleID);
             } catch (KurogoException $e) {
                 throw new KurogoException($this->getLocalizedString('ERROR_MODULE_NOT_FOUND', $moduleID));
             }
             $module->removeModule(true);
             $this->setResponseVersion(1);
             $this->setResponse(true);
             break;
         case 'setmodulelayout':
             Kurogo::log(LOG_NOTICE, "Updating module layout", 'admin');
             $data = $this->getArg('data', array());
             if (!isset($data['primary_modules'])) {
                 $data['primary_modules'] = array();
             }
             if (!isset($data['secondary_modules'])) {
                 $data['secondary_modules'] = array();
             }
             $config = Kurogo::getSiteConfig('navigation', 'site');
             $sections = array();
             foreach ($data['primary_modules'] as $moduleID => $title) {
                 $sections[$moduleID] = array('title' => $title);
             }
             foreach ($data['secondary_modules'] as $moduleID => $title) {
                 $sections[$moduleID] = array('type' => 'secondary', 'title' => $title);
             }
             $config->setSectionVars($sections);
             $result = Kurogo::sharedInstance()->saveConfig($config);
             $this->setResponse($result);
             $this->setResponseVersion(1);
             break;
         default:
             $this->invalidCommand();
             break;
     }
 }
开发者ID:sponto,项目名称:msbm-mobile,代码行数:101,代码来源:AdminAPIModule.php


注:本文中的Kurogo::getModuleConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。