示例#1
0
 public static function navigation_tabs(array &$extraTabs, $selectedTabId)
 {
     $indexNodeId = WidgetFramework_Option::get('indexNodeId');
     if ($indexNodeId > 0 and XenForo_Template_Helper_Core::styleProperty('wf_homeNavTab')) {
         $tabId = WidgetFramework_Option::get('indexTabId');
         $extraTabs[$tabId] = array('title' => new XenForo_Phrase('wf_home_navtab'), 'href' => XenForo_Link::buildPublicLink('full:widget-page-index'), 'position' => 'home', 'linksTemplate' => 'wf_home_navtab_links', 'indexNodeId' => $indexNodeId, 'childNodes' => WidgetFramework_Helper_Index::getChildNodes());
     }
 }
示例#2
0
 public function actionIndex()
 {
     $nodeId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);
     $nodeName = $this->_input->filterSingle('node_name', XenForo_Input::STRING);
     $widgetPage = $this->_getWidgetPageOrError($nodeId ? $nodeId : $nodeName);
     $page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));
     $this->canonicalizeRequestUrl(XenForo_Link::buildPublicLink('widget-pages', $widgetPage, array('page' => $page)));
     $widgets = $this->_getWidgetModel()->getWidgetPageWidgets($widgetPage['node_id']);
     $nodeBreadCrumbs = $this->_getNodeModel()->getNodeBreadCrumbs($widgetPage, false);
     $viewParams = array('widgetPage' => $widgetPage, 'widgets' => $widgets, 'nodeBreadCrumbs' => $nodeBreadCrumbs, 'page' => $page);
     if (class_exists('bdCache_ControllerHelper_Cache')) {
         $this->getHelper('bdCache_ControllerHelper_Cache')->markViewParamsAsCacheable($viewParams);
     }
     $indexNodeId = WidgetFramework_Option::get('indexNodeId');
     // TODO: should we change section for other node type too?
     $indexChildNodes = WidgetFramework_Helper_Index::getChildNodes();
     if ($widgetPage['node_id'] == $indexNodeId or isset($indexChildNodes[$widgetPage['node_id']])) {
         $this->_routeMatch->setSections(WidgetFramework_Option::get('indexTabId'));
     }
     return $this->responseView('WidgetFramework_ViewPublic_WidgetPage_Index', 'wf_widget_page_index', $viewParams);
 }