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 02:07:40 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-05-20 02:07:40 +0400
commit009a6f21177e8cb6366577d8f54024e896bb0d8e (patch)
tree70edeaf31d0b59acff6f22f47e1847349bc6728c /core/Menu
parent84a7e582a45a8c65b34035819a23c6e1b59794be (diff)
refs #5192 starting a little Menu refactoring
Diffstat (limited to 'core/Menu')
-rw-r--r--core/Menu/MenuAdmin.php11
-rw-r--r--core/Menu/MenuMain.php2
-rw-r--r--core/Menu/MenuTop.php6
3 files changed, 16 insertions, 3 deletions
diff --git a/core/Menu/MenuAdmin.php b/core/Menu/MenuAdmin.php
index ee985314db..b187d18eba 100644
--- a/core/Menu/MenuAdmin.php
+++ b/core/Menu/MenuAdmin.php
@@ -42,12 +42,18 @@ class MenuAdmin extends MenuAbstract
* current user. If false, the entry will not be added.
* @param int $order The order hint.
* @api
+ * @deprecated since version 2.3.0
*/
public static function addEntry($adminMenuName, $url, $displayedForCurrentUser = true, $order = 20)
{
self::getInstance()->add('General_Settings', $adminMenuName, $url, $displayedForCurrentUser, $order);
}
+ public function add($adminMenuName, $url, $displayedForCurrentUser = true, $order = 20)
+ {
+ parent::add('General_Settings', $adminMenuName, $url, $displayedForCurrentUser, $order);
+ }
+
/**
* Triggers the Menu.MenuAdmin.addItems hook and returns the admin menu.
*
@@ -78,7 +84,7 @@ class MenuAdmin extends MenuAbstract
* );
* }
*/
- Piwik::postEvent('Menu.Admin.addItems');
+ Piwik::postEvent('Menu.Admin.addItems', array($this));
}
return parent::getMenu();
}
@@ -106,6 +112,9 @@ class MenuAdmin extends MenuAbstract
return false;
}
+ /**
+ * @deprecated since version 2.3.0
+ */
public static function removeEntry($menuName, $subMenuName = false)
{
MenuAdmin::getInstance()->remove($menuName, $subMenuName);
diff --git a/core/Menu/MenuMain.php b/core/Menu/MenuMain.php
index 1900d0d28e..0421a33785 100644
--- a/core/Menu/MenuMain.php
+++ b/core/Menu/MenuMain.php
@@ -84,7 +84,7 @@ class MenuMain extends MenuAbstract
* );
* }
*/
- Piwik::postEvent('Menu.Reporting.addItems');
+ Piwik::postEvent('Menu.Reporting.addItems', array($this));
}
return parent::getMenu();
}
diff --git a/core/Menu/MenuTop.php b/core/Menu/MenuTop.php
index 98d639b467..dcec860ac4 100644
--- a/core/Menu/MenuTop.php
+++ b/core/Menu/MenuTop.php
@@ -46,6 +46,7 @@ class MenuTop extends MenuAbstract
* @param bool $isHTML Whether `$url` is an HTML string or a URL that will be rendered as a link.
* @param bool|string $tooltip Optional tooltip to display.
* @api
+ * @deprecated since version 2.3.0
*/
public static function addEntry($topMenuName, $url, $displayedForCurrentUser = true, $order = 10, $isHTML = false, $tooltip = false)
{
@@ -56,6 +57,9 @@ class MenuTop extends MenuAbstract
}
}
+ /**
+ * @deprecated since version 2.3.0
+ */
public static function removeEntry($menuName, $subMenuName = false)
{
MenuTop::getInstance()->remove($menuName, $subMenuName);
@@ -114,7 +118,7 @@ class MenuTop extends MenuAbstract
* );
* }
*/
- Piwik::postEvent('Menu.Top.addItems');
+ Piwik::postEvent('Menu.Top.addItems', array($this));
}
return parent::getMenu();
}