diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 15 | ||||
-rw-r--r-- | lib/template.php | 18 |
2 files changed, 27 insertions, 6 deletions
diff --git a/lib/app.php b/lib/app.php index 9f1ce6f1047..b08733e04d9 100644 --- a/lib/app.php +++ b/lib/app.php @@ -53,7 +53,7 @@ class OC_APP{ } // Our very own core apps are hardcoded - foreach( array( "admin", "files", "log", "settings" ) as $app ){ + foreach( array( "admin", "files", "log", "help", "settings" ) as $app ){ require( "$app/appinfo/app.php" ); } @@ -165,12 +165,23 @@ class OC_APP{ * property from all other entries. The templates can use this for * highlighting the current position of the user. */ - public static function activateNavigationEntry( $id ){ + public static function setActiveNavigationEntry( $id ){ self::$activeapp = $id; return true; } /** + * @brief gets the active Menu entry + * @returns id or empty string + * + * This function returns the id of the active navigation entry (set by + * setActiveNavigationEntry + */ + public static function getActiveNavigationEntry(){ + return self::$activeapp; + } + + /** * @brief adds an entry to the personal menu * @param $data array containing the data * @returns true/false diff --git a/lib/template.php b/lib/template.php index c36b1e7a367..fcf6334b956 100644 --- a/lib/template.php +++ b/lib/template.php @@ -190,11 +190,25 @@ class OC_TEMPLATE{ { $page = new OC_TEMPLATE( "core", "layout.user" ); // Add menu data + + // Add navigation entry and personal menu + $page->assign( "navigation", OC_APP::getNavigation()); + $page->assign( "personalmenu", OC_APP::getPersonalMenu()); } elseif( $this->renderas == "admin" ) { $page = new OC_TEMPLATE( "core", "layout.admin" ); // Add menu data + $navigation = array(); + if( OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){ + foreach( OC_APP::getAdminPages() as $i ){ + $navigation[] = $i; + } + } + foreach( OC_APP::getSettingsPages() as $i ){ + $navigation[] = $i; + } + $page->assign( "navigation", $navigation ); } else { @@ -210,10 +224,6 @@ class OC_TEMPLATE{ $page->append( "cssfiles", "$WEBROOT/$style.css" ); } - // Add navigation entry and personal menu - $page->assign( "navigation", OC_APP::getNavigation()); - $page->assign( "personalmenu", OC_APP::getPersonalMenu()); - // Add css files and js files $page->assign( "content", $data ); return $page->fetchPage(); |