From 997096b9bce9eda6909d63bfe1313df0dd99f20b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 6 Nov 2021 01:40:29 +0100 Subject: [PATCH] add header for modules configuration page --- CHANGELOG.md | 2 ++ inc/class.improve.action.php | 10 ++++++++++ index.php | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf96881..d2df297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ dev - [ ] add global config for file size limit - [ ] add module to check deprecated PHP function - [ ] add module to check directory structure +- [ ] add module to create full README file - [ ] write documentation of php class +- add header for modules configuration 0.5 - 2021.11.05 - add settings to disable (hide) modules diff --git a/inc/class.improve.action.php b/inc/class.improve.action.php index e3c3262..497ab89 100644 --- a/inc/class.improve.action.php +++ b/inc/class.improve.action.php @@ -200,6 +200,16 @@ abstract class ImproveAction */ abstract public function isConfigured(): bool; + /** + * Get action configuration page header + * + * @return string Headers + */ + public function header(): ?string + { + return null; + } + /** * Get configuraton gui * diff --git a/index.php b/index.php index eae0213..23bbb36 100644 --- a/index.php +++ b/index.php @@ -101,16 +101,22 @@ if (!empty($_POST['fix'])) { } } +$action = null; +$header = ''; $breadcrumb = []; if (!empty($_REQUEST['config'])) { $breadcrumb = [ __('Configure module') => '' ]; + if (null !== ($action = $improve->module($_REQUEST['config']))) { + $header = $action->header(); + } } # display header echo '' . __('improve') . '' . dcPage::jsLoad(dcPage::getPF('improve/js/index.js')) . +$header . '' . dcPage::breadcrumb(array_merge([ __('Plugins') => '', @@ -132,7 +138,7 @@ if (empty($_REQUEST['config'])) { if (!empty($_REQUEST['config'])) { $back_url = $_REQUEST['redir'] ?? $core->adminurl->get('admin.plugin.improve', ['type' => $type]); - if (null !== ($action = $improve->module($_REQUEST['config']))) { + if (null !== $action) { $redir = $_REQUEST['redir'] ?? $core->adminurl->get('admin.plugin.improve', ['type' => $type, 'config' => $action->id]); $res = $action->configure($redir);