Skip to content
Snippets Groups Projects
Commit 0dad50bb authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch '6653-disable-message-function-does-not-work' into 'develop'

Resolve "Disable message function does not work"

Closes #6653

See merge request ispconfig/ispconfig3!1905
parents d90795c6 02b93618
No related branches found
No related tags found
1 merge request!1905Resolve "Disable message function does not work"
Pipeline #14902 passed
...@@ -9,15 +9,27 @@ $module['title'] = 'top_menu_help'; ...@@ -9,15 +9,27 @@ $module['title'] = 'top_menu_help';
//* The template file of the module. This is always module.tpl.htm if you do not have any special requirements like a 3 column layout. //* The template file of the module. This is always module.tpl.htm if you do not have any special requirements like a 3 column layout.
$module['template'] = 'module.tpl.htm'; $module['template'] = 'module.tpl.htm';
// read web config
$app->uses('getconf');
$global_config = $app->getconf->get_global_config('misc');
// Get the FAQ sections
$sql = "SELECT * FROM help_faq_sections";
$faq_sections = $app->db->queryAllRecords($sql);
//* The page that is displayed when the module is loaded. the path must is relative to the web directory //* The page that is displayed when the module is loaded. the path must is relative to the web directory
if(isset($_GET['go2_faq_sections_list'])){ if(isset($_GET['go2_faq_sections_list'])){
$module['startpage'] = 'help/faq_sections_list.php'; $module['startpage'] = 'help/faq_sections_list.php';
} else { } else {
if($_SESSION['s']['user']['typ'] == 'admin') { if($_SESSION['s']['user']['typ'] == 'admin') {
$module['startpage'] = 'help/version.php'; $module['startpage'] = 'help/version.php';
} else { } elseif ($global_config['show_support_messages'] == 'y') {
$module['startpage'] = 'help/support_message_list.php'; $module['startpage'] = 'help/support_message_list.php';
} } elseif (!empty($faq_sections) && is_array($faq_sections) && count($faq_sections) > 0) {
$module['startpage'] = 'help/faq_list.php?hfs_id='.$faq_sections[0]['hfs_id'];
} else {
$module['startpage'] = 'help/index.php';
}
} }
//* The width of the tab. Normally you should leave this empty and let the browser define the width automatically. //* The width of the tab. Normally you should leave this empty and let the browser define the width automatically.
...@@ -25,9 +37,6 @@ $module['tab_width'] = ''; ...@@ -25,9 +37,6 @@ $module['tab_width'] = '';
//*** Menu Definition ***************************************** //*** Menu Definition *****************************************
// read web config
$app->uses('getconf');
$global_config = $app->getconf->get_global_config('misc');
if($global_config['show_support_messages'] == 'y') { if($global_config['show_support_messages'] == 'y') {
//* make sure that the items array is empty //* make sure that the items array is empty
$items = array(); $items = array();
...@@ -66,11 +75,9 @@ if($_SESSION['s']['user']['typ'] == 'admin') { ...@@ -66,11 +75,9 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
'items' => $itemsfaq); 'items' => $itemsfaq);
} }
else { //* the user else { //* the user
$sql = "SELECT * FROM help_faq_sections";
$res = $app->db->queryAllRecords($sql);
//* all the content sections //* all the content sections
if(is_array($res) && !empty($res)) { if(is_array($faq_sections) && !empty($faq_sections)) {
foreach($res as $v) { foreach($faq_sections as $v) {
$itemsfaq[] = array( 'title' => $v['hfs_name'], $itemsfaq[] = array( 'title' => $v['hfs_name'],
'target' => 'content', 'target' => 'content',
'link' => 'help/faq_list.php?hfs_id='.$v['hfs_id']); 'link' => 'help/faq_list.php?hfs_id='.$v['hfs_id']);
...@@ -101,4 +108,4 @@ if($_SESSION['s']['user']['typ'] == 'admin') { ...@@ -101,4 +108,4 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
'open' => 1, 'open' => 1,
'items' => $items); 'items' => $items);
} }
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment