summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2017-03-08 00:19:24 +0100
committerJoas Schilling <coding@schilljs.com>2017-03-13 08:52:54 +0100
commitfbd2dd49b6a16a786c6d6da13e8065037577b7c4 (patch)
treeb2144d11bc3118b5be19ebab31762fcbc1260138 /apps
parentf7cef9f7024a0f94a36746daee2fe4ef6335bac6 (diff)
downloadnextcloud-server-fbd2dd49b6a16a786c6d6da13e8065037577b7c4.tar.gz
nextcloud-server-fbd2dd49b6a16a786c6d6da13e8065037577b7c4.zip
use closure to properly defer l10n initialization (#27328)
Diffstat (limited to 'apps')
-rw-r--r--apps/federatedfilesharing/appinfo/app.php4
-rw-r--r--apps/files_external/appinfo/app.php19
-rw-r--r--apps/files_sharing/appinfo/app.php60
-rw-r--r--apps/files_trashbin/appinfo/app.php21
-rw-r--r--apps/systemtags/appinfo/app.php14
5 files changed, 59 insertions, 59 deletions
diff --git a/apps/federatedfilesharing/appinfo/app.php b/apps/federatedfilesharing/appinfo/app.php
index 4a5492b0f15..b6a145bcc2c 100644
--- a/apps/federatedfilesharing/appinfo/app.php
+++ b/apps/federatedfilesharing/appinfo/app.php
@@ -24,7 +24,6 @@
use OCA\FederatedFileSharing\Notifier;
$app = new \OCA\FederatedFileSharing\AppInfo\Application();
-$l = \OC::$server->getL10N('files_sharing');
$eventDispatcher = \OC::$server->getEventDispatcher();
$app->registerSettings();
@@ -32,7 +31,8 @@ $app->registerSettings();
$manager = \OC::$server->getNotificationManager();
$manager->registerNotifier(function() {
return \OC::$server->query(Notifier::class);
-}, function() use ($l) {
+}, function() {
+ $l = \OC::$server->getL10N('files_sharing');
return [
'id' => 'files_sharing',
'name' => $l->t('Federated sharing'),
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 3a90cf0c2c1..925596198cf 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -37,15 +37,16 @@ $appContainer = \OC_Mount_Config::$app->getContainer();
\OC_Mount_Config::$app->registerSettings();
-$l = \OC::$server->getL10N('files_external');
-
-\OCA\Files\App::getNavigationManager()->add([
- "id" => 'extstoragemounts',
- "appname" => 'files_external',
- "script" => 'list.php',
- "order" => 30,
- "name" => $l->t('External storage')
-]);
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_external');
+ return [
+ 'id' => 'extstoragemounts',
+ 'appname' => 'files_external',
+ 'script' => 'list.php',
+ 'order' => 30,
+ 'name' => $l->t('External storage'),
+ ];
+});
$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
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'),
+ ];
+ });
}
}
}
diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php
index ed53657d22a..d4e44b78850 100644
--- a/apps/files_trashbin/appinfo/app.php
+++ b/apps/files_trashbin/appinfo/app.php
@@ -25,17 +25,16 @@
*
*/
-$l = \OC::$server->getL10N('files_trashbin');
-
// register hooks
\OCA\Files_Trashbin\Trashbin::registerHooks();
-\OCA\Files\App::getNavigationManager()->add(
-array(
- "id" => 'trashbin',
- "appname" => 'files_trashbin',
- "script" => 'list.php',
- "order" => 50,
- "name" => $l->t('Deleted files')
-)
-);
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('files_trashbin');
+ return [
+ 'id' => 'trashbin',
+ 'appname' => 'files_trashbin',
+ 'script' => 'list.php',
+ 'order' => 50,
+ 'name' => $l->t('Deleted files'),
+ ];
+});
diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php
index 2c095753ce8..bb2930e9197 100644
--- a/apps/systemtags/appinfo/app.php
+++ b/apps/systemtags/appinfo/app.php
@@ -65,14 +65,14 @@ $mapperListener = function(MapperEvent $event) {
$eventDispatcher->addListener(MapperEvent::EVENT_ASSIGN, $mapperListener);
$eventDispatcher->addListener(MapperEvent::EVENT_UNASSIGN, $mapperListener);
-$l = \OC::$server->getL10N('systemtags');
-
-\OCA\Files\App::getNavigationManager()->add(
- array(
+\OCA\Files\App::getNavigationManager()->add(function () {
+ $l = \OC::$server->getL10N('systemtags');
+ return [
'id' => 'systemtagsfilter',
'appname' => 'systemtags',
'script' => 'list.php',
'order' => 25,
- 'name' => $l->t('Tags')
- )
-);
+ 'name' => $l->t('Tags'),
+ ];
+});
+