Merge pull request #1546 from owncloud/fix-loading-hooks
Fix loading hooks when going though the routing system
This commit is contained in:
commit
0222c589ac
17
lib/app.php
17
lib/app.php
|
@ -294,6 +294,23 @@ class OC_App{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the navigation entries for the $app
|
||||||
|
* @param string $app app
|
||||||
|
* @return array of the $data added with addNavigationEntry
|
||||||
|
*/
|
||||||
|
public static function getAppNavigationEntries($app) {
|
||||||
|
if(is_file(self::getAppPath($app).'/appinfo/app.php')) {
|
||||||
|
$save = self::$navigation;
|
||||||
|
self::$navigation = array();
|
||||||
|
require $app.'/appinfo/app.php';
|
||||||
|
$app_entries = self::$navigation;
|
||||||
|
self::$navigation = $save;
|
||||||
|
return $app_entries;
|
||||||
|
}
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief gets the active Menu entry
|
* @brief gets the active Menu entry
|
||||||
* @return string id or empty string
|
* @return string id or empty string
|
||||||
|
|
|
@ -557,6 +557,7 @@ class OC {
|
||||||
|
|
||||||
if (!self::$CLI) {
|
if (!self::$CLI) {
|
||||||
try {
|
try {
|
||||||
|
OC_App::loadApps();
|
||||||
OC::getRouter()->match(OC_Request::getPathInfo());
|
OC::getRouter()->match(OC_Request::getPathInfo());
|
||||||
return;
|
return;
|
||||||
} catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
|
} catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
|
||||||
|
|
|
@ -6,10 +6,7 @@ OCP\JSON::callCheck();
|
||||||
$app = $_GET['app'];
|
$app = $_GET['app'];
|
||||||
$app = OC_App::cleanAppId($app);
|
$app = OC_App::cleanAppId($app);
|
||||||
|
|
||||||
//load the one app and see what it adds to the navigation
|
$navigation = OC_App::getAppNavigationEntries($app);
|
||||||
OC_App::loadApp($app);
|
|
||||||
|
|
||||||
$navigation = OC_App::getNavigation();
|
|
||||||
|
|
||||||
$navIds = array();
|
$navIds = array();
|
||||||
foreach ($navigation as $nav) {
|
foreach ($navigation as $nav) {
|
||||||
|
|
Loading…
Reference in New Issue