-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMenu.php
42 lines (38 loc) · 1.39 KB
/
Menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* AOM - Piwik Advanced Online Marketing Plugin
*
* @author Daniel Stonies <[email protected]>
*/
namespace Piwik\Plugins\AOM;
use Piwik\Menu\MenuAdmin;
use Piwik\Piwik;
use Piwik\Plugins\AOM\Platforms\PlatformInterface;
class Menu extends \Piwik\Plugin\Menu
{
public function configureAdminMenu(MenuAdmin $menu)
{
if (Piwik::isUserHasSomeAdminAccess()) {
$menu->addSystemItem('AOM_Menu_Settings', $this->urlForAction('settings'), $orderId = 26);
}
// Platforms might add additional menu options
if (Piwik::isUserHasSomeAdminAccess()) {
foreach (AOM::getPlatforms() as $platformName) {
/** @var PlatformInterface $platform */
$platform = AOM::getPlatformInstance($platformName);
if ($platform->isActive()) {
foreach ($platform->getMenuAdminItems() as $menuAdminItem) {
$menu->addSystemItem(
$menuAdminItem['menuName'],
$this->urlForAction(
'platformAction',
array_merge(['platform' => $platformName], $menuAdminItem['params'])
),
$orderId = $menuAdminItem['orderId']
);
};
}
}
}
}
}