Skip to content

Commit

Permalink
fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Apr 17, 2024
1 parent 19d9fe5 commit af4ff66
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 33 deletions.
30 changes: 10 additions & 20 deletions Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
26 changes: 13 additions & 13 deletions Theme/Backend/modules-create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('CreateProfile'); ?></h1></header>

<div class="inner">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed">
<tbody>
<tr><td><label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<tr><td><?= $this->getData('accGrpSelector')->render('iAccount', ''); ?>
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module">
</table>
</form>
</div>
<section class="portlet">
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('CreateProfile'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<?= $this->getData('accGrpSelector')->render('iAccount', ''); ?>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-module">
</div>
</form>
</section>
</div>
</div>

0 comments on commit af4ff66

Please sign in to comment.