From ddd4fc9b699d3be3ede68e7bc1d817a700e7a2ba Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Tue, 7 Feb 2023 15:14:29 -0500 Subject: [PATCH] Post rebase cleanup; pass flash messages to subnavigation --- app/templates/Standard/add-edit-view.php | 30 ++++++++---------------- app/templates/Standard/index.php | 30 ++++++++---------------- app/templates/element/subnavigation.php | 7 +++++- 3 files changed, 26 insertions(+), 41 deletions(-) diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index 6db60a260..8925cddf8 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -61,26 +61,16 @@ // the fields (which would be more consistent with how Views render...) $flashArgs['vv_banners'] = $banners; } -?> - - - +// If subnavigation is present a supertitle and the subnavigation will be placed above +// the normal page title. The flash messages will be shown up there as well. +if(!empty($subnav)) { + // Include the $flashArgs for the subnavigation element + $subnav['flashArgs'] = $flashArgs; + // Generate the subnavigation title and tabs + print $this->element('subnavigation', $subnav); +} +?>
@@ -88,7 +78,7 @@

- - - +// If subnavigation is present a supertitle and the subnavigation will be placed above +// the normal page title. The flash messages will be shown up there as well. +if(!empty($subnav)) { + // Include the $flashArgs for the subnavigation element + $subnav['flashArgs'] = $flashArgs; + // Generate the subnavigation title and tabs + print $this->element('subnavigation', $subnav); +} +?>
@@ -94,7 +84,7 @@

diff --git a/app/templates/element/subnavigation.php b/app/templates/element/subnavigation.php index e6a1c840b..8d23e4262 100644 --- a/app/templates/element/subnavigation.php +++ b/app/templates/element/subnavigation.php @@ -31,6 +31,7 @@ use Cake\View\Helper; $linkFilter = []; +$flashArgs = []; $curId = NULL; $curController = $this->request->getParam('controller'); $curAction = $this->request->getParam('action'); @@ -92,7 +93,8 @@ -
+
+
+ + + element('flash', $flashArgs); ?>