X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fhelp.php;h=c380aa39138267de91eca27a5c2919e3d5f36fab;hb=9fb4ba2b733d59b8a704cb8df846c3b43769503d;hp=6d8fbb1842295fd67814de01657ecd310c6d5936;hpb=2dd8db7de880794db10664965713f8a46581bd7a;p=friendica.git diff --git a/mod/help.php b/mod/help.php index 6d8fbb1842..c380aa3913 100644 --- a/mod/help.php +++ b/mod/help.php @@ -18,7 +18,7 @@ if (!function_exists('load_doc_file')) { } -function help_content(&$a) { +function help_content(App $a) { nav_set_selected('help'); @@ -27,12 +27,23 @@ function help_content(&$a) { $text = ''; if ($a->argc > 1) { - $text = load_doc_file('doc/' . $a->argv[1] . '.md'); - $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($a->argv[1])); + $path = ''; + // looping through the argv keys bigger than 0 to build + // a path relative to /help + for($x = 1; $x < argc(); $x ++) { + if(strlen($path)) + $path .= '/'; + $path .= argv($x); + } + $title = basename($path); + $filename = $path; + $text = load_doc_file('doc/' . $path . '.md'); + $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($title)); } $home = load_doc_file('doc/Home.md'); if (!$text) { $text = $home; + $filename = "Home"; $a->page['title'] = t('Help'); } else { $a->page['aside'] = Markdown($home); @@ -47,7 +58,45 @@ function help_content(&$a) { } $html = Markdown($text); - $html = "".$html; + + if ($filename !== "Home") { + // create TOC but not for home + $lines = explode("\n", $html); + $toc="

TOC