Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
661 B

  1. <?php
  2. if(! function_exists('load_doc_file')) {
  3. function load_doc_file($s) {
  4. global $lang;
  5. if(! isset($lang))
  6. $lang = 'en';
  7. $b = basename($s);
  8. $d = dirname($s);
  9. if(file_exists("$d/$lang/$b"))
  10. return file_get_contents("$d/$lang/$b");
  11. return file_get_contents($s);
  12. }}
  13. function help_content(&$a) {
  14. global $lang;
  15. require_once('library/markdown.php');
  16. $text = '';
  17. if($a->argc > 1) {
  18. $text = load_doc_file('doc/' . $a->argv[1] . '.md');
  19. $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags($a->argv[1]));
  20. }
  21. if(! $text) {
  22. $text = load_doc_file('doc/Home.md');
  23. $a->page['title'] = t('Help');
  24. }
  25. return Markdown($text);
  26. }