2 require_once('library/markdown.php');
4 if (!function_exists('load_doc_file')) {
6 function load_doc_file($s) {
12 if (file_exists("$d/$lang/$b"))
13 return file_get_contents("$d/$lang/$b");
15 return file_get_contents($s);
21 function help_content(&$a) {
23 nav_set_selected('help');
31 // looping through the argv keys bigger than 0 to build
32 // a path relative to /help
33 for($x = 1; $x < argc(); $x ++) {
38 $title = basename($path);
40 $text = load_doc_file('doc/' . $path . '.md');
41 $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($title));
43 $home = load_doc_file('doc/Home.md');
46 $a->page['title'] = t('Help');
48 $a->page['aside'] = Markdown($home);
52 header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
53 $tpl = get_markup_template("404.tpl");
54 return replace_macros($tpl, array(
55 '$message' => t('Page not found.')
59 $html = Markdown($text);
60 $html = "<style>.md_warning { padding: 1em; border: #ff0000 solid 2px; background-color: #f9a3a3; color: #ffffff;</style>".$html;