items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->categories = $this->get('Categories'); if (count($errors = $this->get('Errors'))) { throw new \RuntimeException(implode("\n", $errors)); } $this->addToolbar(); return parent::display($tpl); } protected function addToolbar() { $user = $this->getCurrentUser(); $this->getDocument()->setTitle(Text::_('COM_TESTQUESTIONS')); if ($user->authorise('core.create', 'com_testquestions')) { ToolbarHelper::addNew('question.add', 'JTOOLBAR_NEW'); } if ($user->authorise('core.edit', 'com_testquestions')) { ToolbarHelper::editList('question.edit', 'JTOOLBAR_EDIT'); } if ($user->authorise('core.delete', 'com_testquestions')) { ToolbarHelper::deleteList('', 'questions.delete', 'JTOOLBAR_DELETE'); } ToolbarHelper::link( 'index.php?option=com_testquestions&view=categories', 'COM_TESTQUESTIONS_MANAGE_CATEGORIES', 'list' ); ToolbarHelper::link( 'index.php?option=com_testquestions&view=sets', 'COM_TESTQUESTIONS_SETS', 'list' ); } }