From b5f72879f5d049e7417e80708cd99ba768b7187b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 14 Feb 2019 18:52:35 +0100 Subject: [PATCH] Draft audit diff --- Controller/BackendController.php | 4 ++-- Models/NullAudit.php | 27 +++++++++++++++++++++++++++ Theme/Backend/account-single.tpl.php | 3 ++- Theme/Backend/audit-single.tpl.php | 4 +++- 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 Models/NullAudit.php diff --git a/Controller/BackendController.php b/Controller/BackendController.php index e42689c..33793fc 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -69,8 +69,8 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Auditor/Theme/Backend/audit-single'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006201001, $request, $response)); - $list = AuditMapper::get(50); - $view->setData('audits', $list); + $audit = AuditMapper::get((int) $request->getData('id')); + $view->setData('audit', $audit); return $view; } diff --git a/Models/NullAudit.php b/Models/NullAudit.php new file mode 100644 index 0000000..c862389 --- /dev/null +++ b/Models/NullAudit.php @@ -0,0 +1,27 @@ +getData('nav')->render(); \ No newline at end of file +echo $this->getData('nav')->render(); +?> diff --git a/Theme/Backend/audit-single.tpl.php b/Theme/Backend/audit-single.tpl.php index b971e7b..9bf11f7 100644 --- a/Theme/Backend/audit-single.tpl.php +++ b/Theme/Backend/audit-single.tpl.php @@ -14,4 +14,6 @@ * @var \phpOMS\Views\View $this */ -echo $this->getData('nav')->render(); \ No newline at end of file +echo $this->getData('nav')->render(); +var_dump(\phpOMS\Utils\StringUtils::diffline($this->getData('audit')->getOld() ?? '', $this->getData('audit')->getNew() ?? '')); +?>