2015-07-14 04:16:28 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
2015-07-14 06:41:32 +02:00
|
|
|
// ============================================================================
|
2021-02-07 18:13:25 +01:00
|
|
|
// Authorization
|
2015-07-14 06:41:32 +02:00
|
|
|
// ============================================================================
|
|
|
|
|
2018-05-20 21:48:43 +02:00
|
|
|
checkRole(array('admin'));
|
2015-07-14 06:41:32 +02:00
|
|
|
|
2015-07-14 04:16:28 +02:00
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
2021-02-07 18:13:25 +01:00
|
|
|
// Main
|
2015-07-14 04:16:28 +02:00
|
|
|
// ============================================================================
|
2021-02-07 18:13:25 +01:00
|
|
|
|
2017-05-27 19:46:46 +02:00
|
|
|
$plugin = false;
|
2015-07-28 03:01:52 +02:00
|
|
|
$pluginClassName = $layout['parameters'];
|
2015-07-14 04:16:28 +02:00
|
|
|
|
2017-05-27 19:46:46 +02:00
|
|
|
// Check if the plugin exists
|
2018-05-20 21:48:43 +02:00
|
|
|
if (isset($plugins['all'][$pluginClassName])) {
|
2017-05-27 19:46:46 +02:00
|
|
|
$plugin = $plugins['all'][$pluginClassName];
|
2018-05-20 21:48:43 +02:00
|
|
|
} else {
|
2017-05-27 19:46:46 +02:00
|
|
|
Redirect::page('plugins');
|
2015-07-14 04:16:28 +02:00
|
|
|
}
|
|
|
|
|
2015-08-01 18:28:47 +02:00
|
|
|
// Check if the plugin has the method form()
|
2018-05-20 21:48:43 +02:00
|
|
|
if (!method_exists($plugin, 'form')) {
|
2017-05-27 19:46:46 +02:00
|
|
|
Redirect::page('plugins');
|
2015-08-01 18:28:47 +02:00
|
|
|
}
|
|
|
|
|
2021-02-07 22:03:53 +01:00
|
|
|
// Save the settings
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
|
|
$plugin->post();
|
|
|
|
$syslog->add(array(
|
|
|
|
'dictionaryKey'=>'plugin-configured',
|
|
|
|
'notes'=>$plugin->name()
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2021-02-07 18:13:25 +01:00
|
|
|
// HTML <title>
|
|
|
|
$layout['title'] = $L->g('Plugin'). ' [ ' .$plugin->name(). ' ] ' . ' - ' . $layout['title'];
|