From f318b9b4155dc916cd59658c043eec4f059227e4 Mon Sep 17 00:00:00 2001
From: thom <thom@amsterdamtech.nl>
Date: Sun, 18 Oct 2020 21:07:18 +0200
Subject: [PATCH] Make help messages menu hideable (#5829)

---
 install/tpl/system.ini.master          |  3 +++
 interface/web/help/lib/module.conf.php | 23 +++++++++++++----------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master
index c42966a01c..a08796ce5a 100644
--- a/install/tpl/system.ini.master
+++ b/install/tpl/system.ini.master
@@ -4,6 +4,9 @@
 
 [client]
 
+[help]
+show_support_messages=n
+
 [dns]
 
 [mail]
diff --git a/interface/web/help/lib/module.conf.php b/interface/web/help/lib/module.conf.php
index bee099d1ba..bc78cf6dde 100644
--- a/interface/web/help/lib/module.conf.php
+++ b/interface/web/help/lib/module.conf.php
@@ -25,27 +25,30 @@ $module['tab_width'] = '';
 
 
 //*** Menu Definition *****************************************
+// read web config
+$app->uses('getconf');
+$global_config = $app->getconf->get_global_config('help');
+if($global_config['show_support_messages'] == 'y') {
+	//* make sure that the items array is empty
+	$items = array();
 
-//* make sure that the items array is empty
-$items = array();
-
-//* Add a menu item with the label 'Send message'
-$items[] = array( 'title'   => 'Send message',
+	//* Add a menu item with the label 'Send message'
+	$items[] = array( 'title'   => 'Send message',
 	'target'  => 'content',
 	'link'    => 'help/support_message_edit.php',
 	'html_id' => 'help_message_send');
 
-//* Add a menu item with the label 'View messages'
-$items[] = array( 'title'   => 'View messages',
+	//* Add a menu item with the label 'View messages'
+	$items[] = array( 'title'   => 'View messages',
 	'target'  => 'content',
 	'link'    => 'help/support_message_list.php',
 	'html_id' => 'help_message_list');
 
-
-//* Add the menu items defined above to a menu section labeled 'Support'
-$module['nav'][] = array( 'title' => 'Support',
+	//* Add the menu items defined above to a menu section labeled 'Support'
+	$module['nav'][] = array( 'title' => 'Support',
 	'open'  => 1,
 	'items' => $items);
+}
 
 //* the FAQ menu section
 $itemsfaq = array();
-- 
GitLab