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 @@ final class BackendController extends Controller 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 @@ echo $this->data['nav']->render();