1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 include '../inc/common.php';
6 $topic = mtrack_get_pathinfo();
7 $helpdir = dirname(__FILE__) . '/../defaults/help';
8 if (strpos($topic, '.') !== false) {
9 throw new Exception("invalid help topic");
11 $name = $helpdir . '/' . $topic;
13 if (!strlen($topic)) {
14 mtrack_head("Help topics");
16 echo "<h1>Help topics</h1>";
18 foreach (glob("$helpdir/*") as $topic) {
19 $topic = basename($topic);
20 echo "<li><a href='{$ABSWEB}help.php/$topic'>$topic</a></li>\n";
24 } elseif (!file_exists($name)) {
25 mtrack_head("no help topic $topic");
27 echo "<h1>No Help topic ", htmlentities($topic), "</h1>";
29 mtrack_head("Help: $topic");
30 echo MTrackWiki::format_to_html(file_get_contents($name));