diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-01-21 14:59:17 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-01-21 14:59:17 +0100 |
commit | 937e9c12ee8ca097813ffe022f097ae1c7d47744 (patch) | |
tree | f7a243e97d4b1d6ba0b18510b0f36edc3c894123 /app | |
parent | c6f7ec7bf8d8c8821ecf6796769cff16339ec22b (diff) | |
download | wcms-937e9c12ee8ca097813ffe022f097ae1c7d47744.tar.gz wcms-937e9c12ee8ca097813ffe022f097ae1c7d47744.zip |
start end point for summary generation
Diffstat (limited to 'app')
-rw-r--r-- | app/class/Controllerinfo.php | 2 | ||||
-rw-r--r-- | app/class/Modelrender.php | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/app/class/Controllerinfo.php b/app/class/Controllerinfo.php index e5a39d2..fd8232c 100644 --- a/app/class/Controllerinfo.php +++ b/app/class/Controllerinfo.php @@ -20,7 +20,7 @@ class Controllerinfo extends Controller $htmlman = file_get_contents(Model::MAN_FILE); $htmlman = $render->rendermanual($htmlman); - $summary = $render->sumparser($htmlman, 4); + $summary = $render->sumparser(2, 3); $this->showtemplate('info', ['version' => getversion(), 'manual' => $htmlman, 'summary' => $summary]); diff --git a/app/class/Modelrender.php b/app/class/Modelrender.php index 01deba4..aa59416 100644 --- a/app/class/Modelrender.php +++ b/app/class/Modelrender.php @@ -487,13 +487,22 @@ class Modelrender extends Modelpage * * @return string html list with anchor link */ - function sumparser() : string + function sumparser(int $start = 1, int $end = 6) : string { $sum = $this->sum; + $filteredsum = []; + + foreach ($sum as $key => $menu) { + $deepness = array_keys($menu)[0]; + if($deepness >= $start && $deepness <= $end) { + $filteredsum[$key] = $menu; + } + } + $sumstring = ''; $last = 0; - foreach ($sum as $title => $list) { + foreach ($filteredsum as $title => $list) { foreach ($list as $h => $link) { if ($h > $last) { for ($i = 1; $i <= ($h - $last); $i++) { |