blob: a36797f482c2c2b912458cb1e15d19f20452d87a (
plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<?php
static $mainMenu = array();
// we setup the main categories in a specific order
$mainMenu['Dashboard'] = null;
$mainMenu['General'] = null;
$mainMenu['Visitors'] = null;
$mainMenu['Actions'] = null;
$mainMenu['Referers'] = null;
$mainMenu['Live!'] = null;
function Piwik_GetMenu()
{
global $mainMenu;
foreach($mainMenu as $key => &$element)
{
if(is_null($element))
{
unset($mainMenu[$key]);
}
else
{
// we want to move some submenus in the first position
$priority = array('Overview','Evolution');
foreach($priority as $name)
{
if(isset($element[$name]))
{
$newElement = array($name => $element[$name]);
unset($element[$name]);
$element = $newElement + $element;
}
}
$element['_url'] = current($element);
}
}
return $mainMenu;
}
function Piwik_AddMenu( $mainMenuName, $subMenuName, $url )
{
global $mainMenu;
if(!isset($mainMenu[$mainMenuName]))
{
$mainMenu[$mainMenuName]['_url'] = $url;
}
if(!empty($subMenuName))
{
$mainMenu[$mainMenuName][$subMenuName] = $url;
}
}
function Piwik_RenameMenuEntry($mainMenuOriginal, $subMenuOriginal,
$mainMenuRenamed, $subMenuRenamed)
{
global $mainMenu;
$save = $mainMenu[$mainMenuOriginal][$subMenuOriginal];
unset($mainMenu[$mainMenuOriginal][$subMenuOriginal]);
$mainMenu[$mainMenuRenamed][$subMenuRenamed] = $save;
}
|