]> git.mxchange.org Git - friendica.git/blob - mod/help.php
rolling version number in preparation for release
[friendica.git] / mod / help.php
1 <?php
2
3 if(! function_exists('load_doc_file')) {
4 function load_doc_file($s) {
5         global $lang;
6         if(! isset($lang))
7                 $lang = 'en';
8         $b = basename($s);
9         $d = dirname($s);
10         if(file_exists("$d/$lang/$b"))
11                 return file_get_contents("$d/$lang/$b");
12         return file_get_contents($s);
13 }}
14
15
16
17 function help_content(&$a) {
18
19         global $lang;
20
21         require_once('library/markdown.php');
22
23         $text = '';
24
25         if($a->argc > 1) {
26                 $text = load_doc_file('doc/' . $a->argv[1] . '.md');
27                 $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags($a->argv[1]));
28         }
29         if(! $text) {
30                 $text = load_doc_file('doc/Home.md');
31                 $a->page['title'] = t('Help');
32         }
33         
34
35         return Markdown($text);
36
37 }