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


PHP Kurogo::getModuleSections方法代码示例

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


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

示例1: getDetailGroups

 protected function getDetailGroups(KurogoDataObject $object, $configName)
 {
     $detailFields = Kurogo::getModuleSections($configName, $this->configModule);
     $groups = array();
     foreach ($detailFields as $key => $keyData) {
         $group = Kurogo::arrayVal($keyData, 'group', 0);
         $grouptype = Kurogo::arrayVal($keyData, 'grouptype', 'navlist');
         //get the object we're using for this field
         $keyObject = $this->getObject($object, $keyData);
         if ($listType = Kurogo::arrayVal($keyData, 'list-type')) {
             $groupObjects = $this->getObjectField($keyObject, $key);
             if (!is_array($groupObjects)) {
                 throw new KurogoException("Result of " . get_class($keyObject) . " {$key} did not return an array");
             }
             foreach ($groupObjects as $objectKey => $groupObject) {
                 $_groups = $this->getDetailGroups($groupObject, 'list-' . $listType);
                 foreach ($_groups as $_groupKey => $_groupData) {
                     $groupObjectKey = $objectKey . '-' . $_groupKey;
                     $groupOptions = array('object' => $groupObject, 'group' => $groupObjectKey, 'groupkey' => $_groupKey);
                     $groups[$groupObjectKey] = array_merge($groupOptions, $_groupData);
                 }
             }
             break;
         } else {
             if (!isset($groups[$group])) {
                 $groups[$group] = array();
             }
             if (isset($keyData['groupheading'])) {
                 $groups[$group]['groupheading'] = $keyData['groupheading'];
                 unset($keyData['groupheading']);
             } elseif (isset($keyData['groupheadingfield'])) {
                 $groups[$group]['groupheading'] = $this->getObjectField($keyObject, $keyData['groupheadingfield']);
                 unset($keyData['groupheadingfield']);
             }
             if (isset($keyData['groupsubheading'])) {
                 $groups[$group]['groupsubheading'] = $keyData['groupsubheading'];
                 unset($keyData['groupsubheading']);
             } elseif (isset($keyData['groupsubheadingfield'])) {
                 $groups[$group]['groupsubheading'] = $this->getObjectField($keyObject, $keyData['groupsubheadingfield']);
                 unset($keyData['groupsubheadingfield']);
             }
             if (isset($keyData['subTitleNewline'])) {
                 $groups[$group]['subTitleNewline'] = $keyData['subTitleNewline'];
                 unset($keyData['subTitleNewline']);
             }
             switch ($grouptype) {
                 case 'html':
                     $groups[$group] = array_merge($groups[$group], $keyData);
                     $groups[$group]['html'] = $this->getObjectField($keyObject, $key);
                     $groups[$group]['type'] = $grouptype;
                     $groups[$group]['field'] = $key;
                     break;
                 case 'navlist':
                 case 'list':
                     $groups[$group]['type'] = $grouptype;
                     $groups[$group]['fields'][$key] = $keyData;
                     break;
                 default:
                     throw new KurogoConfigurationException("Invalid grouptype {$grouptype} for {$key}");
             }
         }
     }
     return $groups;
 }
开发者ID:sponto,项目名称:msbm-mobile,代码行数:64,代码来源:DataObjectDetailsController.php


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