protected function _getEventEditOrResponse(array $event, array $team, array $category) { $visitor = XenForo_Visitor::getInstance(); $attachmentModel = $this->getModelFromCache('XenForo_Model_Attachment'); $contentData = array('event_id' => $event['event_id'], 'team_id' => $team['team_id'], 'content_type' => 'team_event'); $attachments = array(); if (!empty($event['event_id'])) { $attachments = $attachmentModel->getAttachmentsByContentId('team_event', $event['event_id']); $attachments = $attachmentModel->prepareAttachments($attachments); } $attachmentHash = null; $attachmentParams = $this->_getTeamModel()->getAttachmentParams($team, $category, $contentData, null, null, $attachmentHash); $viewParams = array('event' => $event, 'team' => $team, 'category' => $category, 'eventTypes' => $this->_getEventModel()->prepareEventTypesOnCreateOrEdit($team, $category), 'timesMap' => Nobita_Teams_Setup::getTimeSelectableMap(), 'attachments' => $attachments, 'attachmentParams' => $attachmentParams, 'attachmentConstraints' => $this->getModelFromCache('XenForo_Model_Attachment')->getAttachmentConstraints(), 'canViewAttachments' => $visitor->hasPermission('Teams', 'viewAttachment'), 'canUploadAttachments' => $this->getModelFromCache('Nobita_Teams_Model_Category')->canUploadAttachments($category)); return $this->_getTeamHelper()->getTeamViewWrapper('events', $team, $category, $this->responseView('Nobita_Teams_ViewPublic_Event_Add', 'Team_event_edit', $viewParams)); }