示例#1
0
 /**
  * Display support topics from all contributions or of a specific type.
  *
  * @param string $type	Contribution type's string identifier
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_topics($type)
 {
     $type_id = $this->get_type_id($type);
     if ($type_id === false) {
         return $this->helper->error('NO_PAGE', 404);
     }
     if ($type == 'all') {
         // Mark all topics read
         if ($this->request->variable('mark', '') == 'topics') {
             $this->tracking->track(TITANIA_ALL_SUPPORT, self::ALL_SUPPORT);
         }
         // Mark all topics read
         $this->template->assign_var('U_MARK_TOPICS', $this->helper->route('phpbb.titania.support', array('type' => 'all', 'mark' => 'topics')));
     }
     $this->display->assign_global_vars();
     $u_all_support = $this->helper->route('phpbb.titania.support', array('type' => 'all'));
     $this->template->assign_var('U_ALL_SUPPORT', $u_all_support);
     // Generate the main breadcrumbs
     $this->display->generate_breadcrumbs(array('ALL_SUPPORT' => $u_all_support));
     // Links to the support topic lists
     foreach ($this->types->get_all() as $id => $class) {
         $this->template->assign_block_vars('support_types', array('U_SUPPORT' => $this->helper->route('phpbb.titania.support', array('type' => $class->url)), 'TYPE_SUPPORT' => $class->langs));
     }
     $data = \topics_overlord::display_forums_complete('all_support', false, array('contrib_type' => $type_id));
     // Canonical URL
     $data['sort']->set_url($this->helper->route('phpbb.titania.support', array('type' => $type)));
     $this->template->assign_var('U_CANONICAL', $data['sort']->build_canonical());
     return $this->helper->render('all_support.html', 'CUSTOMISATION_DATABASE');
 }
 /**
  * Display queue discussion type.
  *
  * @param string $queue_type 	Queue type URL identifier.
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_type($queue_type)
 {
     $type = $this->load_type($queue_type);
     if (!$type->acl_get('queue_discussion')) {
         return $this->helper->needs_auth();
     }
     // Mark all topics read
     if ($this->request->variable('mark', '') == 'topics') {
         $this->tracking->track(TITANIA_QUEUE_DISCUSSION, self::ALL_TYPES);
     }
     $this->display->assign_global_vars();
     $this->generate_navigation('queue_discussion');
     // Add to Breadcrumbs
     $this->display->generate_breadcrumbs(array($type->lang => $this->get_type_url($type)));
     \topics_overlord::display_forums_complete('queue_discussion', false, array('topic_category' => $type->id));
     // Mark all topics read
     $this->template->assign_var('U_MARK_TOPICS', $this->get_type_url($type, array('mark' => 'topics')));
     return $this->helper->render('manage/queue_discussion.html', 'QUEUE_DISCUSSION');
 }
示例#3
0
 /**
  * Display FAQ item.
  *
  * @param string $contrib_type		Contrib type URL identifier.
  * @param string $contrib			Contrib name clean.
  * @param int $id					FAQ item id
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_item($contrib_type, $contrib, $id)
 {
     $this->setup($contrib_type, $contrib);
     $this->load_item($id);
     if ($this->faq->faq_access < $this->access->get_level()) {
         return $this->helper->needs_auth();
     }
     // Increase a FAQ views counter
     $this->faq->increase_views_counter();
     // Tracking
     $this->tracking->track(TITANIA_FAQ, $this->id);
     $message = $this->faq->generate_text_for_display();
     // Grab attachments
     $this->attachments->configure(TITANIA_FAQ, $this->id)->load();
     $parsed_attachments = $this->attachments->parse_attachments($message);
     foreach ($parsed_attachments as $attachment) {
         $this->template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
     }
     $this->template->assign_vars(array('FAQ_SUBJECT' => $this->faq->faq_subject, 'FAQ_TEXT' => $message, 'FAQ_VIEWS' => $this->faq->faq_views, 'S_DETAILS' => true, 'S_ACCESS_TEAMS' => $this->access->is_team($this->faq->faq_access), 'S_ACCESS_AUTHORS' => $this->access->is_author($this->faq->faq_access), 'U_CANONICAL' => $this->faq->get_url(), 'U_EDIT_FAQ' => $this->check_auth('edit') ? $this->faq->get_url('edit') : false));
     $this->assign_vars();
     return $this->helper->render('contributions/contribution_faq.html', $this->faq->faq_subject . ' - ' . $this->contrib->contrib_name);
 }
示例#4
0
 /**
  * Display author's support topics page.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function support()
 {
     if (!$this->is_owner) {
         return $this->helper->needs_auth();
     }
     // Mark all topics read
     if ($this->request->variable('mark', '') == 'topics') {
         foreach ($this->cache->get_author_contribs($this->author->user_id, $this->types, $this->user) as $contrib_id) {
             $this->tracking->track(TITANIA_SUPPORT, $contrib_id);
         }
     }
     \topics_overlord::display_forums_complete('author_support', $this->author);
     // Mark all topics read
     $this->template->assign_var('U_MARK_TOPICS', $this->author->get_url('support', array('mark' => 'topics')));
     return $this->helper->render('contributions/contribution_support.html', $this->get_title('AUTHOR_SUPPORT'));
 }
示例#5
0
 /**
  * Details page.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function details()
 {
     $this->contrib->get_download();
     $this->contrib->get_revisions();
     $this->contrib->get_screenshots();
     $this->contrib->get_rating();
     $this->contrib->assign_details();
     if (!$this->user->data['is_bot']) {
         $this->contrib->increase_view_counter();
     }
     // Set tracking
     $this->tracking->track(TITANIA_CONTRIB, $this->contrib->contrib_id);
     // Subscriptions
     $this->subscriptions->handle_subscriptions(TITANIA_CONTRIB, $this->contrib->contrib_id, $this->contrib->get_url(), 'SUBSCRIBE_CONTRIB');
     // Canonical URL
     $this->template->assign_var('U_CANONICAL', $this->contrib->get_url());
     return $this->helper->render('contributions/contribution_details.html', $this->contrib->contrib_name . ' - ' . $this->user->lang['CONTRIB_DETAILS']);
 }
示例#6
0
 /**
  * Display the main index page.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_index($branch)
 {
     $this->set_branch($branch);
     $title = $this->user->lang('CUSTOMISATION_DATABASE');
     $sort = $this->list_contributions('', self::ALL_CONTRIBS, '');
     $this->params = $this->get_params($sort);
     $this->display->assign_global_vars();
     if ($this->request->is_ajax()) {
         return $this->get_ajax_response($title, $sort);
     }
     $this->display->display_categories(self::ALL_CONTRIBS, 'categories', false, true, $this->params);
     // Mark all contribs read
     if ($this->request->variable('mark', '') == 'contribs') {
         $this->tracking->track(TITANIA_CONTRIB, self::ALL_CONTRIBS);
     }
     $this->template->assign_vars(array('CATEGORY_ID' => self::ALL_CONTRIBS, 'U_CREATE_CONTRIBUTION' => $this->get_create_contrib_url(), 'U_MARK_FORUMS' => $this->path_helper->append_url_params($this->helper->get_current_url(), array('mark' => 'contribs')), 'L_MARK_FORUMS_READ' => $this->user->lang['MARK_CONTRIBS_READ'], 'U_ALL_CONTRIBUTIONS' => $this->get_index_url($this->params), 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => $this->helper->route('phpbb.titania.search.contributions.results')));
     $this->assign_sorting($sort);
     $this->assign_branches();
     return $this->helper->render('index_body.html', $title);
 }
示例#7
0
 /**
  * Display support page.
  *
  * @param string $contrib_type	Contrib type URL identifier.
  * @param string $contrib		Contrib name clean.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_support($contrib_type, $contrib)
 {
     $this->load_contrib($contrib_type, $contrib);
     if (!$this->check_auth()) {
         return $this->helper->needs_auth();
     }
     $this->user->add_lang('viewforum');
     // Subscriptions
     $this->subscriptions->handle_subscriptions(TITANIA_SUPPORT, $this->contrib->contrib_id, $this->contrib->get_url('support'), 'SUBSCRIBE_SUPPORT');
     // Mark all topics read
     if ($this->request->variable('mark', '') == 'topics') {
         $this->tracking->track(TITANIA_SUPPORT, $this->contrib->contrib_id);
     }
     $can_post_topic = $this->ext_config->support_in_titania && $this->auth->acl_get('u_titania_topic');
     $data = \topics_overlord::display_forums_complete('support', $this->contrib);
     $data['sort']->set_url($this->contrib->get_url('support'));
     $this->template->assign_vars(array('U_POST_TOPIC' => $can_post_topic ? $this->contrib->get_url('posting') : '', 'U_MARK_TOPICS' => $this->contrib->get_url('support', array('mark' => 'topics')), 'U_CANONICAL' => $data['sort']->build_canonical(), 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => $this->helper->route('phpbb.titania.search.results'), 'SEARCH_HIDDEN_FIELDS' => build_hidden_fields(array('type' => TITANIA_SUPPORT, 'contrib' => $this->contrib->contrib_id))));
     $this->assign_vars();
     return $this->helper->render('contributions/contribution_support.html', $this->contrib->contrib_name . ' - ' . $this->user->lang['CONTRIB_SUPPORT']);
 }