true]) { return parent::getModel($name, $prefix, $config); } public function preview(): void { if (!Session::checkToken()) { throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403); } $user = Factory::getApplication()->getIdentity(); if (!$user->authorise('core.edit', 'com_testquestions') && !$user->authorise('core.manage', 'com_testquestions')) { throw new \RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403); } $ids = array_values(array_unique(array_filter(array_map('intval', (array) $this->input->post->get('cid', [], 'array'))))); if (!$ids) { $this->setRedirect( Route::_('index.php?option=com_testquestions&view=questions', false), Text::_('COM_TESTQUESTIONS_PREVIEW_SELECT_QUESTIONS'), 'warning' ); return; } $this->setRedirect(Route::_('index.php?option=com_testquestions&view=preview&ids=' . implode(',', $ids), false)); } }