chg: [index] factories modified to make index views leaner for ajax rendering

remotes/origin/main
iglocska 2020-06-21 21:35:33 +02:00
parent 2f8c3ebe3a
commit b4fe51966d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 7 additions and 5 deletions

View File

@ -18,10 +18,10 @@
*/ */
$tableRandomValue = Cake\Utility\Security::randomString(8); $tableRandomValue = Cake\Utility\Security::randomString(8);
echo '<div id="table-container-' . h($tableRandomValue) . '">'; echo '<div id="table-container-' . h($tableRandomValue) . '">';
if (!empty($data['title'])) { if (!$ajax && !empty($data['title'])) {
echo sprintf('<h2>%s</h2>', h($data['title'])); echo sprintf('<h2>%s</h2>', h($data['title']));
} }
if (!empty($data['description'])) { if (!$ajax && !empty($data['description'])) {
echo sprintf( echo sprintf(
'<div>%s</div>', '<div>%s</div>',
empty($data['description']) ? '' : h($data['description']) empty($data['description']) ? '' : h($data['description'])
@ -40,9 +40,11 @@
'tableRandomValue' => $tableRandomValue 'tableRandomValue' => $tableRandomValue
) )
); );
echo $this->element( if (!$ajax) {
'/genericElements/IndexTable/pagination_links' echo $this->element(
); '/genericElements/IndexTable/pagination_links'
);
}
} }
if (!empty($data['top_bar'])) { if (!empty($data['top_bar'])) {
echo $this->element( echo $this->element(