diff --git a/appinfo/app.php b/appinfo/app.php deleted file mode 100644 index f9c8815..0000000 --- a/appinfo/app.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * @author Vinzenz Rosenkranz - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program 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 program. If not, see . - * - */ - -$app = new \OCA\Forms\AppInfo\Application(); -$app->registerNavigationEntry(); diff --git a/appinfo/info.xml b/appinfo/info.xml index a2857a7..96988e1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -34,4 +34,12 @@ + + + Forms + forms.page.index + app.svg + 77 + + diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index eefeaf0..dddd5f8 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -31,29 +31,13 @@ use OCP\IURLGenerator; class Application extends App { + const APP_ID = 'forms'; + /** * Application constructor. * @param array $urlParams */ public function __construct(array $urlParams = []) { - parent::__construct('forms', $urlParams); - } - - /** - * Register navigation entry for main navigation. - */ - public function registerNavigationEntry(): void { - $container = $this->getContainer(); - $container->query(INavigationManager::class)->add(function() use ($container) { - $urlGenerator = $container->query(IURLGenerator::class); - $l10n = $container->query(IL10N::class); - return [ - 'id' => 'forms', - 'order' => 77, - 'href' => $urlGenerator->linkToRoute('forms.page.index'), - 'icon' => $urlGenerator->imagePath('forms', 'app.svg'), - 'name' => $l10n->t('Forms') - ]; - }); + parent::__construct(self::APP_ID, $urlParams); } }