Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
04e09a 1 <?php
F 2
7fe908 3 require_once '../../lib/config.inc.php';
MC 4 require_once '../../lib/app.inc.php';
04e09a 5
F 6 // Path to the list definition file
7 $list_def_file = 'list/faq_list.php';
8
9 // Check the module permissions
7fe908 10 if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
f612f1 11     header('Location: ../index.php');
F 12     die();
04e09a 13 }
F 14
15 // Loading the class
16 $app->uses('listform_actions');
17
18 // Optional limit
19 $hf_section = 0;
20 if(isset($_GET['hfs_id']))
604c0c 21     $hf_section = $app->functions->intval(preg_replace("/[^0-9]/", "", $_GET['hfs_id']));
04e09a 22
F 23 // if section id is not specified in the url, choose the first existing section
24 if(!$hf_section)
25 {
26     $res = $app->db->queryOneRecord("SELECT MIN(hfs_id) AS min_id FROM help_faq_sections");
27     $hf_section = $res['min_id'];
28 }
615a0a 29 $app->listform_actions->SQLExtWhere = "help_faq.hf_section = $hf_section";
04e09a 30
F 31
cc7a82 32 if($hf_section) $res = $app->db->queryOneRecord("SELECT hfs_name FROM help_faq_sections WHERE hfs_id=?", $hf_section);
04e09a 33 // Start the form rendering and action ahndling
F 34 echo "<h2>FAQ: ".$res['hfs_name']."</h2>";
cc6568 35 if($hf_section) $app->listform_actions->onLoad();
04e09a 36
F 37 ?>