-
Notifications
You must be signed in to change notification settings - Fork 2
/
Menu.php
46 lines (42 loc) · 1.3 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
43
44
45
46
<?php
namespace Piwik\Plugins\WAIMatomoTheme;
use Piwik\Menu\MenuAdmin;
use Piwik\Menu\MenuTop;
use Piwik\Piwik;
use Piwik\Plugin\Menu as MatomoMenu;
/**
* WAI Portal menu provider.
*/
class Menu extends MatomoMenu
{
/**
* Configure analytics items menu.
*
* @param MenuTop $menu the menu reference
*/
public function configureTopMenu(MenuTop $menu)
{
// Intercept menu configuration to remove unwanted icons
$menu->remove('Tag Manager');
$menu->remove('General_Help');
$menu->remove('General_Logout');
if (!Piwik::isUserHasSomeWriteAccess()) {
$menu->remove('CoreAdminHome_Administration');
}
}
/**
* Configure analytics items menu.
*
* @param MenuTop $menu the menu reference
*/
public function configureAdminMenu(MenuAdmin $menuAdmin)
{
// Intercept menu configuration to remove unwanted items
if (!Piwik::hasUserSuperUserAccess()) {
$menuAdmin->remove('UsersManager_MenuPersonal', 'General_Settings');
$menuAdmin->remove('UsersManager_MenuPersonal', 'General_Security');
$menuAdmin->remove('CorePluginsAdmin_MenuPlatform');
$menuAdmin->remove('CoreAdminHome_MenuMeasurables', 'CoreAdminHome_TrackingCode');
}
}
}