recusfiscaux/www/admin/config.php
engel 9bbd9de84f ajout gestion configuration
FossilOrigin-Name: 55aa65aa3ba12a83c4f9bf2e77f37f84412765180708aa2d64e49e0620d1dded
2022-01-29 14:00:04 +00:00

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');