-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.php
More file actions
30 lines (25 loc) · 917 Bytes
/
Menu.php
File metadata and controls
30 lines (25 loc) · 917 Bytes
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
<?php
/**
* Matomo - free/libre analytics platform
*
* @link http://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\CustomVariablesExtended;
use Piwik\Common;
use Piwik\Menu\MenuAdmin;
use Piwik\Piwik;
use Piwik\Plugins\UsersManager\UserPreferences;
class Menu extends \Piwik\Plugin\Menu {
public function configureAdminMenu(MenuAdmin $menu): void {
$userPreferences = new UserPreferences();
$default = (int) $userPreferences->getDefaultWebsiteId();
/** @phpstan-ignore argument.type */
$idSite = Common::getRequestVar('idSite', $default, 'int');
$idSite = is_numeric($idSite) ? (int) $idSite : $default;
if (Piwik::isUserHasAdminAccess($idSite)) {
$menu->addDiagnosticItem('CustomVariablesExtended_CustomVariables', $this->urlForAction('manage'), $orderId = 21);
}
}
}