X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fhelp.php;h=72225692793d5206d412d9e2a671f63ded4ab762;hb=e4ec867df3377acbec6325e7023b814129981d31;hp=6d8fbb1842295fd67814de01657ecd310c6d5936;hpb=2dd8db7de880794db10664965713f8a46581bd7a;p=friendica.git diff --git a/mod/help.php b/mod/help.php index 6d8fbb1842..7222569279 100644 --- a/mod/help.php +++ b/mod/help.php @@ -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="