From c953371004e1d3c9de5c6208f83ef90dc56379ce Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Sun, 5 Dec 2021 16:36:17 +0100 Subject: [PATCH] Add 'disabled' option to 'form-position' setting Allows the form to be hidden. --- admin/docs/en-us/settings/settings.html | 5 +++++ admin/settings/index.php | 3 ++- backend/classes/formui.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/docs/en-us/settings/settings.html b/admin/docs/en-us/settings/settings.html index 85c62103..fe636e9d 100644 --- a/admin/docs/en-us/settings/settings.html +++ b/admin/docs/en-us/settings/settings.html @@ -801,6 +801,11 @@

before the comments, setting this to bottom will cause the form to appear after the comments but before the end links.

+

+ The form can also be set to disabled to hide it. + This does not disable comments or form submissions; it just hides + the form from users. +

This setting is top by default.

diff --git a/admin/settings/index.php b/admin/settings/index.php index 3402e343..7ba1ee26 100644 --- a/admin/settings/index.php +++ b/admin/settings/index.php @@ -296,7 +296,8 @@ function ui_array (Setup $setup, Locale $locale) 'options' => array ( 'top' => 'Top', - 'bottom' => 'Bottom' + 'bottom' => 'Bottom', + 'disabled' => 'Disabled' ) ), diff --git a/backend/classes/formui.php b/backend/classes/formui.php index a0a58de3..132c2d92 100644 --- a/backend/classes/formui.php +++ b/backend/classes/formui.php @@ -918,7 +918,7 @@ public function initialHTML ($hashover_wrapper = true) $form_section->appendChild ($main_form); // Check if form position setting set to 'top' - if ($this->setup->formPosition !== 'bottom') { + if ($this->setup->formPosition === 'top') { // Add primary form wrapper to HashOver element $hashover_element->appendChild ($form_section); }