public function actionSaveMedia() { $groupId = $this->_input->filterSingle('group_id', XenForo_Input::UINT); $containerType = $this->_input->filterSingle('container_type', XenForo_Input::STRING); Nobita_Teams_XenGallery_Media::setGroupId($groupId); $response = parent::actionSaveMedia(); if ($response instanceof XenForo_ControllerResponse_Redirect && $groupId) { $response->redirectTarget = $this->_buildLink(TEAM_ROUTE_PREFIX . '/photos', array('team_id' => $groupId)); } return $response; }
public function renderHtml() { if ($this->_params['collapsible'] == 'basic') { $categories =& $this->_params['categoriesGrouped']; } else { $categories =& $this->_params['categories']; } foreach ($categories as $categoryId => &$category) { if (!Nobita_Teams_XenGallery_Media::isVisibleCategory($category['category_id'])) { unset($categories[$categoryId]); } } return parent::renderHtml(); }
protected function _preSave() { $groupId = Nobita_Teams_XenGallery_Media::getGroupId(); if ($groupId) { $teamModel = $this->getModelFromCache('Nobita_Teams_Model_Team'); if (!$this->_teamData) { $this->_teamData = $teamModel->getFullTeamById($groupId); } if (!$this->_teamData) { $this->error(new XenForo_Phrase('Teams_requested_team_not_found')); return false; } if (!$teamModel->canViewTeam($this->_teamData, $this->_teamData)) { // special errors $this->error(new XenForo_Phrase('Teams_requested_team_not_found')); return false; } $this->set('social_group_id', $this->_teamData['team_id']); } return parent::_preSave(); }
public static function setGroupId($groupId) { self::$groupId = $groupId; }