Beispiel #1
0
 /**
  * Display a category, its children, and its contributions.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_category($category1, $category2, $category3, $category4)
 {
     $categories = array($category1, $category2, $category3, $category4);
     try {
         $this->load_category($categories);
     } catch (\Exception $e) {
         // If the category does not exist, check whether this is an old link
         // that may have been caught by the route matcher.
         $rerouter = new \phpbb\titania\controller\legacy_rerouter($this->helper);
         $url = '/' . implode('/', array_filter($categories, 'strlen'));
         return $rerouter->redirect($url);
     }
     $this->set_branch($this->get_branch($categories));
     $children = $this->get_children_ids();
     // Include the current category in the ones selected
     $children[] = $this->id;
     $sort = $this->list_contributions($children, $this->category->get_url());
     $this->params = $this->get_params($sort);
     $title = $this->category->get_name() . ' - ' . $this->user->lang['CUSTOMISATION_DATABASE'];
     $this->display->assign_global_vars();
     $this->generate_breadcrumbs();
     if ($this->request->is_ajax()) {
         return $this->get_ajax_response($title, $sort);
     }
     $this->display->display_categories($this->id, 'categories', false, true, $this->params);
     $this->template->assign_vars(array('CATEGORY_ID' => $this->id, 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => $this->helper->route('phpbb.titania.search.contributions.results'), 'U_QUEUE_STATS' => $this->get_queue_stats_url(), 'U_CREATE_CONTRIBUTION' => $this->get_create_contrib_url(), 'U_ALL_CONTRIBUTIONS' => $this->get_index_url($this->params)));
     $this->assign_sorting($sort);
     $this->assign_branches();
     return $this->helper->render('index_body.html', $title);
 }