From f82d78ad5d2dd9b4d77f9ee6e5638d52f8bc7c4a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 20 Apr 2022 17:08:49 +0200 Subject: [PATCH] add 'back to overview' links when adding/editing entities Signed-off-by: Michael Kaufmann --- lib/formfields/admin/admin/formfield.admin_add.php | 1 + lib/formfields/admin/admin/formfield.admin_edit.php | 1 + lib/formfields/admin/customer/formfield.customer_add.php | 1 + lib/formfields/admin/customer/formfield.customer_edit.php | 1 + lib/formfields/admin/domains/formfield.domains_add.php | 1 + lib/formfields/admin/domains/formfield.domains_edit.php | 1 + lib/formfields/admin/domains/formfield.domains_import.php | 1 + .../admin/ipsandports/formfield.ipsandports_add.php | 1 + .../admin/ipsandports/formfield.ipsandports_edit.php | 1 + .../admin/phpconfig/formfield.fpmconfig_add.php | 1 + .../admin/phpconfig/formfield.fpmconfig_edit.php | 1 + .../admin/phpconfig/formfield.phpconfig_add.php | 1 + .../admin/phpconfig/formfield.phpconfig_edit.php | 1 + lib/formfields/customer/domains/formfield.domains_add.php | 1 + .../customer/domains/formfield.domains_edit.php | 1 + lib/formfields/customer/email/formfield.emails_add.php | 1 + lib/formfields/customer/email/formfield.emails_edit.php | 1 + lib/formfields/customer/extras/formfield.htaccess_add.php | 1 + .../customer/extras/formfield.htaccess_edit.php | 1 + lib/formfields/customer/extras/formfield.htpasswd_add.php | 1 + .../customer/extras/formfield.htpasswd_edit.php | 1 + lib/formfields/customer/ftp/formfield.ftp_add.php | 1 + lib/formfields/customer/ftp/formfield.ftp_edit.php | 1 + lib/formfields/customer/mysql/formfield.mysql_add.php | 1 + lib/formfields/customer/mysql/formfield.mysql_edit.php | 1 + lib/tablelisting/customer/tablelisting.htaccess.php | 1 + lib/tablelisting/customer/tablelisting.htpasswd.php | 1 + templates/Froxlor/user/form.html.twig | 8 ++++++++ 28 files changed, 35 insertions(+) diff --git a/lib/formfields/admin/admin/formfield.admin_add.php b/lib/formfields/admin/admin/formfield.admin_add.php index 0fbaa4fd..d60a474c 100644 --- a/lib/formfields/admin/admin/formfield.admin_add.php +++ b/lib/formfields/admin/admin/formfield.admin_add.php @@ -21,6 +21,7 @@ return array( 'admin_add' => array( 'title' => $lng['admin']['admin_add'], 'image' => 'fa-solid fa-user-plus', + 'self_overview' => ['section' => 'admins', 'page' => 'admins'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['accountdata'], diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index 2d56d132..5fb8772d 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -18,6 +18,7 @@ return array( 'admin_edit' => array( 'title' => $lng['admin']['admin_edit'], 'image' => 'fa-solid fa-user-pen', + 'self_overview' => ['section' => 'admins', 'page' => 'admins'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['accountdata'], diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 5e7a75f6..40acb4ac 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -18,6 +18,7 @@ return array( 'customer_add' => array( 'title' => $lng['admin']['customer_add'], 'image' => 'fa-solid fa-user-plus', + 'self_overview' => ['section' => 'customers', 'page' => 'customers'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['accountdata'], diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 25cece99..c226cfff 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -18,6 +18,7 @@ return array( 'customer_edit' => array( 'title' => $lng['admin']['customer_edit'], 'image' => 'fa-solid fa-user-pen', + 'self_overview' => ['section' => 'customers', 'page' => 'customers'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['accountdata'], diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index 2de32729..5c8f5bdd 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -21,6 +21,7 @@ return array( 'domain_add' => array( 'title' => $lng['admin']['domain_add'], 'image' => 'fa-solid fa-globe', + 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domainsettings'], diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index 79cea3df..fd5f0b6c 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -18,6 +18,7 @@ return array( 'domain_edit' => array( 'title' => $lng['admin']['domain_edit'], 'image' => 'fa-solid fa-globe', + 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domainsettings'], diff --git a/lib/formfields/admin/domains/formfield.domains_import.php b/lib/formfields/admin/domains/formfield.domains_import.php index d71be967..ac13e858 100644 --- a/lib/formfields/admin/domains/formfield.domains_import.php +++ b/lib/formfields/admin/domains/formfield.domains_import.php @@ -18,6 +18,7 @@ return array( 'domain_import' => array( 'title' => $lng['domains']['domain_import'], 'image' => 'fa-solid fa-file-import', + 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['domain_import'], diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php index 6e8bbf2f..8885550d 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php @@ -18,6 +18,7 @@ return array( 'ipsandports_add' => array( 'title' => $lng['admin']['ipsandports']['add'], 'image' => 'fa-solid fa-plus', + 'self_overview' => ['section' => 'ipsandports', 'page' => 'ipsandports'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['ipsandports']['ipandport'], diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php index 2495af1b..a071a587 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php @@ -18,6 +18,7 @@ return array( 'ipsandports_edit' => array( 'title' => $lng['admin']['ipsandports']['edit'], 'image' => 'fa-solid fa-pen', + 'self_overview' => ['section' => 'ipsandports', 'page' => 'ipsandports'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['ipsandports']['ipandport'], diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php index 3456f4a4..95bbccfc 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php @@ -18,6 +18,7 @@ return array( 'fpmconfig_add' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], 'image' => 'fa-solid fa-plus', + 'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php index e30c956e..814e6cd8 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php @@ -18,6 +18,7 @@ return array( 'fpmconfig_edit' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], 'image' => 'fa-solid fa-pen', + 'self_overview' => ['section' => 'phpsettings', 'page' => 'fpmdaemons'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php index b02c711a..acda5a0b 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -18,6 +18,7 @@ return array( 'phpconfig_add' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], 'image' => 'fa-solid fa-plus', + 'self_overview' => ['section' => 'phpsettings', 'page' => 'overview'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php index 9e31a283..90b8a573 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -18,6 +18,7 @@ return array( 'phpconfig_edit' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], 'image' => 'fa-solid fa-pen', + 'self_overview' => ['section' => 'phpsettings', 'page' => 'overview'], 'sections' => array( 'section_a' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], diff --git a/lib/formfields/customer/domains/formfield.domains_add.php b/lib/formfields/customer/domains/formfield.domains_add.php index 046e8559..47cc9afe 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -21,6 +21,7 @@ return array( 'domain_add' => array( 'title' => $lng['domains']['subdomain_add'], 'image' => 'fa-solid fa-plus', + 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['subdomain_add'], diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index e182c95c..bf2940c8 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -18,6 +18,7 @@ return array( 'domain_edit' => array( 'title' => $lng['domains']['subdomain_edit'], 'image' => 'fa-solid fa-pen', + 'self_overview' => ['section' => 'domains', 'page' => 'domains'], 'sections' => array( 'section_a' => array( 'title' => $lng['domains']['subdomain_edit'], diff --git a/lib/formfields/customer/email/formfield.emails_add.php b/lib/formfields/customer/email/formfield.emails_add.php index 0e37a44e..4eac38c8 100644 --- a/lib/formfields/customer/email/formfield.emails_add.php +++ b/lib/formfields/customer/email/formfield.emails_add.php @@ -18,6 +18,7 @@ return array( 'emails_add' => array( 'title' => $lng['emails']['emails_add'], 'image' => 'fa-solid fa-plus', + 'self_overview' => ['section' => 'email', 'page' => 'emails'], 'sections' => array( 'section_a' => array( 'title' => $lng['emails']['emails_add'], diff --git a/lib/formfields/customer/email/formfield.emails_edit.php b/lib/formfields/customer/email/formfield.emails_edit.php index 257b9320..cc4931a5 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -18,6 +18,7 @@ return array( 'emails_edit' => array( 'title' => $lng['emails']['emails_edit'], 'image' => 'fa-solid fa-pen', + 'self_overview' => ['section' => 'email', 'page' => 'emails'], 'sections' => array( 'section_a' => array( 'title' => $lng['emails']['emails_edit'], diff --git a/lib/formfields/customer/extras/formfield.htaccess_add.php b/lib/formfields/customer/extras/formfield.htaccess_add.php index 0c17f77d..557d09dc 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_add.php +++ b/lib/formfields/customer/extras/formfield.htaccess_add.php @@ -18,6 +18,7 @@ return array( 'htaccess_add' => array( 'title' => $lng['extras']['pathoptions_add'], 'image' => 'fa-solid fa-folder', + 'self_overview' => ['section' => 'extras', 'page' => 'htaccess'], 'sections' => array( 'section_a' => array( 'title' => $lng['extras']['pathoptions_add'], diff --git a/lib/formfields/customer/extras/formfield.htaccess_edit.php b/lib/formfields/customer/extras/formfield.htaccess_edit.php index 3f6788cc..b2c9b5af 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_edit.php +++ b/lib/formfields/customer/extras/formfield.htaccess_edit.php @@ -18,6 +18,7 @@ return array( 'htaccess_edit' => array( 'title' => $lng['extras']['pathoptions_edit'], 'image' => 'fa-solid fa-folder', + 'self_overview' => ['section' => 'extras', 'page' => 'htaccess'], 'sections' => array( 'section_a' => array( 'title' => $lng['extras']['pathoptions_edit'], diff --git a/lib/formfields/customer/extras/formfield.htpasswd_add.php b/lib/formfields/customer/extras/formfield.htpasswd_add.php index ab2d674c..18efcd5e 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_add.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_add.php @@ -18,6 +18,7 @@ return array( 'htpasswd_add' => array( 'title' => $lng['extras']['directoryprotection_add'], 'image' => 'fa-solid fa-lock', + 'self_overview' => ['section' => 'extras', 'page' => 'htpasswds'], 'sections' => array( 'section_a' => array( 'title' => $lng['extras']['directoryprotection_add'], diff --git a/lib/formfields/customer/extras/formfield.htpasswd_edit.php b/lib/formfields/customer/extras/formfield.htpasswd_edit.php index 2fe44227..7676ed65 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_edit.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_edit.php @@ -18,6 +18,7 @@ return array( 'htpasswd_edit' => array( 'title' => $lng['extras']['directoryprotection_edit'], 'image' => 'fa-solid fa-lock', + 'self_overview' => ['section' => 'extras', 'page' => 'htpasswds'], 'sections' => array( 'section_a' => array( 'title' => $lng['extras']['directoryprotection_edit'], diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index 0590236c..e723fa5f 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -17,6 +17,7 @@ return array( 'ftp_add' => array( 'title' => $lng['ftp']['account_add'], 'image' => 'icons/user_add.png', + 'self_overview' => ['section' => 'ftp', 'page' => 'accounts'], 'sections' => array( 'section_a' => array( 'title' => $lng['ftp']['account_add'], diff --git a/lib/formfields/customer/ftp/formfield.ftp_edit.php b/lib/formfields/customer/ftp/formfield.ftp_edit.php index 6898a376..f6114366 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_edit.php +++ b/lib/formfields/customer/ftp/formfield.ftp_edit.php @@ -17,6 +17,7 @@ return array( 'ftp_edit' => array( 'title' => $lng['ftp']['account_edit'], 'image' => 'icons/user_edit.png', + 'self_overview' => ['section' => 'ftp', 'page' => 'accounts'], 'sections' => array( 'section_a' => array( 'title' => $lng['ftp']['account_edit'], diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index 352a908b..4a4c3343 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -19,6 +19,7 @@ return array( 'mysql_add' => array( 'title' => $lng['mysql']['database_create'], 'image' => 'icons/mysql_add.png', + 'self_overview' => ['section' => 'mysql', 'page' => 'mysqls'], 'sections' => array( 'section_a' => array( 'title' => $lng['mysql']['database_create'], diff --git a/lib/formfields/customer/mysql/formfield.mysql_edit.php b/lib/formfields/customer/mysql/formfield.mysql_edit.php index 2587964c..06732c02 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_edit.php +++ b/lib/formfields/customer/mysql/formfield.mysql_edit.php @@ -17,6 +17,7 @@ return array( 'mysql_edit' => array( 'title' => $lng['mysql']['database_edit'], 'image' => 'icons/mysql_edit.png', + 'self_overview' => ['section' => 'mysql', 'page' => 'mysqls'], 'sections' => array( 'section_a' => array( 'title' => $lng['mysql']['database_edit'], diff --git a/lib/tablelisting/customer/tablelisting.htaccess.php b/lib/tablelisting/customer/tablelisting.htaccess.php index e494718c..d80badcf 100644 --- a/lib/tablelisting/customer/tablelisting.htaccess.php +++ b/lib/tablelisting/customer/tablelisting.htaccess.php @@ -24,6 +24,7 @@ return [ 'htaccess_list' => [ 'title' => $lng['menue']['extras']['pathoptions'], 'icon' => 'fa-solid fa-folder', + 'self_overview' => ['section' => 'extras', 'page' => 'htaccess'], 'columns' => [ 'path' => [ 'label' => $lng['panel']['path'], diff --git a/lib/tablelisting/customer/tablelisting.htpasswd.php b/lib/tablelisting/customer/tablelisting.htpasswd.php index baed600d..015626d6 100644 --- a/lib/tablelisting/customer/tablelisting.htpasswd.php +++ b/lib/tablelisting/customer/tablelisting.htpasswd.php @@ -23,6 +23,7 @@ return [ 'htpasswd_list' => [ 'title' => $lng['menue']['extras']['directoryprotection'], 'icon' => 'fa-solid fa-lock', + 'self_overview' => ['section' => 'extras', 'page' => 'htpasswds'], 'columns' => [ 'username' => [ 'label' => $lng['login']['username'], diff --git a/templates/Froxlor/user/form.html.twig b/templates/Froxlor/user/form.html.twig index 478e3bad..1451f4af 100644 --- a/templates/Froxlor/user/form.html.twig +++ b/templates/Froxlor/user/form.html.twig @@ -20,6 +20,13 @@ {% block actions %} + {% if formdata.self_overview is defined and formdata.self_overview is iterable %} + {% if action_links is not defined %}{% set actions_links = [] %}{% endif %} + {% set actions_tmp = actions_links %} + {% set actions_links = {'href': linker(formdata.self_overview), 'icon': 'fa fa-reply','label': lng('panel.backtooverview')} %} + {% set actions_links = {actions_links}|merge(actions_tmp) %} + {% endif %} + {% if actions_links is iterable or (entity_info is defined and entity_info is not empty) %}
{% if actions_links is iterable %} @@ -38,6 +45,7 @@ #}
{% endif %} + {% endblock %} {% block content %}