Skip to content

Commit 02b9361

Browse files
committed
Fixes #6653 Disable message function not working
1 parent 02d2e3b commit 02b9361

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

interface/web/help/lib/module.conf.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,34 @@
99
//* 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.
1010
$module['template'] = 'module.tpl.htm';
1111

12+
// read web config
13+
$app->uses('getconf');
14+
$global_config = $app->getconf->get_global_config('misc');
15+
16+
// Get the FAQ sections
17+
$sql = "SELECT * FROM help_faq_sections";
18+
$faq_sections = $app->db->queryAllRecords($sql);
19+
1220
//* The page that is displayed when the module is loaded. the path must is relative to the web directory
1321
if(isset($_GET['go2_faq_sections_list'])){
1422
$module['startpage'] = 'help/faq_sections_list.php';
1523
} else {
1624
if($_SESSION['s']['user']['typ'] == 'admin') {
1725
$module['startpage'] = 'help/version.php';
18-
} else {
26+
} elseif ($global_config['show_support_messages'] == 'y') {
1927
$module['startpage'] = 'help/support_message_list.php';
20-
}
28+
} elseif (!empty($faq_sections) && is_array($faq_sections) && count($faq_sections) > 0) {
29+
$module['startpage'] = 'help/faq_list.php?hfs_id='.$faq_sections[0]['hfs_id'];
30+
} else {
31+
$module['startpage'] = 'help/index.php';
32+
}
2133
}
2234

2335
//* The width of the tab. Normally you should leave this empty and let the browser define the width automatically.
2436
$module['tab_width'] = '';
2537

2638

2739
//*** Menu Definition *****************************************
28-
// read web config
29-
$app->uses('getconf');
30-
$global_config = $app->getconf->get_global_config('misc');
3140
if($global_config['show_support_messages'] == 'y') {
3241
//* make sure that the items array is empty
3342
$items = array();
@@ -66,11 +75,9 @@
6675
'items' => $itemsfaq);
6776
}
6877
else { //* the user
69-
$sql = "SELECT * FROM help_faq_sections";
70-
$res = $app->db->queryAllRecords($sql);
7178
//* all the content sections
72-
if(is_array($res) && !empty($res)) {
73-
foreach($res as $v) {
79+
if(is_array($faq_sections) && !empty($faq_sections)) {
80+
foreach($faq_sections as $v) {
7481
$itemsfaq[] = array( 'title' => $v['hfs_name'],
7582
'target' => 'content',
7683
'link' => 'help/faq_list.php?hfs_id='.$v['hfs_id']);
@@ -101,4 +108,4 @@
101108
'open' => 1,
102109
'items' => $items);
103110
}
104-
?>
111+

0 commit comments

Comments
 (0)