diff options
author | M. Dent <dentm42@gmail.com> | 2019-01-19 05:21:53 +0100 |
---|---|---|
committer | M. Dent <dentm42@gmail.com> | 2019-01-19 05:21:53 +0100 |
commit | 39128c34ccf48cc23ed368cf5bbedd71b5ef75db (patch) | |
tree | 49111cffad0616616f4ce76fed9dd6b4fad8e41f /include/help.php | |
parent | 542d21c4e1ea5d53d2a3d970078d9ab3cbe3cc2c (diff) | |
parent | bba20c27fe01e4f6879969e98b52d5ce2de5ed5f (diff) | |
download | volse-hubzilla-39128c34ccf48cc23ed368cf5bbedd71b5ef75db.tar.gz volse-hubzilla-39128c34ccf48cc23ed368cf5bbedd71b5ef75db.tar.bz2 volse-hubzilla-39128c34ccf48cc23ed368cf5bbedd71b5ef75db.zip |
Merge branch 'dev' into 'dev'
Some fixes in include/help.php.
See merge request hubzilla/core!1479
Diffstat (limited to 'include/help.php')
-rw-r--r-- | include/help.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/include/help.php b/include/help.php index f2aa4add3..61dbc7bb3 100644 --- a/include/help.php +++ b/include/help.php @@ -12,12 +12,12 @@ use \Michelf\MarkdownExtra; function get_help_fullpath($path,$suffix=null) { $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; - $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; + $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; // Determine the language and modify the path accordingly $x = determine_help_language(); $lang = $x['language']; - $url_idx = ($x['from_url'] ? 1 : 0); + // The English translation is at the root of /doc/. Other languages are in // subfolders named by the language code such as "de", "es", etc. if($lang !== 'en') { @@ -53,15 +53,14 @@ function get_help_fullpath($path,$suffix=null) { * @return string|unknown */ function get_help_content($tocpath = false) { - global $lang; $doctype = 'markdown'; $text = ''; $path = (($tocpath !== false) ? $tocpath : ''); - $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; - $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; + $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; + $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; if($tocpath === false && argc() > 1) { $path = ''; @@ -74,7 +73,7 @@ function get_help_content($tocpath = false) { if($path) { - $fullpath = get_help_fullpath($path); + $fullpath = get_help_fullpath($path); $title = basename($path); if(! $tocpath) \App::$page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); @@ -88,10 +87,10 @@ function get_help_content($tocpath = false) { load_doc_file($fullpath . '.md') === '' && load_doc_file($fullpath . '.bb') === '' && load_doc_file($fullpath . '.html') === '' - ) { + ) { $path = $title; } - $fullpath = get_help_fullpath($path); + $fullpath = get_help_fullpath($path); $text = load_doc_file($fullpath . '.md'); if(! $text) { @@ -111,15 +110,15 @@ function get_help_content($tocpath = false) { if($tocpath === false) { if(! $text) { - $path = 'Site'; - $fullpath = get_help_fullpath($path,'.md'); + $path = 'Site'; + $fullpath = get_help_fullpath($path,'.md'); $text = load_doc_file($fullpath . '.md'); \App::$page['title'] = t('Help'); } if(! $text) { $doctype = 'bbcode'; - $path = 'main'; - $fullpath = get_help_fullpath($path,'.md'); + $path = 'main'; + $fullpath = get_help_fullpath($path,'.md'); $text = load_doc_file($fullpath . '.bb'); goaway('/help/about/about'); \App::$page['title'] = t('Help'); @@ -219,7 +218,6 @@ function find_doc_file($s) { */ function search_doc_files($s) { - \App::set_pager_itemspage(60); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); @@ -351,7 +349,7 @@ function store_doc_file($s) { $x = item_store_update($item); } else { - $item['uuid'] = $item_message_id(); + $item['uuid'] = item_message_id(); $item['mid'] = $item['parent_mid'] = z_root() . '/item/' . $item['uuid']; $x = item_store($item); } |