From 10ed334e8c81d1db4a506716b78ece13dc69266c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 17 Jan 2016 16:29:32 -0800 Subject: various issues from the forums --- mod/help.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index c4549a2bd..e1c6fede8 100644 --- a/mod/help.php +++ b/mod/help.php @@ -157,7 +157,7 @@ function help_content(&$a) { $path = trim(substr($dirname,4),'/'); $o .= '
  • ' . ucwords(str_replace('_',' ',notags($fname))) . '
    ' . - str_replace('$Projectname',PLATFORM_NAME,substr($rr['text'],0,200)) . '...

  • '; + str_replace('$Projectname',get_platform_name(),substr($rr['text'],0,200)) . '...

    '; } $o .= ''; @@ -229,6 +229,8 @@ function help_content(&$a) { if($doctype === 'bbcode') { require_once('include/bbcode.php'); $content = bbcode($text); + // bbcode retargets external content to new windows. This content is internal. + $content = str_replace(' target="_blank"','',$content); } $content = preg_replace_callback("/#include (.*?)\;/ism", 'preg_callback_help_include', $content); @@ -248,7 +250,9 @@ function preg_callback_help_include($matches) { if(preg_match('/\.bb$/', $matches[1]) || preg_match('/\.txt$/', $matches[1])) { require_once('include/bbcode.php'); $include = bbcode($include); - } elseif(preg_match('/\.md$/', $matches[1])) { + $include = str_replace(' target="_blank"','',$include); + } + elseif(preg_match('/\.md$/', $matches[1])) { require_once('library/markdown.php'); $include = Markdown($include); } -- cgit v1.2.3 From f9545dc35916648f88fa04c7003abe1196f38484 Mon Sep 17 00:00:00 2001 From: mrjive Date: Wed, 3 Feb 2016 14:02:34 -0800 Subject: Added section-title-wrapper and section-conent-wrapper to search result page in /help --- mod/help.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index e1c6fede8..1539978f7 100644 --- a/mod/help.php +++ b/mod/help.php @@ -145,7 +145,10 @@ function help_content(&$a) { if($_REQUEST['search']) { $o .= '
    '; + $o .= '
    '; $o .= '

    ' . t('Documentation Search') . ' - ' . htmlspecialchars($_REQUEST['search']) . '

    '; + $o .= '
    '; + $o .= '
    '; $r = search_doc_files($_REQUEST['search']); if($r) { @@ -162,6 +165,7 @@ function help_content(&$a) { } $o .= ''; $o .= '
    '; + $o .= '
    '; } return $o; } -- cgit v1.2.3 From 342fda94e4162634eeb67c18c1d284e7d78f217f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 18 Feb 2016 15:24:58 -0800 Subject: Provide Zotlabs\Project and System class for querying details about the project/version info. Move these out of /boot.php --- mod/help.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index 1539978f7..19bf251bd 100644 --- a/mod/help.php +++ b/mod/help.php @@ -160,7 +160,7 @@ function help_content(&$a) { $path = trim(substr($dirname,4),'/'); $o .= '
  • ' . ucwords(str_replace('_',' ',notags($fname))) . '
    ' . - str_replace('$Projectname',get_platform_name(),substr($rr['text'],0,200)) . '...

  • '; + str_replace('$Projectname',Zotlabs\Project\System::get_platform_name(),substr($rr['text'],0,200)) . '...

    '; } $o .= ''; -- cgit v1.2.3 From 9abd95fad3784a10fc48bc40f9b8a75d7d74edda Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 31 Mar 2016 16:06:03 -0700 Subject: static App --- mod/help.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index 19bf251bd..a266dbf7f 100644 --- a/mod/help.php +++ b/mod/help.php @@ -13,7 +13,7 @@ function load_doc_file($s) { - $lang = get_app()->language; + $lang = App::$language; if(! isset($lang)) $lang = 'en'; $b = basename($s); @@ -39,8 +39,8 @@ function search_doc_files($s) { $a = get_app(); $itemspage = get_pconfig(local_channel(),'system','itemspage'); - $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($a->pager['itemspage']), intval($a->pager['start'])); + App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start'])); $regexop = db_getfunc('REGEXP'); @@ -68,7 +68,7 @@ function search_doc_files($s) { $r[$x]['rank'] ++; $r[$x]['rank'] += substr_count(strtolower($r[$x]['text']),strtolower($s)); // bias the results to the observer's native language - if($r[$x]['lang'] === $a->language) + if($r[$x]['lang'] === App::$language) $r[$x]['rank'] = $r[$x]['rank'] + 10; } @@ -187,30 +187,30 @@ function help_content(&$a) { $title = basename($path); $text = load_doc_file('doc/' . $path . '.md'); - $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); + App::$page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); if(! $text) { $text = load_doc_file('doc/' . $path . '.bb'); if($text) $doctype = 'bbcode'; - $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('_',' ',notags($title))); + App::$page['title'] = t('Help:') . ' ' . ucwords(str_replace('_',' ',notags($title))); } if(! $text) { $text = load_doc_file('doc/' . $path . '.html'); if($text) $doctype = 'html'; - $a->page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); + App::$page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); } } if(! $text) { $text = load_doc_file('doc/Site.md'); - $a->page['title'] = t('Help'); + App::$page['title'] = t('Help'); } if(! $text) { $doctype = 'bbcode'; $text = load_doc_file('doc/main.bb'); - $a->page['title'] = t('Help'); + App::$page['title'] = t('Help'); } if(! strlen($text)) { -- cgit v1.2.3 From a20ef706fd6e7011a0dc95df71222b9a5871e3b3 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 6 Apr 2016 05:44:40 -0700 Subject: issue #340 --- mod/help.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index a266dbf7f..fb0339cd9 100644 --- a/mod/help.php +++ b/mod/help.php @@ -84,7 +84,21 @@ function doc_rank_sort($s1,$s2) { } +function load_context_help() { + + $path = App::$cmd; + $args = App::$argv; + + while($path) { + $context_help = load_doc_file('doc/context/' . $path . '/help.html'); + if($context_help) + break; + array_pop($args); + $path = implode($args,'/'); + } + return $context_help; +} function store_doc_file($s) { -- cgit v1.2.3