29 lines
882 B
PHP
29 lines
882 B
PHP
|
<?php
|
||
|
|
||
|
namespace Garradin;
|
||
|
|
||
|
$session->requireAccess($session::SECTION_CONFIG, $session::ACCESS_ADMIN);
|
||
|
|
||
|
if (f('save') && $form->check('recusfiscaux_config'))
|
||
|
{
|
||
|
try {
|
||
|
$plugin->setConfig('objet_0', trim(f('objet_0')));
|
||
|
$plugin->setConfig('objet_1', trim(f('objet_1')));
|
||
|
$plugin->setConfig('objet_2', trim(f('objet_2')));;
|
||
|
$plugin->setConfig('cgi_art1', (bool)f('cgi_art_1'));
|
||
|
$plugin->setConfig('cgi_art2', (bool)f('cgi_art_2'));
|
||
|
$plugin->setConfig('cgi_art3', (bool)f('cgi_art_3'));
|
||
|
\Garradin\Utils::redirect(PLUGIN_URL . 'config.php?ok');
|
||
|
}
|
||
|
catch (UserException $e)
|
||
|
{
|
||
|
$form->addError($e->getMessage());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$tpl->assign('ok', qg('ok') !== null);
|
||
|
$tpl->assign('plugin_config', $plugin->getConfig());
|
||
|
$tpl->assign('plugin_css', ['style.css']);
|
||
|
|
||
|
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');
|