From c5c07d8dae43123c6f730cf3081502189ad39d2e Mon Sep 17 00:00:00 2001 From: e-alfred Date: Thu, 27 Sep 2018 11:25:41 +0200 Subject: [PATCH] Fix deprecated calls for NC14+ compatibility (#63) --- appinfo/app.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index cf28a32..33d6b53 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -11,8 +11,7 @@ namespace OCA\Weather\AppInfo; -if (class_exists('\OCP\AppFramework\App')) { - \OC::$server->getNavigationManager()->add(array( +\OC::$server->getNavigationManager()->add([ // the string under which your app will be referenced in owncloud 'id' => 'weather', @@ -21,17 +20,13 @@ if (class_exists('\OCP\AppFramework\App')) { 'order' => 10, // the route that will be shown on startup - 'href' => \OCP\Util::linkToRoute('weather.city.index'), + 'href' => \OC::$server->getURLGenerator()->linkToRoute('weather.city.index'), // the icon that will be shown in the navigation // this file needs to exist in img/ - 'icon' => \OCP\Util::imagePath('weather', 'app.svg'), + 'icon' => \OC::$server->getURLGenerator()->imagePath('weather', 'app.svg'), // the title of your application. This will be used in the // navigation or on the settings page of your app 'name' => \OCP\Util::getL10N('weather')->t('Weather') - )); -} else { - $msg = 'Can not enable Weather app because the App Framework App is disabled'; - \OCP\Util::writeLog('weather', $msg, \OCP\Util::ERROR); -} +]);