diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2017-03-08 00:19:24 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-03-13 08:52:54 +0100 |
commit | fbd2dd49b6a16a786c6d6da13e8065037577b7c4 (patch) | |
tree | b2144d11bc3118b5be19ebab31762fcbc1260138 /apps/files_sharing/appinfo | |
parent | f7cef9f7024a0f94a36746daee2fe4ef6335bac6 (diff) | |
download | nextcloud-server-fbd2dd49b6a16a786c6d6da13e8065037577b7c4.tar.gz nextcloud-server-fbd2dd49b6a16a786c6d6da13e8065037577b7c4.zip |
use closure to properly defer l10n initialization (#27328)
Diffstat (limited to 'apps/files_sharing/appinfo')
-rw-r--r-- | apps/files_sharing/appinfo/app.php | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 4fed51b1194..8228e761592 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -26,8 +26,6 @@ * */ -$l = \OC::$server->getL10N('files_sharing'); - \OCA\Files_Sharing\Helper::registerHooks(); \OCP\Share::registerBackend('file', 'OCA\Files_Sharing\ShareBackend\File'); @@ -52,39 +50,41 @@ $eventDispatcher->addListener( $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') - ) - ); + \OCA\Files\App::getNavigationManager()->add(function () { + $l = \OC::$server->getL10N('files_sharing'); + return [ + '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(function () { + $l = \OC::$server->getL10N('files_sharing'); + return [ + 'id' => 'sharingout', + 'appname' => 'files_sharing', + 'script' => 'list.php', + 'order' => 15, + 'name' => $l->t('Shared with others'), + ]; + }); - \OCA\Files\App::getNavigationManager()->add( - array( - "id" => 'sharingout', - "appname" => 'files_sharing', - "script" => 'list.php', - "order" => 15, - "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( - array( - "id" => 'sharinglinks', - "appname" => 'files_sharing', - "script" => 'list.php', - "order" => 20, - "name" => $l->t('Shared by link') - ) - ); + \OCA\Files\App::getNavigationManager()->add(function () { + $l = \OC::$server->getL10N('files_sharing'); + return [ + 'id' => 'sharinglinks', + 'appname' => 'files_sharing', + 'script' => 'list.php', + 'order' => 20, + 'name' => $l->t('Shared by link'), + ]; + }); } } } |