Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/Menu
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-06-05 08:44:37 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-06-05 08:44:37 +0400
commit3e03b0a7ca4055b4f05be7d4ec7bcfaacf364eff (patch)
tree47afa18c0b671f38e17405078bdee156ad020058 /core/Menu
parent0ed11b178860844b97b967f6cfa1ffd12ab2eaab (diff)
refs #5301 started to simplify scheduled tasks API while staying backwards compatible
Diffstat (limited to 'core/Menu')
-rw-r--r--core/Menu/MenuAbstract.php33
1 files changed, 1 insertions, 32 deletions
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index 4ffbe8f532..06d972f064 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -61,42 +61,11 @@ abstract class MenuAbstract extends Singleton
return self::$menus;
}
- $pluginNames = PluginManager::getInstance()->getLoadedPluginsName();
-
- self::$menus = array();
- foreach ($pluginNames as $pluginName) {
- $menu = $this->findMenuInPlugin($pluginName);
-
- if (!empty($menu)) {
- self::$menus[] = $menu;
- }
- }
+ self::$menus = PluginManager::getInstance()->findComponents('Menu', 'Piwik\\Plugin\\Menu');
return self::$menus;
}
- private function findMenuInPlugin($pluginName)
- {
- $menuFile = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName . '/Menu.php';
-
- if (!file_exists($menuFile)) {
- return;
- }
-
- $klassName = sprintf('Piwik\\Plugins\\%s\\Menu', $pluginName);
-
- if (!class_exists($klassName)) {
- return;
- }
-
- if (!is_subclass_of($klassName, 'Piwik\\Plugin\\Menu')) {
- Log::warning(sprintf('Cannot use menu for plugin %s, class %s does not extend Piwik\Plugin\Menu', $pluginName, $klassName));
- return;
- }
-
- return new $klassName;
- }
-
/**
* Adds a new entry to the menu.
*