Add the basic files for a garradin extension
This commit is contained in:
parent
cf4c1e2dd1
commit
c757583136
9 changed files with 85 additions and 2 deletions
26
www/admin/config.php
Normal file
26
www/admin/config.php
Normal 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
5
www/admin/index.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/index.tpl');
|
||||
Loading…
Add table
Add a link
Reference in a new issue