diff --git a/README.md b/README.md
index 01dfe96..549a3b2 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ A contact form that lets guests and members reach the board administrators by em
## Features
-- Replaces phpBB's built-in contact page and links to it from the header, the footer, failed logins and the registration page.
+- Replaces phpBB's built-in contact page and links to it from the header, the footer, failed logins and the registration page. The header and footer links can each be turned off in the ACP.
- Messages go out by email, as a private message, or as a post in a forum you choose. Send to all administrators, the board founder or the board's default email address.
- Optional list of contact reasons for the sender to pick from.
- Private messages and posts can come from a "contact bot" user, for guests only or for everyone.
diff --git a/adm/style/acp_contactadmin.html b/adm/style/acp_contactadmin.html
index 4dbec69..3da1ff5 100644
--- a/adm/style/acp_contactadmin.html
+++ b/adm/style/acp_contactadmin.html
@@ -96,6 +96,18 @@
{{ lang('ACP_CAT_CONTACTADMIN') }}
{{ lang('CONTACT_WHO_EXPLAIN') }}
{% for option in loops.contact_who %} {{ option.LABEL }} {% endfor %}
+
+ {{ lang('CONTACT_HEADER_LINK') ~ lang('COLON') }}
+ {{ lang('CONTACT_HEADER_LINK_EXPLAIN') }}
+ {{ lang('YES') }}
+ {{ lang('NO') }}
+
+
+ {{ lang('CONTACT_FOOTER_LINK') ~ lang('COLON') }}
+ {{ lang('CONTACT_FOOTER_LINK_EXPLAIN') }}
+ {{ lang('YES') }}
+ {{ lang('NO') }}
+
{{ lang('CONTACT_POST_OPTIONS') }}
diff --git a/controller/admin_controller.php b/controller/admin_controller.php
index 23fb676..b0527fd 100644
--- a/controller/admin_controller.php
+++ b/controller/admin_controller.php
@@ -262,6 +262,8 @@ public function display_options()
'CONTACT_USERNAME_CHK' => $this->config['contactadmin_username_chk'],
'CONTACT_EMAIL_CHK' => $this->config['contactadmin_email_chk'],
'CONTACT_GDPR' => $this->config['contactadmin_gdpr'],
+ 'CONTACT_HEADER_LINK' => $this->config['contactadmin_header_link'],
+ 'CONTACT_FOOTER_LINK' => $this->config['contactadmin_footer_link'],
'CONTACT_REASONS' => $contact_admin_reasons,
'CONTACT_METHOD_EMAIL' => (int) $contact_method_email,
'CONTACT_METHOD_PM' => (int) $contact_method_pm,
@@ -353,6 +355,8 @@ protected function set_options()
$this->config->set('contactadmin_bot_poster', $this->allowed_value($this->request->variable('contact_bot_poster', 0), [$constants['CONTACT_POST_NEITHER'], $constants['CONTACT_POST_GUEST'], $constants['CONTACT_POST_ALL']]));
$this->config->set('contactadmin_forum', $this->request->variable('forum', 0));
$this->config->set('contactadmin_gdpr', $this->request->variable('gdpr', 0));
+ $this->config->set('contactadmin_header_link', $this->request->variable('header_link', 0));
+ $this->config->set('contactadmin_footer_link', $this->request->variable('footer_link', 0));
}
/**
diff --git a/event/listener.php b/event/listener.php
index 8c64d34..ee8a681 100644
--- a/event/listener.php
+++ b/event/listener.php
@@ -155,6 +155,10 @@ public function page_header_after($event)
$this->template->assign_vars([
'U_CONTACT_US' => false,
'U_CONTACTADMIN' => $this->helper->route('phpbbmodders_contactadmin_displayform'),
+
+ // Which navigation bars show the "Contact us" link
+ 'S_CONTACTADMIN_HEADER_LINK' => !empty($this->config['contactadmin_header_link']),
+ 'S_CONTACTADMIN_FOOTER_LINK' => !empty($this->config['contactadmin_footer_link']),
]);
}
}
diff --git a/language/en/acp_contact.php b/language/en/acp_contact.php
index e7c6cdb..d08700d 100644
--- a/language/en/acp_contact.php
+++ b/language/en/acp_contact.php
@@ -70,6 +70,10 @@
'CONTACT_USERNAME_CHK_EXPLAIN' => 'If set yes, the user’s name that is entered will be checked against those in the database. If the name is found the user will be presented with an error and asked to input a different user name',
'CONTACT_EMAIL_CHK' => 'Check Email',
'CONTACT_EMAIL_CHK_EXPLAIN' => 'If set yes, the user’s email address will be checked against those in the database. If the email address is found the user will be presented with an error and asked to input a different email address',
+ 'CONTACT_HEADER_LINK' => 'Show link in header navigation',
+ 'CONTACT_HEADER_LINK_EXPLAIN' => 'Show a “Contact us” link in the navigation bar at the top of every page.',
+ 'CONTACT_FOOTER_LINK' => 'Show link in footer navigation',
+ 'CONTACT_FOOTER_LINK_EXPLAIN' => 'Show a “Contact us” link in the navigation bar at the bottom of every page. With both links off, the contact page still works at its usual address.',
// Contact methods
'CONTACT_METHOD_EMAIL' => 'Email',
diff --git a/migrations/m6_update_data.php b/migrations/m6_update_data.php
new file mode 100644
index 0000000..f8cc1e6
--- /dev/null
+++ b/migrations/m6_update_data.php
@@ -0,0 +1,37 @@
+config['contactadmin_header_link']);
+ }
+
+ public static function depends_on()
+ {
+ return ['\phpbbmodders\contactadmin\migrations\m5_update_data'];
+ }
+
+ public function update_data()
+ {
+ return [
+ ['config.add', ['contactadmin_header_link', 1]],
+ ['config.add', ['contactadmin_footer_link', 1]],
+ ];
+ }
+}
diff --git a/styles/prosilver/template/event/overall_footer_teamlink_after.html b/styles/prosilver/template/event/overall_footer_teamlink_after.html
index cddad60..89194fe 100644
--- a/styles/prosilver/template/event/overall_footer_teamlink_after.html
+++ b/styles/prosilver/template/event/overall_footer_teamlink_after.html
@@ -1,4 +1,4 @@
-{% if U_CONTACTADMIN %}
+{% if U_CONTACTADMIN and S_CONTACTADMIN_FOOTER_LINK %}
{{ lang('CONTACT_US') }}
diff --git a/styles/prosilver/template/event/overall_header_navigation_append.html b/styles/prosilver/template/event/overall_header_navigation_append.html
index 89e38e0..c7de65c 100644
--- a/styles/prosilver/template/event/overall_header_navigation_append.html
+++ b/styles/prosilver/template/event/overall_header_navigation_append.html
@@ -1,4 +1,4 @@
-{% if U_CONTACTADMIN %}
+{% if U_CONTACTADMIN and S_CONTACTADMIN_HEADER_LINK %}
{{ lang('CONTACT_US') }}
diff --git a/styles/scaffoldBB/template/event/overall_footer_teamlink_after.html b/styles/scaffoldBB/template/event/overall_footer_teamlink_after.html
index 59dc3af..ad0330b 100644
--- a/styles/scaffoldBB/template/event/overall_footer_teamlink_after.html
+++ b/styles/scaffoldBB/template/event/overall_footer_teamlink_after.html
@@ -1,4 +1,4 @@
-{% if U_CONTACTADMIN %}
+{% if U_CONTACTADMIN and S_CONTACTADMIN_FOOTER_LINK %}
{{ lang('CONTACT_US') }}
diff --git a/styles/scaffoldBB/template/event/overall_header_navigation_append.html b/styles/scaffoldBB/template/event/overall_header_navigation_append.html
index 66de680..a014f44 100644
--- a/styles/scaffoldBB/template/event/overall_header_navigation_append.html
+++ b/styles/scaffoldBB/template/event/overall_header_navigation_append.html
@@ -1,4 +1,4 @@
-{% if U_CONTACTADMIN %}
+{% if U_CONTACTADMIN and S_CONTACTADMIN_HEADER_LINK %}
{{ lang('CONTACT_US') }}