sintonia/legacy/application/views/scripts/menu.phtml

51 lines
2.4 KiB
PHTML
Raw Normal View History

2017-03-23 23:53:47 +01:00
<ol class="navigation">
2022-08-10 13:38:19 +02:00
<?php foreach ($this->container as $page) : ?>
<?php
2017-09-29 15:55:33 +02:00
// Host users do not have access to the General Preferences
// therefor we need to manually change the page parameters
// to point to the first allowed item in the Preferences
// which is 'My Profile' page
$user = Application_Model_User::getCurrentUser();
$isHost = $user->isUserType(array(UTYPE_HOST));
if ($isHost && $page->getTitle() === 'Settings') {
2022-08-10 13:38:19 +02:00
$page->set('resource', 'usersettings');
$page->set('controller', 'user');
$page->set('action', 'edit-user');
}
2022-08-10 13:38:19 +02:00
?>
<?php if ($this->navigation()->accept($page)) : ?>
<li class="top <?php if ($page->isActive(true)) {
echo 'active';
} ?>">
<?php if ($page->hasPages()) : ?>
<a class="top_link" href="<?php echo $page->getHref(); ?>">
<span class="down"><?php echo $page->getClass();
echo _($page->getLabel()); ?></span>
</a>
<ul class="sub">
2022-08-10 13:38:19 +02:00
<?php foreach ($page->getPages() as $sub) :
if ($sub->getId() == "manage_folder") {
continue;
} ?>
2022-08-10 13:38:19 +02:00
<?php if ($this->navigation()->accept($sub)) : ?>
2022-08-10 13:38:19 +02:00
<li>
<a href="<?php echo $sub->getHref(); ?>" <?php echo ($sub->getTarget() != "") ? "target=\"" . $sub->getTarget() . "\"" : ""; ?>><?php echo $page->getClass();
echo _($sub->getLabel()); ?></a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php else : ?>
<a class="top_link" href="<?php echo $page->getHref(); ?>">
<span><?php echo $page->getClass();
echo _($page->getLabel()); ?></span>
</a>
<?php endif; ?>
2022-08-10 13:38:19 +02:00
</li>
<?php endif; ?>
<?php endforeach; ?>
2021-10-12 11:17:57 +02:00
</ol>