Better way of getting the navigation entries for an app
This commit is contained in:
parent
96042f1e5b
commit
340d6fce11
2 changed files with 18 additions and 4 deletions
17
lib/app.php
17
lib/app.php
|
@ -285,6 +285,23 @@ class OC_App{
|
|||
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
|
||||
* @return string id or empty string
|
||||
|
|
|
@ -5,10 +5,7 @@ OCP\JSON::callCheck();
|
|||
|
||||
$app = $_GET['app'];
|
||||
|
||||
//load the one app and see what it adds to the navigation
|
||||
OC_App::loadApp($app);
|
||||
|
||||
$navigation = OC_App::getNavigation();
|
||||
$navigation = OC_App::getAppNavigationEntries($app);
|
||||
|
||||
$navIds = array();
|
||||
foreach ($navigation as $nav) {
|
||||
|
|
Loading…
Reference in a new issue