From 517e4ca5435106ab5304849248cbea4e9dffd4b0 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 19 Apr 2014 13:20:54 +0200 Subject: split up api class for easier testing and clearer code --- appinfo/app.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'appinfo/app.php') diff --git a/appinfo/app.php b/appinfo/app.php index 33dc340ab..486c234a7 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -24,31 +24,28 @@ namespace OCA\News; -use \OCA\News\Core\API; -$api = new API('news'); - -$api->addNavigationEntry(array( +\OCP\App::addNavigationEntry(array( // the string under which your app will be referenced in owncloud - 'id' => $api->getAppName(), + 'id' => 'news', // sorting weight for the navigation. The higher the number, the higher // will it be listed in the navigation 'order' => 10, // the route that will be shown on startup - 'href' => $api->linkToRoute('news.page.index'), + 'href' => \OCP\Util::linkToRoute('news.page.index'), // the icon that will be shown in the navigation // this file needs to exist in img/example.png - 'icon' => $api->imagePath('news.svg'), + 'icon' => \OCP\Util::imagePath('news', 'news.svg'), // the title of your application. This will be used in the // navigation or on the settings page of your app - 'name' => $api->getTrans()->t('News') + 'name' => \OC_L10N::get('news')->t('News') )); -$api->addRegularTask('OCA\News\Backgroundjob\Task', 'run'); -$api->connectHook('OC_User', 'pre_deleteUser', 'OCA\News\Hooks\User', 'deleteUser'); +\OCP\Backgroundjob::addRegularTask('OCA\News\Backgroundjob\Task', 'run'); +\OCP\Util::connectHook('OC_User', 'pre_deleteUser', 'OCA\News\Hooks\User', 'deleteUser'); -- cgit v1.2.3