diff options
author | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
commit | 45275910e606a02b12393714ea3b0409da440d61 (patch) | |
tree | 10b2d173d58cb930f8df28fe75af73dd4974c08c /Zotlabs/Widget/Helpindex.php | |
parent | 0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff) | |
parent | c04e781926a78e514cdf211fa24930a331149072 (diff) | |
download | volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.gz volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.tar.bz2 volse-hubzilla-45275910e606a02b12393714ea3b0409da440d61.zip |
Merge branch '9.2RC'master
Diffstat (limited to 'Zotlabs/Widget/Helpindex.php')
-rw-r--r-- | Zotlabs/Widget/Helpindex.php | 63 |
1 files changed, 20 insertions, 43 deletions
diff --git a/Zotlabs/Widget/Helpindex.php b/Zotlabs/Widget/Helpindex.php index 63e686d3a..5264e1947 100644 --- a/Zotlabs/Widget/Helpindex.php +++ b/Zotlabs/Widget/Helpindex.php @@ -1,6 +1,9 @@ <?php - /** + * Widget to show the help index. + * + * By default used by the left sidebar by the help module. + * * * Name: Help index * * Description: Help pages index */ @@ -9,54 +12,28 @@ namespace Zotlabs\Widget; class Helpindex { - function widget($arr) { - - require_once('include/help.php'); - - $o = '<div class="widget">'; - - $level_0 = get_help_content('sitetoc'); - if(! $level_0) { - $path = 'toc'; - $x = determine_help_language(); - $lang = $x['language']; - if($lang !== 'en') { - $path = $lang . '/toc'; - } - $level_0 = get_help_content($path); - } + use \Zotlabs\Lib\Traits\HelpHelperTrait; - $level_0 = preg_replace('/\<ul(.*?)\>/','<ul class="nav nav-pills flex-column">',$level_0); + private string $contents = ''; - $levels = array(); + function widget() { + $this->determine_help_language(); + $this->find_help_file('toc', $this->lang['language']); - // TODO: Implement support for translations in hierarchical table of content files - /* - if(argc() > 2) { - $path = ''; - for($x = 1; $x < argc(); $x ++) { - $path .= argv($x) . '/'; - $y = get_help_content($path . 'sitetoc'); - if(! $y) - $y = get_help_content($path . 'toc'); - if($y) - $levels[] = preg_replace('/\<ul(.*?)\>/','<ul class="nav nav-pills flex-column">',$y); - } - } - */ - - if($level_0) - $o .= $level_0; - if($levels) { - foreach($levels as $l) { - $o .= '<br /><br />'; - $o .= $l; - } + if (! empty($this->file_name)) { + $this->contents = file_get_contents($this->file_name); } - $o .= '</div>'; + $tpl = get_markup_template('widget.tpl'); + return replace_macros($tpl, [ '$widget' => $this ]); + } + + public function title(): string { + return ''; + } - return $o; + public function contents(): string { + return $this->contents; } } |