2017-03-17 00:11:48 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Widget;
|
2017-03-17 00:11:48 +00:00
|
|
|
|
2022-10-23 21:18:44 +00:00
|
|
|
class Helpindex implements WidgetInterface
|
2021-12-02 23:02:31 +00:00
|
|
|
{
|
|
|
|
|
2022-10-24 03:39:49 +00:00
|
|
|
public function widget(array $arguments): string
|
2021-12-02 23:02:31 +00:00
|
|
|
{
|
|
|
|
return EMPTY_STR;
|
|
|
|
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
|
|
|
|
$level_0 = preg_replace('/\<ul(.*?)\>/', '<ul class="nav nav-pills flex-column">', $level_0);
|
|
|
|
|
|
|
|
$levels = [];
|
|
|
|
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
if ($level_0) {
|
2021-12-02 23:02:31 +00:00
|
|
|
$o .= $level_0;
|
2021-12-03 03:01:39 +00:00
|
|
|
}
|
2021-12-02 23:02:31 +00:00
|
|
|
if ($levels) {
|
|
|
|
foreach ($levels as $l) {
|
|
|
|
$o .= '<br><br>';
|
|
|
|
$o .= $l;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$o .= '</div>';
|
|
|
|
|
|
|
|
return $o;
|
|
|
|
}
|
2017-03-17 00:11:48 +00:00
|
|
|
}
|