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
diff options
context:
space:
mode:
authorPeter Zhang <peter@innocraft.com>2022-11-02 23:00:54 +0300
committerGitHub <noreply@github.com>2022-11-02 23:00:54 +0300
commit69ac1b589d5e798daeb04b2df97dcc956ead396c (patch)
treebbe3ee730ad1efeb381846844f1b332bc5ce939c /core/Menu/MenuAbstract.php
parent466840c33205c7e8393d583d24a92ac314f40913 (diff)
add help link vue componet (#19922)
* add help link vue add help link vue * built vue files * update menu when _help define, show help icon update menu when _help define, show help icon * add help key add help key * add hide help message add hide help message * update type string from null to empty update type string from null to empty * fix build build fix build build * fix vue build error fix vue build error * fix vue build fix vue build * fix vue build fix vue build * built vue files Co-authored-by: peterhashair <peterhashair@users.noreply.github.com>
Diffstat (limited to 'core/Menu/MenuAbstract.php')
-rw-r--r--core/Menu/MenuAbstract.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index 5a276dce2e..9708669d09 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -99,10 +99,11 @@ abstract class MenuAbstract extends Singleton
* @param bool|string $icon An icon classname, such as "icon-add". Only supported by admin menu
* @param bool|string $onclick Will execute the on click handler instead of executing the link. Only supported by admin menu.
* @param string $attribute Will add this string as a link attribute.
+ * @param bool|string $help Will display a help icon that will pop a notification with help information.
* @since 2.7.0
* @api
*/
- public function addItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false, $attribute = false)
+ public function addItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false, $attribute = false, $help = false)
{
// make sure the idSite value used is numeric (hack-y fix for #3426)
if (isset($url['idSite']) && !is_numeric($url['idSite'])) {
@@ -118,7 +119,8 @@ abstract class MenuAbstract extends Singleton
$tooltip,
$icon,
$onclick,
- $attribute
+ $attribute,
+ $help
);
}
@@ -146,7 +148,7 @@ abstract class MenuAbstract extends Singleton
* @param int $order
* @param bool|string $tooltip Tooltip to display.
*/
- private function buildMenuItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false, $attribute = false)
+ private function buildMenuItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false, $icon = false, $onclick = false, $attribute = false, $help = false)
{
if (!isset($this->menu[$menuName])) {
$this->menu[$menuName] = array(
@@ -169,6 +171,8 @@ abstract class MenuAbstract extends Singleton
if (!empty($onclick)) {
$this->menu[$menuName]['_onclick'] = $onclick;
}
+ $this->menu[$menuName]['_help'] = $help ?: '';
+
}
if (!empty($subMenuName)) {
$this->menu[$menuName][$subMenuName]['_url'] = $url;
@@ -178,6 +182,7 @@ abstract class MenuAbstract extends Singleton
$this->menu[$menuName][$subMenuName]['_attribute'] = $attribute;
$this->menu[$menuName][$subMenuName]['_icon'] = $icon;
$this->menu[$menuName][$subMenuName]['_onclick'] = $onclick;
+ $this->menu[$menuName][$subMenuName]['_help'] = $help ?: '';
$this->menu[$menuName]['_hasSubmenu'] = true;
if (!array_key_exists('_tooltip', $this->menu[$menuName])) {
@@ -192,7 +197,8 @@ abstract class MenuAbstract extends Singleton
private function buildMenu()
{
foreach ($this->menuEntries as $menuEntry) {
- $this->buildMenuItem($menuEntry[0], $menuEntry[1], $menuEntry[2], $menuEntry[3], $menuEntry[4], $menuEntry[5], $menuEntry[6], $menuEntry[7]);
+ $this->buildMenuItem($menuEntry[0], $menuEntry[1], $menuEntry[2], $menuEntry[3], $menuEntry[4],
+ $menuEntry[5], $menuEntry[6], $menuEntry[7], $menuEntry[8]);
}
}