Add the basic files for a garradin extension

This commit is contained in:
JBthePenguin 2021-05-31 13:05:31 +02:00
parent cf4c1e2dd1
commit c757583136
9 changed files with 85 additions and 2 deletions

26
www/admin/config.php Normal file
View file

@ -0,0 +1,26 @@
<?php
namespace Garradin;
$session->requireAccess($session::SECTION_CONFIG, $session::ACCESS_ADMIN);
if (f('save'))
{
$form->check('config_plugin_' . $plugin->id(), [
'display_hello' => 'boolean',
]);
if (!$form->hasErrors())
{
try {
$plugin->setConfig('display_hello', (bool) f('display_hello'));
utils::redirect(utils::plugin_url());
}
catch (UserException $e)
{
$form->addError($e->getMessage());
}
}
}
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');

5
www/admin/index.php Normal file
View file

@ -0,0 +1,5 @@
<?php
namespace Garradin;
$tpl->display(PLUGIN_ROOT . '/templates/index.tpl');