Skip to content

Commit

Permalink
Post rebase cleanup; pass flash messages to subnavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Feb 22, 2023
1 parent 6b54833 commit e937f59
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 41 deletions.
30 changes: 10 additions & 20 deletions app/templates/Standard/add-edit-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,34 +61,24 @@
// the fields (which would be more consistent with how Views render...)
$flashArgs['vv_banners'] = $banners;
}
?>

<?php if(!empty($subnav)): ?>
<div id="subnavigation">
<div class="supertitle">
<h1>
<?php if(!empty($vv_supertitle)): ?>
<?= $vv_supertitle; ?>
<?php elseif(!empty($vv_obj)): ?>
<?= $vv_obj->$vv_display_field; ?>
<?php endif; ?>
</h1>
</div>

<?php /* Flash Messages are placed below supertitle when subnavigation exists. */ ?>
<?= $this->element('flash', $flashArgs); ?>

<?= $this->element('subnavigation', $subnav); ?>
</div>
<?php endif; ?>
// 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);
}
?>

<div class="pageTitleContainer">
<div class="pageTitle">
<?php if(empty($subnav)): ?>
<h1><?= $vv_title; ?></h1>
<?php else: ?>
<?php if(
// Subnavigation contains an h2 for these entities
// Subnavigation contains an h2 for these entities, so we need an h3
$vv_primary_link == 'person_role_id'
|| $vv_primary_link == 'external_identity_id'
|| $vv_primary_link == 'external_identity_role_id'
Expand Down
30 changes: 10 additions & 20 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,24 @@
if(!empty($banners)) {
$flashArgs['vv_banners'] = $banners;
}
?>

<?php if(!empty($subnav)): ?>
<div id="subnavigation">
<div class="supertitle">
<h1>
<?php if(!empty($vv_person_name)): ?>
<?= $vv_person_name->full_name; ?>
<?php elseif(!empty($vv_bc_parent_obj)): ?>
<?= $vv_bc_parent_obj->$vv_bc_parent_displayfield; ?>
<?php endif; ?>
</h1>
</div>

<?php /* Flash Messages are placed below supertitle when subnavigation exists. */ ?>
<?= $this->element('flash', $flashArgs); ?>

<?= $this->element('subnavigation', $subnav); ?>
</div>
<?php endif; ?>
// 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);
}
?>

<div class="pageTitleContainer">
<div class="pageTitle">
<?php if(empty($subnav)): ?>
<h1><?= $vv_title; ?></h1>
<?php else: ?>
<?php if(
// Subnavigation contains an h2 for these entities
// Subnavigation contains an h2 for these entities, so we need an h3
$vv_primary_link == 'person_role_id'
|| $vv_primary_link == 'external_identity_id'
|| $vv_primary_link == 'external_identity_role_id'): ?>
Expand Down
7 changes: 6 additions & 1 deletion app/templates/element/subnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use Cake\View\Helper;

$linkFilter = [];
$flashArgs = [];
$curId = NULL;
$curController = $this->request->getParam('controller');
$curAction = $this->request->getParam('action');
Expand Down Expand Up @@ -92,7 +93,8 @@
<?= __d('enumeration', 'StatusEnum.' . $vv_obj['status']); ?>
</span>
<?php endif; ?>
</div>
</div>

<?php if($name == 'person'): ?>
<!-- Specialty person dropdown menus - ADD and global actions -->
<nav id="person-actions">
Expand Down Expand Up @@ -239,6 +241,9 @@
</nav>
<?php endif; // person-actions ?>
</div>

<?php /* Flash Messages are placed below supertitle when subnavigation exists. */ ?>
<?= $this->element('flash', $flashArgs); ?>

<!-- Top-Level Subnavigation Tabs -->
<nav id="cm-<?= $name ?>-subnav-tabs" class="cm-subnav-tabs">
Expand Down

0 comments on commit e937f59

Please sign in to comment.