From 4ada86876033fa171e2896d7e3d3c5645d8062db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:46:47 +0200 Subject: Adding upstream version 0.10.0. Signed-off-by: Daniel Baumann --- .../controllers/PlugController.php.disabled | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 application/controllers/PlugController.php.disabled (limited to 'application/controllers/PlugController.php.disabled') diff --git a/application/controllers/PlugController.php.disabled b/application/controllers/PlugController.php.disabled new file mode 100644 index 0000000..a2c6453 --- /dev/null +++ b/application/controllers/PlugController.php.disabled @@ -0,0 +1,72 @@ +params->get('module', 'reporting')); + + $reportsByModule = []; + + foreach (ReportHook::getReports() as $class => $report) { + $moduleName = $report->getModuleName(); + + if (! isset($reportsByModule[$moduleName])) { + $reportsByModule[$moduleName] = []; + } + + $reportsByModule[$moduleName][$class] = $report; + } + + $editor = Html::tag('div', ['class' => 'editor']); + + $nav = []; + + $cards = []; + + foreach ($reportsByModule as $moduleName => $reports) { + $link = Html::tag('a', ['href' => Url::fromRequest(['module' => $moduleName])], $moduleName); + + $nav[] = $link; + + if ($moduleName !== $moduleToShow) { + continue; + } + + $link->getAttributes()->add('class', 'active'); + + foreach ($reports as $report) { + $cards[] = Html::tag( + 'div', + ['class' => 'card'], + [ + Html::tag('div', ['class' => 'card-top'], $report->getPreview()), + Html::tag( + 'div', + ['class' => 'card-content'], + Html::tag('h5', ['class' => 'card-title'], $report->getName()), + Html::tag('p', ['class' => 'card-text'], $report->getDescription()) + ) + ] + ); + } + } + + $editor->add(Html::tag('div', ['class' => 'editor-nav'], $nav)); + $editor->add(Html::tag('div', ['class' => 'editor-content'], $cards)); + + $this->addContent($editor); + + $this->addContent(Html::tag('a', ['href' => 'plug', 'class' => 'modal-toggle', 'data-base-target' => 'modal-container'], 'Modal')); + } +} -- cgit v1.2.3