Small changes to allow updating main menu dynamically.
This commit is contained in:
parent
538e72fe61
commit
cc445e4e47
|
@ -55,7 +55,7 @@
|
||||||
<nav><div id="navigation">
|
<nav><div id="navigation">
|
||||||
<ul id="apps" class="svg">
|
<ul id="apps" class="svg">
|
||||||
<?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 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>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
11
lib/app.php
11
lib/app.php
|
@ -183,7 +183,7 @@ class OC_App{
|
||||||
if(!OC_Installer::isInstalled($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
|
// 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)){
|
if(!is_numeric($app)){
|
||||||
OC_Installer::installShippedApp($app);
|
$app = OC_Installer::installShippedApp($app);
|
||||||
}else{
|
}else{
|
||||||
$download=OC_OCSClient::getApplicationDownload($app,1);
|
$download=OC_OCSClient::getApplicationDownload($app,1);
|
||||||
if(isset($download['downloadlink']) and $download['downloadlink']!='') {
|
if(isset($download['downloadlink']) and $download['downloadlink']!='') {
|
||||||
|
@ -205,6 +205,7 @@ class OC_App{
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,19 +293,19 @@ class OC_App{
|
||||||
if (OC_User::isLoggedIn()) {
|
if (OC_User::isLoggedIn()) {
|
||||||
// personal menu
|
// 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" ));
|
$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 there're some settings forms
|
||||||
if(!empty(self::$settingsForms))
|
if(!empty(self::$settingsForms))
|
||||||
// settings menu
|
// 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" ));
|
$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
|
//SubAdmins are also allowed to access user management
|
||||||
if(OC_SubAdmin::isSubAdmin($_SESSION["user_id"]) || OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
if(OC_SubAdmin::isSubAdmin($_SESSION["user_id"]) || OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
||||||
// admin users menu
|
// 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" ));
|
$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 the user is an admin
|
||||||
if(OC_Group::inGroup( $_SESSION["user_id"], "admin" )) {
|
if(OC_Group::inGroup( $_SESSION["user_id"], "admin" )) {
|
||||||
// admin apps menu
|
// admin apps menu
|
||||||
|
|
|
@ -335,7 +335,7 @@ class OC_Installer{
|
||||||
|
|
||||||
OC_App::setAppTypes($info['id']);
|
OC_App::setAppTypes($info['id']);
|
||||||
|
|
||||||
return $info;
|
return $info['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue