. * */ namespace OCA\Tasks\AppInfo; use \OCP\AppFramework\App; use \OCA\Tasks\Controller\PageController; use \OCA\Tasks\Controller\CollectionsController; use \OCA\Tasks\Controller\ListsController; use \OCA\Tasks\Controller\SettingsController; use \OCA\Tasks\Controller\TasksController; class Application extends App { public function __construct (array $urlParams=array()) { parent::__construct('tasks', $urlParams); $container = $this->getContainer(); /** * Controllers */ $container->registerService('PageController', function($c) { return new PageController( $c->query('AppName'), $c->query('Request'), $c->query('UserId') ); }); $container->registerService('CollectionsController', function($c) { return new CollectionsController( $c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('L10N'), $c->query('Settings') ); }); $container->registerService('ListsController', function($c) { return new ListsController( $c->query('AppName'), $c->query('Request'), $c->query('UserId') ); }); $container->registerService('SettingsController', function($c) { return new SettingsController( $c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('Settings') ); }); $container->registerService('TasksController', function($c) { return new TasksController( $c->query('AppName'), $c->query('Request'), $c->query('UserId') ); }); /** * Core */ $container->registerService('UserId', function($c) { return \OCP\User::getUser(); }); $container->registerService('L10N', function($c) { return $c->query('ServerContainer')->getL10N($c->query('AppName')); }); $container->registerService('Settings', function($c) { return $c->query('ServerContainer')->getConfig(); }); \OC::$server->getSearch()->registerProvider('OCA\Tasks\Controller\SearchController', array('apps' => array('tasks'))); } }