Move navigation entry to info.xml
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
9103930ae3
commit
d82b353d4d
3 changed files with 9 additions and 47 deletions
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Nextcloud - Tasks
|
||||
*
|
||||
* @author Raimund Schlüßler
|
||||
* @copyright 2018 Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$app = new \OCA\Tasks\AppInfo\Application();
|
||||
$app->registerNavigation();
|
|
@ -22,4 +22,13 @@
|
|||
<dependencies>
|
||||
<nextcloud min-version="15" max-version="18"/>
|
||||
</dependencies>
|
||||
<navigations>
|
||||
<navigation>
|
||||
<id>tasks</id>
|
||||
<name>Tasks</name>
|
||||
<route>tasks.page.index</route>
|
||||
<icon>tasks.svg</icon>
|
||||
<order>100</order>
|
||||
</navigation>
|
||||
</navigations>
|
||||
</info>
|
||||
|
|
|
@ -32,27 +32,4 @@ class Application extends App {
|
|||
public function __construct(array $params=[]) {
|
||||
parent::__construct('tasks', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register navigation
|
||||
*/
|
||||
public function registerNavigation() {
|
||||
$appName = $this->getContainer()->getAppName();
|
||||
$server = $this->getContainer()->getServer();
|
||||
$urlGenerator = $server->getURLGenerator();
|
||||
|
||||
$server->getNavigationManager()->add(function() use ($appName, $server, $urlGenerator) {
|
||||
return [
|
||||
'id' => $appName,
|
||||
|
||||
'order' => 100,
|
||||
|
||||
'href' => $urlGenerator->linkToRoute('tasks.page.index'),
|
||||
|
||||
'icon' => $urlGenerator->imagePath($appName, 'tasks.svg'),
|
||||
|
||||
'name' => $server->getL10N($appName)->t('Tasks'),
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue