1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 require_once 'MTrackWeb.php';
5 class MTrackWeb_Help extends MTrackWeb
7 var $template = 'help.html';
10 $helpdir = dirname(__FILE__) . '/../defaults/help';
11 if (strpos($topic, '.') !== false) {
12 throw new Exception("invalid help topic");
14 $name = $helpdir . '/' . $topic;
17 $this->title = "Help topics";
18 $this->topics = array();
19 foreach (glob("$helpdir/*") as $topic) {
20 $topic = basename($topic);
21 $this->topics[] = $topic;
26 if (!file_exists($name)) {
27 $this->title = "no help topic $topic";
28 $this->no_topic = $topic;
32 $this->body = MTrack_Wiki::format_to_html(file_get_contents($name));