From eaefcf435ee1931deb131e8c27ae7c93f72e8cfe Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 21 Oct 2017 18:12:46 +0200 Subject: [PATCH] Implement basic lookup functionality --- .../AccountGroupSelector/BaseView.php | 7 +++++++ .../AccountGroupSelector/base.tpl.php | 21 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Theme/Backend/Components/AccountGroupSelector/BaseView.php b/Theme/Backend/Components/AccountGroupSelector/BaseView.php index cfad3d6..f8b8975 100644 --- a/Theme/Backend/Components/AccountGroupSelector/BaseView.php +++ b/Theme/Backend/Components/AccountGroupSelector/BaseView.php @@ -23,6 +23,7 @@ use phpOMS\Message\ResponseAbstract; class BaseView extends View { private $id = ''; + private $isRequired = false; public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response) { @@ -39,9 +40,15 @@ class BaseView extends View return $this->id; } + public function isRequired() : bool + { + return $this->isRequired; + } + public function render(...$data) : string { $this->id = $data[0]; + $this->required = $data[1] ?? false; return parent::render(); } } \ No newline at end of file diff --git a/Theme/Backend/Components/AccountGroupSelector/base.tpl.php b/Theme/Backend/Components/AccountGroupSelector/base.tpl.php index 0fc78e9..79b990d 100644 --- a/Theme/Backend/Components/AccountGroupSelector/base.tpl.php +++ b/Theme/Backend/Components/AccountGroupSelector/base.tpl.php @@ -13,7 +13,7 @@ +]'isRequired() ? ' required' : ''; ?>> -
\ No newline at end of file +
\ No newline at end of file