diff options
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/appinfo/app.php | 78 |
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 () { |