Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-12-08 19:43:46 +0300
committerLukas Reschke <lukas@statuscode.ch>2016-12-22 14:34:41 +0300
commitaa8755bd4b2d5a949a35f1308eefa6d00140a1a7 (patch)
tree09153939dd285480a1225290d7bde664e41826fa /apps/files/appinfo
parent7f8d22e7102293d96c365b380bf1845ff2de6b71 (diff)
Add navigation via info.xml (#26785)
* Read navigation information from info.xml * Load files navigation elements from info.xml * Add comment about ignoring the exception Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/files/appinfo')
-rw-r--r--apps/files/appinfo/app.php14
-rw-r--r--apps/files/appinfo/info.xml6
2 files changed, 8 insertions, 12 deletions
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index a194bb5e795..63acda3a706 100644
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -26,20 +26,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+// required for translation purpose
+// t('Files')
$l = \OC::$server->getL10N('files');
-\OC::$server->getNavigationManager()->add(function () {
- $urlGenerator = \OC::$server->getURLGenerator();
- $l = \OC::$server->getL10N('files');
- return [
- 'id' => 'files_index',
- 'order' => 0,
- 'href' => $urlGenerator->linkToRoute('files.view.index'),
- 'icon' => $urlGenerator->imagePath('core', 'places/files.svg'),
- 'name' => $l->t('Files'),
- ];
-});
-
\OC::$server->getSearch()->registerProvider('OC\Search\Provider\File', array('apps' => array('files')));
$templateManager = \OC_Helper::getFileTemplateManager();
diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml
index a25c043f332..1171c0ceb6f 100644
--- a/apps/files/appinfo/info.xml
+++ b/apps/files/appinfo/info.xml
@@ -53,4 +53,10 @@
<command>OCA\Files\Command\DeleteOrphanedFiles</command>
<command>OCA\Files\Command\TransferOwnership</command>
</commands>
+
+ <navigation>
+ <route>files.view.index</route>
+ <order>0</order>
+ </navigation>
+
</info>