diff --git a/templates/config.tpl b/templates/config.tpl new file mode 100644 index 0000000..3728eea --- /dev/null +++ b/templates/config.tpl @@ -0,0 +1,40 @@ + +{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="config"} + +
+ La configuration a bien été enregistrée. +
+{/if} + +{form_errors} + + diff --git a/www/admin/config.php b/www/admin/config.php new file mode 100644 index 0000000..494046c --- /dev/null +++ b/www/admin/config.php @@ -0,0 +1,28 @@ +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');