Save AI settings through component page
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Komponent\Component\Testquestions\Administrator\View\Ai;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
protected array $settings = [];
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$raw = (string) $db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_testquestions'))
|
||||
)->loadResult();
|
||||
$this->settings = json_decode($raw, true) ?: [];
|
||||
|
||||
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_AI_SETTINGS'));
|
||||
ToolbarHelper::link('index.php?option=com_testquestions&view=questions', 'COM_TESTQUESTIONS_QUESTIONS', 'arrow-left');
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class HtmlView extends BaseHtmlView
|
||||
);
|
||||
|
||||
ToolbarHelper::link(
|
||||
'index.php?option=com_config&view=component&component=com_testquestions',
|
||||
'index.php?option=com_testquestions&view=ai',
|
||||
'COM_TESTQUESTIONS_AI_SETTINGS_MENU',
|
||||
'cog'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user