]> source.dussan.org Git - nextcloud-server.git/commitdiff
Hide sharing sections in files app when sharing API is disabled
authorVincent Petry <pvince81@owncloud.com>
Mon, 18 Aug 2014 14:33:29 +0000 (16:33 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 18 Aug 2014 14:33:29 +0000 (16:33 +0200)
apps/files_sharing/appinfo/app.php

index 60bec2b4050cd2ad783e4c83e4b760df3917be96..b22c553ec937c298eb97c1b490a15c0d0fc99c09 100644 (file)
@@ -24,19 +24,22 @@ OCP\Util::addScript('files_sharing', 'external');
 
 OC_FileProxy::register(new OCA\Files\Share\Proxy());
 
-\OCA\Files\App::getNavigationManager()->add(
-       array(
-               "id" => 'sharingin',
-               "appname" => 'files_sharing',
-               "script" => 'list.php',
-               "order" => 10,
-               "name" => $l->t('Shared with you')
-       )
-);
-
-if (\OCP\Util::isSharingDisabledForUser() === false) {
+$config = \OC::$server->getConfig();
+if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
 
        \OCA\Files\App::getNavigationManager()->add(
+               array(
+                       "id" => 'sharingin',
+                       "appname" => 'files_sharing',
+                       "script" => 'list.php',
+                       "order" => 10,
+                       "name" => $l->t('Shared with you')
+               )
+       );
+
+       if (\OCP\Util::isSharingDisabledForUser() === false) {
+
+               \OCA\Files\App::getNavigationManager()->add(
                        array(
                                "id" => 'sharingout',
                                "appname" => 'files_sharing',
@@ -44,8 +47,8 @@ if (\OCP\Util::isSharingDisabledForUser() === false) {
                                "order" => 15,
                                "name" => $l->t('Shared with others')
                        )
-       );
-       \OCA\Files\App::getNavigationManager()->add(
+               );
+               \OCA\Files\App::getNavigationManager()->add(
                        array(
                                "id" => 'sharinglinks',
                                "appname" => 'files_sharing',
@@ -53,5 +56,6 @@ if (\OCP\Util::isSharingDisabledForUser() === false) {
                                "order" => 20,
                                "name" => $l->t('Shared by link')
                        )
-       );
+               );
+       }
 }