items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->subjects = $this->get('Subjects'); $user = $this->getCurrentUser(); $this->canUnpublishAll = $user->authorise('core.edit.state', 'com_testquestions') || $user->authorise('core.edit', 'com_testquestions'); 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_SETS')); if ($user->authorise('core.create', 'com_testquestions')) { ToolbarHelper::addNew('set.add', 'JTOOLBAR_NEW'); } if ($user->authorise('core.edit', 'com_testquestions')) { ToolbarHelper::editList('set.edit', 'JTOOLBAR_EDIT'); } if ($user->authorise('core.delete', 'com_testquestions')) { ToolbarHelper::deleteList('', 'sets.delete', 'JTOOLBAR_DELETE'); } ToolbarHelper::link( 'index.php?option=com_testquestions&view=questions', 'COM_TESTQUESTIONS_QUESTIONS', 'list' ); ToolbarHelper::link( 'index.php?option=com_testquestions&view=subjects', 'COM_TESTQUESTIONS_SUBJECTS', 'list' ); ToolbarHelper::link( 'index.php?option=com_testquestions&view=results', 'COM_TESTQUESTIONS_RESULTS', 'list' ); } }