diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-08-05 01:40:19 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-08-05 01:42:17 +0200 |
commit | cc445e4e477944a680bb19919cbfd0330d0f7851 (patch) | |
tree | 88d45e0fe503063b13b8b872acbd3707739bb77e | |
parent | 538e72fe61fe4a9e5b5cc9f3927b749c69f715a1 (diff) | |
download | nextcloud-server-cc445e4e477944a680bb19919cbfd0330d0f7851.tar.gz nextcloud-server-cc445e4e477944a680bb19919cbfd0330d0f7851.zip |
Small changes to allow updating main menu dynamically.
-rw-r--r-- | core/templates/layout.user.php | 2 | ||||
-rwxr-xr-x | lib/app.php | 11 | ||||
-rw-r--r-- | lib/installer.php | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index dc303ffc1a7..2abe4da8538 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -55,7 +55,7 @@ <nav><div id="navigation"> <ul id="apps" class="svg"> <?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 data-id="<?php echo $entry['id']; ?>"><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 endforeach; ?> </ul> diff --git a/lib/app.php b/lib/app.php index 2e9ec4d6308..1c91818ca75 100755 --- a/lib/app.php +++ b/lib/app.php @@ -183,7 +183,7 @@ class OC_App{ if(!OC_Installer::isInstalled($app)){ // check if app is a shipped app or not. OCS apps have an integer as id, shipped apps use a string if(!is_numeric($app)){ - OC_Installer::installShippedApp($app); + $app = OC_Installer::installShippedApp($app); }else{ $download=OC_OCSClient::getApplicationDownload($app,1); if(isset($download['downloadlink']) and $download['downloadlink']!='') { @@ -205,6 +205,7 @@ class OC_App{ }else{ return false; } + return $app; } /** @@ -292,19 +293,19 @@ class OC_App{ if (OC_User::isLoggedIn()) { // personal menu $settings[] = array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" )); - + // if there're some settings forms if(!empty(self::$settingsForms)) // settings menu $settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" )); - + //SubAdmins are also allowed to access user management if(OC_SubAdmin::isSubAdmin($_SESSION["user_id"]) || OC_Group::inGroup( $_SESSION["user_id"], "admin" )){ // admin users menu $settings[] = array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" )); } - - + + // if the user is an admin if(OC_Group::inGroup( $_SESSION["user_id"], "admin" )) { // admin apps menu diff --git a/lib/installer.php b/lib/installer.php index 0c5fc416297..b8a3226aa0b 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -335,7 +335,7 @@ class OC_Installer{ OC_App::setAppTypes($info['id']); - return $info; + return $info['id']; } |