summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/appinfo
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-13 09:33:57 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-13 09:33:57 +0200
commit6f45607f57c55550808824ffdeebbf10353a2554 (patch)
tree632299fe9ad96d6ef54001121a9bfaa61de1bc20 /apps/files_sharing/appinfo
parent1f9e50086cc404d6dd46c5ae664f951faaf74c98 (diff)
downloadnextcloud-server-6f45607f57c55550808824ffdeebbf10353a2554.tar.gz
nextcloud-server-6f45607f57c55550808824ffdeebbf10353a2554.zip
Upgraded navigation submenu management and api + created sharing submenu
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/appinfo')
-rw-r--r--apps/files_sharing/appinfo/app.php78
1 files changed, 38 insertions, 40 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 189c45426d5..b7459d999db 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -50,56 +50,54 @@ $eventDispatcher->addListener(
$config = \OC::$server->getConfig();
$shareManager = \OC::$server->getShareManager();
$userSession = \OC::$server->getUserSession();
+$l = \OC::$server->getL10N('files_sharing');
if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
- \OCA\Files\App::getNavigationManager()->add(function () {
- $l = \OC::$server->getL10N('files_sharing');
- return [
- 'id' => 'sharingin',
- 'appname' => 'files_sharing',
- 'script' => 'list.php',
- 'order' => 15,
- 'name' => $l->t('Shared with you'),
- ];
- });
+
+ $sharingSublistArray = [];
+
+ array_push($sharingSublistArray, [
+ 'id' => 'sharingin',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 15,
+ 'name' => $l->t('Shared with you'),
+ ]);
if (\OCP\Util::isSharingDisabledForUser() === false) {
- \OCA\Files\App::getNavigationManager()->add(function () {
- $l = \OC::$server->getL10N('files_sharing');
- return [
- 'id' => 'sharingout',
- 'appname' => 'files_sharing',
- 'script' => 'list.php',
- 'order' => 16,
- 'name' => $l->t('Shared with others'),
- ];
- });
+ array_push($sharingSublistArray, [
+ 'id' => 'sharingout',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 16,
+ 'name' => $l->t('Shared with others'),
+ ]);
// Check if sharing by link is enabled
if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
- \OCA\Files\App::getNavigationManager()->add(function () {
- $l = \OC::$server->getL10N('files_sharing');
- return [
- 'id' => 'sharinglinks',
- 'appname' => 'files_sharing',
- 'script' => 'list.php',
- 'order' => 17,
- 'name' => $l->t('Shared by link'),
- ];
- });
+ array_push($sharingSublistArray, [
+ 'id' => 'sharinglinks',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 17,
+ 'name' => $l->t('Shared by link'),
+ ]);
}
}
- \OCA\Files\App::getNavigationManager()->add(function () {
- $l = \OC::$server->getL10N('files_sharing');
- return [
- 'id' => 'shareoverview',
- 'appname' => 'files_sharing',
- 'script' => 'list.php',
- 'order' => 18,
- 'name' => $l->t('Share overview'),
- ];
- });
+ // show_Quick_Access stored as string
+ $defaultExpandedState = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_sharing_menu', '0') === '1';
+
+ \OCA\Files\App::getNavigationManager()->add([
+ 'id' => 'shareoverview',
+ 'appname' => 'files_sharing',
+ 'script' => 'list.php',
+ 'order' => 18,
+ 'name' => $l->t('Share overview'),
+ 'classes' => 'collapsible',
+ 'sublist' => $sharingSublistArray,
+ 'expandedState' => 'show_sharing_menu'
+ ]);
\OCA\Files\App::getNavigationManager()->add(function () {