forked from f446843/banshee
/
faq.php
37 lines (30 loc) · 938 Bytes
/
faq.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
class faq_controller extends controller {
public function execute() {
$this->output->title = "F.A.Q.";
if (($sections = $this->model->get_all_sections()) === false) {
$this->output->add_tag("result", "Database error.");
return;
}
if (($faqs = $this->model->get_all_faqs()) === false) {
$this->output->add_tag("result", "Database error.");
return;
}
$this->output->add_javascript("faq.js");
$this->output->open_tag("overview");
$this->output->open_tag("sections");
foreach ($sections as $section) {
$this->output->add_tag("section", $section["label"], array("id" => $section["id"]));
}
$this->output->close_tag();
$this->output->open_tag("faqs");
$number = 1;
foreach ($faqs as $faq) {
$faq["question"] = ($number++).". ".$faq["question"];
$this->output->record($faq, "faq");
}
$this->output->close_tag();
$this->output->close_tag();
}
}
?>