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; }
public function run($tid, $act = 'apply') { $data = TopicUtils::getActivityInfo($tid); $data = $data['action']['info']; $errorMsg = ''; if (!empty($_POST)) { // discuz 源码会在mobile情况下把POST的数据转码成对应的charset, // 由于这里需要强制使用utf-8,且dz本身并没有修改$_REQUEST变量 $_POST = array_intersect_key($_REQUEST, $_POST); $requestData = WebUtils::jsonEncode($_POST, 'utf-8'); $res = WebUtils::httpRequestAppAPI('forum/topicactivity', array('tid' => $tid, 'act' => $act, 'json' => rawurlencode($requestData))); if (($res = WebUtils::jsonDecode($res)) != false && $res['head']['errCode'] == MOBCENT_ERROR_NONE) { $this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview')); } if ($res != false) { $errorMsg = $res['head']['errInfo']; } } // render $viewFile = 'topicActivity'; $this->getController()->renderPartial($viewFile, array('data' => $data, 'errorMsg' => $errorMsg, 'formUrl' => WebUtils::createUrl_oldVersion('forum/topicactivityview', array('tid' => $tid, 'act' => $act)))); }
<a class="left carousel-control" href=".carousel-example-generic_one" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href=".carousel-example-generic_one" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> <?php } elseif ($component['style'] == AppbymeUIDiyModel::COMPONENT_STYLE_LAYOUT_NEWS_AUTO) { ?> <?php foreach ($component['componentList'] as $key => $comp) { ?> <?php $newslist = WebUtils::httpRequestAppAPI('portal/newslist', array('moduleId' => $component['componentList'][0]['extParams']['newsModuleId'], 'hacker_uid' => 1)); $newslist = WebUtils::jsonDecode($newslist); ?> <?php foreach ($newslist['list'] as $list) { ?> <div class="newsauto-component-item"> <div class="pull-left"> <img src="<?php echo str_replace('xgsize', 'mobcentSmallPreview', $list['pic_path']); ?> " style="width:50px;height:50px" class="img-rounded"> </div> <div class="pull-left text-left page-main"> <div class="page-title"><strong><?php echo $list['title'];