Skip to content
Snippets Groups Projects
Commit fe47d515 authored by Robin Appelman's avatar Robin Appelman
Browse files

some refactoring for subnavigation code

parent b6ad4167
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,11 @@ ...@@ -44,6 +44,11 @@
<ul> <ul>
<?php foreach($_['navigation'] as $entry): ?> <?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> <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; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
......
...@@ -310,20 +310,12 @@ class OC_APP{ ...@@ -310,20 +310,12 @@ class OC_APP{
/// Private foo /// Private foo
private static function addSubNavigation( $list ){ private static function addSubNavigation( $list ){
$found = false; if(isset(self::$subnavigation[self::$activeapp])){
foreach( self::$subnavigation as $parent => $selection ){ $subNav=self::$subnavigation[self::$activeapp];
foreach( $selection as $subentry ){ foreach( $list as &$naventry ){
if( $subentry['id'] == self::$activeapp ){ if( $naventry['id'] == self::$activeapp ){
foreach( $list as &$naventry ){ $naventry['active'] = true;
if( $naventry['id'] == $parent ){ $naventry['subnavigation'] = $subNav;
$naventry['active'] = true;
$naventry['subnavigation'] = $selection;
}
else{
$naventry['active'] = false;
}
} unset( $naventry );
$found = true;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment