89 lines
2.3 KiB
PHP
89 lines
2.3 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* ownCloud - gpxedit
|
||
|
*
|
||
|
*
|
||
|
* @author
|
||
|
*
|
||
|
* @copyright
|
||
|
*/
|
||
|
|
||
|
namespace OCA\GpxEdit\AppInfo;
|
||
|
|
||
|
|
||
|
|
||
|
use OCP\IContainer;
|
||
|
|
||
|
use OCP\AppFramework\App;
|
||
|
use OCP\AppFramework\IAppContainer;
|
||
|
|
||
|
use OCA\GpxEdit\Controller\PageController;
|
||
|
use OCA\GpxEdit\Controller\ComparisonController;
|
||
|
use OCA\GpxEdit\Controller\UtilsController;
|
||
|
|
||
|
/**
|
||
|
* Class Application
|
||
|
*
|
||
|
* @package OCA\GpxEdit\AppInfo
|
||
|
*/
|
||
|
class Application extends App {
|
||
|
|
||
|
/**
|
||
|
* Constructor
|
||
|
*
|
||
|
* @param array $urlParams
|
||
|
*/
|
||
|
public function __construct(array $urlParams = []) {
|
||
|
parent::__construct('gpxedit', $urlParams);
|
||
|
|
||
|
$container = $this->getContainer();
|
||
|
|
||
|
/**
|
||
|
* Controllers
|
||
|
*/
|
||
|
$container->registerService(
|
||
|
'PageController', function (IAppContainer $c) {
|
||
|
return new PageController(
|
||
|
$c->query('AppName'),
|
||
|
$c->query('Request'),
|
||
|
$c->query('UserId'),
|
||
|
$c->query('ServerContainer')->getUserFolder($c->query('UserId')),
|
||
|
$c->query('ServerContainer')->getConfig(),
|
||
|
$c->getServer()->getShareManager()
|
||
|
);
|
||
|
}
|
||
|
);
|
||
|
|
||
|
$container->registerService(
|
||
|
'ComparisonController', function (IAppContainer $c) {
|
||
|
return new ComparisonController(
|
||
|
$c->query('AppName'),
|
||
|
$c->query('Request'),
|
||
|
$c->query('UserId'),
|
||
|
//$c->getServer()->getUserFolder($c->query('UserId')),
|
||
|
//$c->query('OCP\IConfig'),
|
||
|
$c->query('ServerContainer')->getUserFolder($c->query('UserId')),
|
||
|
$c->query('ServerContainer')->getConfig()
|
||
|
);
|
||
|
}
|
||
|
);
|
||
|
|
||
|
$container->registerService(
|
||
|
'UtilsController', function (IAppContainer $c) {
|
||
|
return new UtilsController(
|
||
|
$c->query('AppName'),
|
||
|
$c->query('Request'),
|
||
|
$c->query('UserId'),
|
||
|
//$c->getServer()->getUserFolder($c->query('UserId')),
|
||
|
//$c->query('OCP\IConfig'),
|
||
|
$c->query('ServerContainer')->getUserFolder($c->query('UserId')),
|
||
|
$c->query('ServerContainer')->getConfig()
|
||
|
);
|
||
|
}
|
||
|
);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|