Exemplo n.º 1
0
 /**
  *
  * @see XenResource_ControllerPublic_Resource::actionIndex()
  */
 public function actionIndex()
 {
     $response = parent::actionIndex();
     if ($response instanceof XenForo_ControllerResponse_View) {
         $categoryModel = $this->_getCategoryModel();
         if (class_exists('ThemeHouse_ResMans_ResourceManager')) {
             if (ThemeHouse_ResMans_ResourceManager::hasInstance()) {
                 $resourceManager = ThemeHouse_ResMans_ResourceManager::getInstance();
                 if (!empty($resourceManager['resource_manager_id'])) {
                     $resourceModel = $this->_getResourceModel();
                     $response->params['activeAuthorsForRM'] = $resourceModel->getMostActiveAuthorsForResourceManager($resourceManager['resource_manager_id'], 5);
                 }
             }
         }
     }
     return $response;
 }
Exemplo n.º 2
0
 public function actionIndex()
 {
     if (class_exists('ThemeHouse_ResMans_ResourceManager')) {
         if (ThemeHouse_ResMans_ResourceManager::hasInstance()) {
             $resourceManager = ThemeHouse_ResMans_ResourceManager::getInstance();
             if (!empty($resourceManager['resource_manager_id'])) {
                 if ($this->_input->filterSingle('user_id', XenForo_Input::UINT)) {
                     return $this->responseReroute(__CLASS__, 'view');
                 }
                 $resourceModel = $this->_getResourceModel();
                 $authors = $resourceModel->getMostActiveAuthorsForResourceManager($resourceManager['resource_manager_id'], 20);
                 if (!$authors) {
                     return $this->responseRedirect(XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL, XenForo_Link::buildPublicLink('resources'));
                 }
                 $viewParams = array('authors' => $authors);
                 return $this->responseView('XenResource_ViewPublic_Author_List', 'resource_author_list', $viewParams);
             }
         }
     }
     return parent::actionIndex();
 }