Example #1
0
 public static function filterComponent($component)
 {
     $tempComponent = $component;
     // 临时处理
     if ($component['type'] == AppbymeUIDiyModel::COMPONENT_TYPE_FORUMLIST) {
         $tempComponent['extParams']['forumId'] = 0;
     }
     $tempComponent['style'] = self::_filterStyle($component['style']);
     $tempComponent['extParams']['subListStyle'] = self::_filterStyle($component['extParams']['subListStyle']);
     $tempComponent['extParams']['subDetailViewStyle'] = self::_filterStyle($component['extParams']['subDetailViewStyle']);
     // 转换componentList结构
     $tempComponentList = array();
     if ($tempComponent['style'] == AppbymeUIDiyModel::COMPONENT_STYLE_LAYOUT_NEWS_AUTO && count($tempComponent['componentList']) > 0 && $tempComponent['componentList'][0]['type'] == AppbymeUIDiyModel::COMPONENT_TYPE_NEWSLIST) {
         $newslist = WebUtils::httpRequestAppAPI('portal/newslist', array('moduleId' => $tempComponent['componentList'][0]['extParams']['newsModuleId']));
         if ($newslist = WebUtils::jsonDecode($newslist)) {
             foreach ($newslist['list'] as $key => $value) {
                 $tempParam = array('title' => $value['title'], 'desc' => $value['summary'], 'icon' => $value['pic_path']);
                 if ($value['source_type'] == 'topic') {
                     $tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_POSTLIST, 'extParams' => array('topicId' => $value['source_id'])));
                 } else {
                     if ($value['source_type'] == 'weblink') {
                         $tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_WEBAPP, 'extParams' => array('redirect' => $value['redirectUrl'])));
                     } else {
                         if ($value['source_type'] == 'news') {
                             $tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_NEWSVIEW, 'extParams' => array('articleId' => $value['source_id'])));
                         }
                     }
                 }
                 $tempComponentList[] = array_merge(AppbymeUIDiyModel::initComponent(), $tempParam);
             }
         }
     } else {
         foreach ($tempComponent['componentList'] as $subComponent) {
             $tempComponentList[] = self::filterComponent($subComponent);
         }
     }
     $tempComponent['componentList'] = $tempComponentList;
     return $tempComponent;
 }
Example #2
0
?>
',
        componentDiscoverIconBaseUrlPath: '<?php 
echo $this->componentDiscoverIconBaseUrlPath;
?>
',
        componentTopbarIconBaseUrlPath: '<?php 
echo $this->componentTopbarIconBaseUrlPath;
?>
',
        moduleInitParams: <?php 
echo WebUtils::jsonEncode(AppbymeUIDiyModel::initModule(), 'utf-8');
?>
,
        componentInitParams: <?php 
echo WebUtils::jsonEncode(AppbymeUIDiyModel::initComponent(), 'utf-8');
?>
,
        layoutInitParams: <?php 
echo WebUtils::jsonEncode(AppbymeUIDiyModel::initLayout(), 'utf-8');
?>
,
        moduleInitList: <?php 
echo WebUtils::jsonEncode($modules, 'utf-8');
?>
,
        navItemInitParams: <?php 
echo WebUtils::jsonEncode(AppbymeUIDiyModel::initNavItem(), 'utf-8');
?>
,
        navItemInitList: <?php