/** * 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'); }
/** * Assign navigation tabs to the template. * * @param string $page Current active page. * @return null */ protected function generate_navigation($page) { $nav_ary = $this->get_navigation_options(); // Display nav menu $this->display->generate_nav($nav_ary, $page, 'attention'); // Generate the main breadcrumbs $this->display->generate_breadcrumbs(array($this->user->lang['MANAGE'] => $this->helper->route('phpbb.titania.manage'))); if ($page) { $this->display->generate_breadcrumbs(array($nav_ary[$page]['title'] => $nav_ary[$page]['url'])); } }
/** * Display queue stats. * * @param string $contrib_type Contribution type URL value. * @return \Symfony\Component\HttpFoundation\Response */ public function display_stats($contrib_type) { $this->user->add_lang_ext('phpbb/titania', array('queue_stats', 'contributions')); $this->set_type($contrib_type); if (!$this->stats_supported()) { return $this->helper->error('NO_QUEUE_STATS'); } $this->stats->set_queue_type($this->type->id); if (!$this->generate_stats()) { return $this->helper->error('NO_QUEUE_STATS'); } $this->generate_history(); $this->display->assign_global_vars(); $page_title = $this->user->lang['QUEUE_STATS'] . ' - ' . $this->type->langs; $this->display->generate_breadcrumbs(array($page_title => $this->helper->route('phpbb.titania.queue_stats', array('contrib_type' => $this->type->url)))); return $this->helper->render('queue_stats_body.html', $page_title); }
/** * Assign breadcrumbs to the template. * * @return null */ protected function generate_breadcrumbs() { $category = new \titania_category(); // Parents foreach (array_reverse($this->cache->get_category_parents($this->id)) as $row) { $category->__set_array($this->categories[$row['category_id']]); $this->display->generate_breadcrumbs(array($category->get_name() => $category->get_url())); } // Self $this->display->generate_breadcrumbs(array($this->category->get_name() => $this->category->get_url())); }
/** * Generate navigation tabs. * * @param string $page Active page. * @return null */ protected function generate_navigation($page) { $nav_ary = array('details' => array('title' => 'AUTHOR_DETAILS', 'url' => $this->author->get_url()), 'contributions' => array('title' => 'AUTHOR_CONTRIBS', 'url' => $this->author->get_url('contributions')), 'support' => array('title' => 'AUTHOR_SUPPORT', 'url' => $this->author->get_url('support'), 'auth' => $this->is_owner && $this->cache->get_author_contribs($this->author->user_id, $this->types, $this->user)), 'create' => array('title' => 'NEW_CONTRIBUTION', 'url' => $this->author->get_url('create'), 'auth' => $this->is_owner && $this->auth->acl_get('u_titania_contrib_submit')), 'manage' => array('title' => 'MANAGE_AUTHOR', 'url' => $this->author->get_url('manage'), 'auth' => $this->is_owner || $this->auth->acl_get('u_titania_mod_author_mod'))); // Display nav menu $this->display->generate_nav($nav_ary, $page, 'details'); // Generate the main breadcrumbs $this->display->generate_breadcrumbs(array($this->author->username => $this->author->get_url())); if ($page != 'details') { $this->display->generate_breadcrumbs(array($nav_ary[$page]['title'] => $nav_ary[$page]['url'])); } }
/** * Assign breadcrumbs to template. * * @return null */ protected function generate_breadcrumbs() { // Search for a category with the same name as the contrib type. This is a bit ugly, but there really isn't any better option $categories = $this->cache->get_categories(); $category = new \titania_category(); foreach ($categories as $category_id => $category_row) { $category->__set_array($category_row); $name = $category->get_name(); if ($name == $this->contrib->type->lang || $name == $this->contrib->type->langs) { // Generate the main breadcrumbs $this->display->generate_breadcrumbs(array($name => $category->get_url())); } } }