Exemplo n.º 1
0
 /**
  * Display FAQ item list.
  *
  * @param string $contrib_type		Contrib type URL identifier.
  * @param string $contrib			Contrib name clean.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function display_list($contrib_type, $contrib)
 {
     $this->setup($contrib_type, $contrib);
     // Setup the sort tool
     $this->sort->set_url($this->contrib->get_url('faq'))->set_defaults($this->config['topics_per_page'])->request();
     // Define permissions here so we don't have to check these in a loop.
     $auth = array('move' => $this->check_auth('move'), 'edit' => $this->check_auth('edit'), 'delete' => $this->check_auth('delete'), 'create' => $this->check_auth('create'));
     // Output items.
     foreach ($this->get_items() as $id => $data) {
         $this->assign_item_row_vars($data, $auth);
     }
     $this->template->assign_vars(array('S_LIST' => true, 'U_CANONICAL' => $this->sort->build_canonical(), 'U_CREATE_FAQ' => $auth['create'] ? $this->faq->get_url('create') : false));
     $this->assign_vars();
     return $this->helper->render('contributions/contribution_faq.html', $this->contrib->contrib_name . ' - ' . $this->user->lang['FAQ_LIST']);
 }