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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
<?
require_once('session.php');
$skin_info = $freeside->skin_info( array(
'session_id' => $_COOKIE['session_id'],
) );
if ( isset($skin_info['error']) && $skin_info['error'] ) {
$error = $skin_info['error'];
header('Location:index.php?error='. urlencode($error));
die();
}
extract($skin_info);
?>
<style type="text/css">
#menu_ul ul li {
display: inline;
width: 100%;
}
</style>
<ul id="menu_ul">
<?
$menu_array = explode("\n", $menu);
$submenu = array();
foreach ($menu_array AS $menu_item) {
if ( preg_match('/^\s*$/', $menu_item) ) {
print_menu($submenu, $current_menu);
$submenu = array();
} else {
$submenu[] = $menu_item;
}
}
print_menu($submenu, $current_menu);
function print_menu($submenu_array, $current_menu) {
if ( count($submenu_array) == 0 ) { return; }
$links = array();
$labels = array();
foreach ($submenu_array AS $submenu_item) {
$pieces = preg_split('/\s+/', $submenu_item, 2, PREG_SPLIT_NO_EMPTY);
$links[] = $pieces[0];
$labels[] = $pieces[1];
}
print_link($links[0], $labels[0], $current_menu, $links);
if ( count($links) > 1 ) {
if ( in_array( $current_menu, $links ) ) {
echo '<img src="images/dropdown_arrow_white.gif">';
} else {
echo '<img src="images/dropdown_arrow_white.gif" style="display:none;">';
echo '<img src="images/dropdown_arrow_grey.gif">';
}
}
array_shift($links);
array_shift($labels);
echo '</a>';
if ( count($links) > 0 ) {
echo '<ul>';
foreach ($links AS $link) {
$label = array_shift($labels);
print_link($link, $label, $current_menu, array($link) );
echo '</a></li>';
}
echo '</ul>';
}
echo '</li>';
}
function print_link($link, $label, $current_menu, $search_array) {
echo '<li><a href="'. $link. '"';
if ( in_array( $current_menu, $search_array ) ) {
echo ' class="current_menu"';
}
echo '>'. _($label);
}
?>
</ul>
<div style="clear:both;"></div>
<table cellpadding="0" cellspacing="0" border="0" style="min-width:666px">
<tr>
<td class="page">
|