From af4ff6668fdd13bf34efe3529b9a395473874d76 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 17 Apr 2024 17:45:07 +0000 Subject: [PATCH] fix templates --- Controller/BackendController.php | 30 ++++++++++------------------ Theme/Backend/modules-create.tpl.php | 26 ++++++++++++------------ 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 0735548..1d96028 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -68,28 +68,18 @@ public function setupProfileStyles(RequestAbstract $request, ResponseAbstract $r public function viewProfileList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); - $view->setTemplate('/Modules/Profile/Theme/Backend/profile-list'); - if ($request->getData('ptype') === 'p') { - $view->data['accounts'] = ProfileMapper::getAll() - ->with('account') - ->with('image') - ->where('id', $request->getDataInt('offset') ?? 0, '<') - ->limit(25)->execute(); - } elseif ($request->getData('ptype') === 'n') { - $view->data['accounts'] = ProfileMapper::getAll() - ->with('account') - ->with('image') - ->where('id', $request->getDataInt('offset') ?? 0, '>') - ->limit(25)->execute(); - } else { - $view->data['accounts'] = ProfileMapper::getAll() - ->with('account') - ->with('image') - ->where('id', 0, '>') - ->limit(25)->executeGetArray(); - } + $view->data['accounts'] = ProfileMapper::getAll() + ->with('account') + ->with('image') + ->paginate( + 'id', + $request->getData('ptype'), + $request->getDataInt('offset') + ) + ->limit(25) + ->executeGetArray(); /** @var \Model\Setting $profileImage */ $profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile'); diff --git a/Theme/Backend/modules-create.tpl.php b/Theme/Backend/modules-create.tpl.php index f051d1e..a8db871 100755 --- a/Theme/Backend/modules-create.tpl.php +++ b/Theme/Backend/modules-create.tpl.php @@ -17,19 +17,19 @@
-
-

getHtml('CreateProfile'); ?>

- -
-
- - -
-
getData('accGrpSelector')->render('iAccount', ''); ?> -
-
-
-
+
+
+
getHtml('CreateProfile'); ?>
+
+
+ + getData('accGrpSelector')->render('iAccount', ''); ?> +
+
+
+ +
+
\ No newline at end of file