summaryrefslogtreecommitdiffstats
path: root/appinfo/app.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-19 13:20:54 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-19 13:21:11 +0200
commit517e4ca5435106ab5304849248cbea4e9dffd4b0 (patch)
tree0f00076f012791b39c710994f695abf723546062 /appinfo/app.php
parentbd35b98d2c130f058b182f726636ee971625823b (diff)
split up api class for easier testing and clearer code
Diffstat (limited to 'appinfo/app.php')
-rw-r--r--appinfo/app.php17
1 files changed, 7 insertions, 10 deletions
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');