Make the router handle OCS AppFramework Routes

pull/400/head
Roeland Jago Douma 8 years ago committed by Roeland Jago Douma
parent 1ff4b7f63d
commit 94cd83ca00
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B

@ -150,6 +150,11 @@ class Router implements IRouter {
$collection = $this->getCollection($app);
$collection->addPrefix('/apps/' . $app);
$this->root->addCollection($collection);
// Also add the OCS collection
$collection = $this->getCollection($app.'.ocs');
$collection->addPrefix('/ocsapp/apps/' . $app);
$this->root->addCollection($collection);
}
}
if (!isset($this->loadedApps['core'])) {
@ -238,6 +243,13 @@ class Router implements IRouter {
// empty string / 'apps' / $app / rest of the route
list(, , $app,) = explode('/', $url, 4);
$app = \OC_App::cleanAppId($app);
\OC::$REQUESTEDAPP = $app;
$this->loadRoutes($app);
} else if (substr($url, 0, 13) === '/ocsapp/apps/') {
// empty string / 'ocsapp' / 'apps' / $app / rest of the route
list(, , , $app,) = explode('/', $url, 5);
$app = \OC_App::cleanAppId($app);
\OC::$REQUESTEDAPP = $app;
$this->loadRoutes($app);

Loading…
Cancel
Save