diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-02-19 12:15:59 +0100 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-02-19 12:15:59 +0100 |
commit | c5bb0745737432c6d27e9468e56ad0bd33698462 (patch) | |
tree | 7d6b7a364941b9325ea319e6564e9f6123f059f2 /include/help.php | |
parent | 4e8fc6d19851b6d05a49d5151aaa1f0f1fcfb5c0 (diff) | |
parent | cead10b9af6ff9d8b1bc702ca21d27af7c2112f0 (diff) | |
download | volse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.tar.gz volse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.tar.bz2 volse-hubzilla-c5bb0745737432c6d27e9468e56ad0bd33698462.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include/help.php')
-rw-r--r-- | include/help.php | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/include/help.php b/include/help.php index 61dbc7bb3..e82fa96da 100644 --- a/include/help.php +++ b/include/help.php @@ -7,9 +7,10 @@ use \Michelf\MarkdownExtra; * @brief * * @param string $path - * @return string|unknown + * @param string $suffix (optional) default null + * @return string */ -function get_help_fullpath($path,$suffix=null) { +function get_help_fullpath($path, $suffix = null) { $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; @@ -49,8 +50,8 @@ function get_help_fullpath($path,$suffix=null) { /** * @brief * - * @param string $tocpath - * @return string|unknown + * @param string $tocpath (optional) default false + * @return string */ function get_help_content($tocpath = false) { @@ -171,16 +172,20 @@ function preg_callback_help_include($matches) { } /** - * @brief + * @brief Determines help language. + * + * If the language was specified in the URL, override the language preference + * of the browser. Default to English if both of these are absent. * - * @return boolean|array + * @return array Associative array with: + * * \e string \b language - 2-letter ISO 639-1 code ("en") + * * \e boolean \b from_url - true if language from URL overrides browser default */ function determine_help_language() { $lang_detect = new Text_LanguageDetect(); // Set this mode to recognize language by the short code like "en", "ru", etc. $lang_detect->setNameMode(2); - // If the language was specified in the URL, override the language preference - // of the browser. Default to English if both of these are absent. + if($lang_detect->languageExists(argv(1))) { $lang = argv(1); $from_url = true; @@ -211,10 +216,10 @@ function find_doc_file($s) { } /** - * @brief + * @brief Search in doc files. * - * @param string $s - * @return number|mixed|unknown|boolean + * @param string $s The search string to search for + * @return array */ function search_doc_files($s) { @@ -275,7 +280,6 @@ function doc_rank_sort($s1, $s2) { * * @return string */ - function load_context_help() { $path = App::$cmd; @@ -305,7 +309,7 @@ function load_context_help() { * @brief * * @param string $s - * @return void|boolean[]|number[]|string[]|unknown[] + * @return void|array */ function store_doc_file($s) { |