aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Helpindex.php
blob: a7120b47f87ed4a7e1de8b97842d3dc7c5cd0c12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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
 */

namespace Zotlabs\Widget;

class Helpindex {

	use \Zotlabs\Lib\Traits\HelpHelper;

	private string $contents = '';

	function widget() {

		$this->determine_help_language();
		$this->find_help_file('toc', $this->lang['language']);

		if (! empty($this->file_name)) {
			$this->contents = file_get_contents($this->file_name);
		}

		$tpl = get_markup_template('widget.tpl');
		return replace_macros($tpl, [ '$widget' => $this ]);
	}

	public function title(): string {
		return t('Help Contents');
	}

	public function contents(): string {
		return $this->contents;
	}
}