chg: [genericElements:numberOfElement] Added parameter to show or not the `show all` option

refacto/CRUDComponent
Sami Mokaddem 2023-09-06 09:18:40 +02:00
parent e7e5c0aebd
commit 3514f8bd7c
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
3 changed files with 5 additions and 2 deletions

View File

@ -108,7 +108,7 @@ echo $this->element('genericElements/IndexTable/index_table', [
], ],
'title' => __('User index'), 'title' => __('User index'),
'description' => __('The list of enrolled users in this Cerebrate instance. All of the users have or at one point had access to the system.'), 'description' => __('The list of enrolled users in this Cerebrate instance. All of the users have or at one point had access to the system.'),
'pull' => 'right', 'includeAllPagination' => true,
'actions' => [ 'actions' => [
[ [
'url' => '/users/view', 'url' => '/users/view',

View File

@ -63,6 +63,7 @@ $numberOfElementHtml = $this->element('/genericElements/ListTopBar/group_table_a
'tableSettings' => $tableSettings, 'tableSettings' => $tableSettings,
'table_setting_id' => $data['table_setting_id'], 'table_setting_id' => $data['table_setting_id'],
'numberOfElement' => $numberOfElement, 'numberOfElement' => $numberOfElement,
'includeAll' => !empty($table_data['includeAllPagination']),
]); ]);
?> ?>
<?php if (!isset($data['requirement']) || $data['requirement']) : ?> <?php if (!isset($data['requirement']) || $data['requirement']) : ?>

View File

@ -10,7 +10,9 @@ $numberOfElementSelectSeed = 'seed-' . mt_rand();
<option value="50" <?= $numberOfElement == 50 ? 'selected' : '' ?>><?= __('50') ?></option> <option value="50" <?= $numberOfElement == 50 ? 'selected' : '' ?>><?= __('50') ?></option>
<option value="100" <?= $numberOfElement == 100 ? 'selected' : '' ?>><?= __('100') ?></option> <option value="100" <?= $numberOfElement == 100 ? 'selected' : '' ?>><?= __('100') ?></option>
<option value="200" <?= $numberOfElement == 200 ? 'selected' : '' ?>><?= __('200') ?></option> <option value="200" <?= $numberOfElement == 200 ? 'selected' : '' ?>><?= __('200') ?></option>
<option value="all" <?= $numberOfElement == 'all' ? 'selected' : '' ?>><?= __('All') ?></option> <?php if (!empty($includeAll)): ?>
<option value="all" <?= $numberOfElement == 'all' ? 'selected' : '' ?>><?= __('All') ?></option>
<?php endif; ?>
</select> </select>
</label> </label>