Skip to content

Commit

Permalink
Fix CO Title and logo home link (CFM-380) (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen authored Mar 13, 2024
1 parent 2d56f1f commit d59119c
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions app/templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
$bodyClasses = $controller_stripped . ' ' .$action_stripped;
$isCoSelectView = $controller_stripped == 'cos' && $action_stripped == 'select';
$isDashboard = $controller_stripped == 'dashboards' && $action_stripped == 'dashboard';
$generateHomeLink = (!$isCoSelectView && !empty($vv_cur_co));

// add further body classes as needed
if(!empty($vv_user)) {
Expand Down Expand Up @@ -115,35 +116,39 @@

<header id="banner">
<div id="logo-title-wrapper">
<?php if($generateHomeLink): ?>
<?php
// wrap the logo and the title in the home link
$cmHomeLink = $this->Url->build([
'plugin' => null,
'controller' => 'Dashboards',
'action' => 'dashboard',
'?' => ['co_id' => $vv_cur_co->id]],
['escape' => false]
);
?>
<a href="<?= $cmHomeLink ?>">
<?php endif; ?>
<div id="logo">
<?=
$this->Html->link(
$this->Html->image(
"COmanage-Gears.svg",
array(
'alt' => __('registry.meta.logo')
)
),'/',
array('escape' => false)
);
);
?>
</div>
<div id="siteTitle">
<!-- XXX Sanitize $vv_cur_co['name'] -->
<?php if($isCoSelectView): // just print the name ?>
<?= __('registry.meta.registry') ?>
<?php elseif(!empty($vv_cur_co)): ?>
<?= $this->Html->link(
$vv_cur_co['name'],
['controller' => 'Dashboards',
'action' => 'dashboard',
'?' => ['co_id' => $vv_cur_co->id]],
['escape' => false]);
?>
<?php if($generateHomeLink): ?>
<?= h($vv_cur_co['name']) ?>
<?php else: ?>
<?= $this->Html->link(__('registry.meta.registry'), '/'); ?>
<?= __('registry.meta.registry') ?>
<?php endif; ?>
</div>
<?php if($generateHomeLink): ?>
</a>
<?php endif; ?>
</div>
<!-- Custom Navigation Links -->
<?php if(!empty($vv_NavLinks) || !empty($vv_CoNavLinks)): ?>
Expand Down

0 comments on commit d59119c

Please sign in to comment.