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-05-20 10:10:27 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-05-20 10:10:27 +0400
commit307ec31f2cfebd9c8bf9caba575e2864d42c8597 (patch)
tree2d6120c412b272344d204e9947fb3859bb7b3aa7 /core/Menu
parent45ae10e999baf0dfa066e5daae00bca824a68191 (diff)
refs #5192 added generator for menus, updated more plugins to use menu class, fixed some bugs, improved design, fixed tests, ...
Diffstat (limited to 'core/Menu')
-rw-r--r--core/Menu/MenuAbstract.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index 02d76b2ce5..ebdf22b5fd 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -9,6 +9,7 @@
namespace Piwik\Menu;
use Piwik\Common;
+use Piwik\Log;
use Piwik\Plugins\SitesManager\API;
use Piwik\Singleton;
use Piwik\Plugin\Manager as PluginManager;
@@ -84,7 +85,12 @@ abstract class MenuAbstract extends Singleton
$klassName = sprintf('Piwik\\Plugins\\%s\\Menu', $pluginName);
- if (!class_exists($klassName) || !is_subclass_of($klassName, 'Piwik\\Plugin\\Menu')) {
+ 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;
}
@@ -125,6 +131,13 @@ abstract class MenuAbstract extends Singleton
);
}
+ /**
+ * Removes an existing entry from the menu.
+ *
+ * @param string $menuName The menu's category name. Can be a translation token.
+ * @param bool|string $subMenuName The menu item's name. Can be a translation token.
+ * @api
+ */
public function remove($menuName, $subMenuName = false)
{
$this->menuEntriesToRemove[] = array(
@@ -157,6 +170,7 @@ abstract class MenuAbstract extends Singleton
$this->menu[$menuName][$subMenuName]['_url'] = $url;
$this->menu[$menuName][$subMenuName]['_order'] = $order;
$this->menu[$menuName][$subMenuName]['_name'] = $subMenuName;
+ $this->menu[$menuName][$subMenuName]['_tooltip'] = $tooltip;
$this->menu[$menuName]['_hasSubmenu'] = true;
$this->menu[$menuName]['_tooltip'] = $tooltip;
}
@@ -179,6 +193,7 @@ abstract class MenuAbstract extends Singleton
* @param $subMenuOriginal
* @param $mainMenuRenamed
* @param $subMenuRenamed
+ * @api
*/
public function rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed)
{