Skip to content

Commit

Permalink
Add top-level subnavigation to Enrollment Flow and Enrollment Flow St…
Browse files Browse the repository at this point in the history
…eps (CFM-31) (COmanage#166)
  • Loading branch information
arlen committed Oct 14, 2024
1 parent 327c762 commit 294d1ed
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/templates/EnrollmentFlowSteps/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ $rowActions = [
'label' => __d('operation', 'configure.plugin'),
'icon' => 'electrical_services'
]
];

$subnav = [
'name' => 'enrollment_flow',
'active' => 'steps'
];
5 changes: 5 additions & 0 deletions app/templates/EnrollmentFlows/fields-nav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ $topLinks[] = [
],
'class' => ''
];

$subnav = [
'name' => 'enrollment_flow',
'active' => 'properties'
];
42 changes: 39 additions & 3 deletions app/templates/element/subnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
$linkFilter = ['person_id' => $curId];
} elseif ($name == 'group') {
$linkFilter = ['group_id' => $curId];
} elseif ($name == 'enrollment_flow') {
$linkFilter = ['enrollment_flow_id' => $curId];
}
} elseif(!empty($vv_bc_title_links)) {
// All else fails? Use the breadcrumb which has figured this out.
Expand Down Expand Up @@ -100,6 +102,8 @@
$supertitle = $vv_obj->$vv_display_field;
} elseif(!empty($vv_bc_parent_obj)) {
$supertitle = $vv_bc_parent_obj->$vv_bc_parent_displayfield;
} elseif(!empty($vv_primary_link_obj)) {
$supertitle = $vv_primary_link_obj->name;
} elseif(!empty($vv_bc_title_links)) {
// All else fails? Use the breadcrumb which has figured this out.
// XXX We might just be able to do this and skip all the above after breadcrumbs have been refactored
Expand Down Expand Up @@ -282,8 +286,8 @@
*/ ?>
<?php endif; // person ?>

<?php if ($name == 'group'): ?>
<!-- Group Subnavigation -->
<?php if($name == 'group'): ?>
<!-- Group Subnavigation -->
<li class="nav-item">
<?php
$linkClass = ($active == 'properties') ? 'nav-link active' : 'nav-link';
Expand Down Expand Up @@ -335,7 +339,39 @@
</li>
<?php endif; // group ?>

<?php if ($name == 'plugin'): ?>
<?php if($name == 'enrollment_flow'): ?>
<!-- Enrollment Flow (Configuration) Subnavigation -->
<li class="nav-item">
<?php
$linkClass = ($active == 'properties') ? 'nav-link active' : 'nav-link';
print $this->Html->link(
__d('controller', 'Properties', [99]),
[
'controller' => 'enrollment-flows',
'action' => $curAction == 'view' ? 'view' : 'edit',
$curId
],
['class' => $linkClass]
);
?>
</li>
<li class="nav-item">
<?php
$linkClass = ($active == 'steps') ? 'nav-link active' : 'nav-link';
print $this->Html->link(
__d('controller', 'EnrollmentFlowSteps', [99]),
[
'controller' => 'enrollment_flow_steps',
'action' => 'index',
'?' => $linkFilter
],
['class' => $linkClass]
);
?>
</li>
<?php endif; // enrollment_flow ?>

<?php if($name == 'plugin'): ?>
<!-- General Plugin Configuration Subnavigation -->
<!-- Used for all plugins that have a parent object with a child plugin config -->
<li class="nav-item">
Expand Down

0 comments on commit 294d1ed

Please sign in to comment.