diff --git a/core/css/styles.css b/core/css/styles.css
index 99090b9171e..00433979d24 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -89,6 +89,7 @@ input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../
#plugins a:active { outline:0; }
#plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
+#plugins li.subentry a {padding-left:4em;}
/* CONTENT ------------------------------------------------------------------ */
#content { margin:3.5em 0 0 15.7em; }
diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php
index 8077fd304f3..3aac4c98ac5 100644
--- a/core/templates/layout.admin.php
+++ b/core/templates/layout.admin.php
@@ -48,12 +48,15 @@
-
class="active">
+ class="active">
-
-
-
+
+
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 4440ae28b27..8f073914a1f 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -43,12 +43,15 @@
diff --git a/lib/app.php b/lib/app.php
index bccd0c665fa..b6c2512e79a 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -158,7 +158,10 @@ class OC_APP{
* the navigation. Lower values come first.
*/
public static function addNavigationEntry( $data ){
- // TODO: write function
+ $data['active']=false;
+ if(!isset($data['icon'])){
+ $data['icon']='';
+ }
OC_APP::$navigation[] = $data;
return true;
}
@@ -184,6 +187,10 @@ class OC_APP{
* the navigation. Lower values come first.
*/
public static function addNavigationSubEntry( $parent, $data ){
+ $data['active']=false;
+ if(!isset($data['icon'])){
+ $data['icon']='';
+ }
if( !array_key_exists( $parent, self::$subnavigation )){
self::$subnavigation[$parent] = array();
}
@@ -318,16 +325,25 @@ class OC_APP{
$naventry['subnavigation'] = $subNav;
}
}
- }
-
- // Mark subentry as active
- foreach( $list as &$naventry ){
- if( $naventry['active'] ){
- foreach( $naventry['subnavigation'] as &$subnaventry ){
- $subnaventry['active'] = $subnaventry['id'] == self::$activeapp? true : false;
- } unset( $subnaventry );
+ }else{
+ foreach(self::$subnavigation as $parent=>$entries){
+ $activeParent=false;
+ foreach($entries as &$subNav){
+ $subNav['active']=$subNav['id'] == self::$activeapp;
+ if($subNav['active']){
+ $activeParent=true;
+ }
+ }
+ if($activeParent){
+ foreach( $list as &$naventry ){
+ if( $naventry['id'] == $parent ){
+ $naventry['active'] = true;
+ $naventry['subnavigation'] = $entries;
+ }
+ }
+ }
}
- } unset( $naventry );
+ }
return $list;
}