some refactoring for subnavigation code

remotes/origin/stable
Robin Appelman 14 years ago
parent b6ad416757
commit fe47d51598
  1. 5
      core/templates/layout.user.php
  2. 20
      lib/app.php

@ -44,6 +44,11 @@
<ul>
<?php foreach($_['navigation'] as $entry): ?>
<li><a style="background-image:url(<?php echo $entry['icon']; ?>)" href="<?php echo $entry['href']; ?>" title="" <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>><?php echo $entry['name']; ?></a></li>
<?php if( sizeof( $entry["subnavigation"] )): ?>
<?php foreach($entry["subnavigation"] as $subentry):?>
<li><a href="<?php echo $subentry['href']; ?>" title="" <?php if( $subentry['active'] ): ?>class="active"<?php endif; ?>><?php echo $subentry['name'] ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>

@ -310,20 +310,12 @@ class OC_APP{
/// Private foo
private static function addSubNavigation( $list ){
$found = false;
foreach( self::$subnavigation as $parent => $selection ){
foreach( $selection as $subentry ){
if( $subentry['id'] == self::$activeapp ){
foreach( $list as &$naventry ){
if( $naventry['id'] == $parent ){
$naventry['active'] = true;
$naventry['subnavigation'] = $selection;
}
else{
$naventry['active'] = false;
}
} unset( $naventry );
$found = true;
if(isset(self::$subnavigation[self::$activeapp])){
$subNav=self::$subnavigation[self::$activeapp];
foreach( $list as &$naventry ){
if( $naventry['id'] == self::$activeapp ){
$naventry['active'] = true;
$naventry['subnavigation'] = $subNav;
}
}
}

Loading…
Cancel
Save