1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Creates menu navigation bars. |
5
|
|
|
*/ |
6
|
|
|
class AbstractMenu { |
7
|
|
|
|
8
|
|
|
public static function headquarters() { |
9
|
|
|
global $var, $template; |
10
|
|
|
|
11
|
|
|
$links = []; |
12
|
|
|
$location = SmrLocation::getLocation($var['LocationID']); |
13
|
|
|
if ($location->isHQ()) { |
14
|
|
|
$links[] = ['government.php', 'Government']; |
15
|
|
|
$links[] = ['military_payment_claim.php', 'Claim Military Payment']; |
16
|
|
|
} elseif ($location->isUG()) { |
17
|
|
|
$links[] = ['underground.php', 'Underground']; |
18
|
|
|
} else { |
19
|
|
|
throw new Exception("Location is not HQ or UG: " . $location->getName()); |
20
|
|
|
} |
21
|
|
|
$links[] = ['bounty_claim.php', 'Claim Bounty']; |
22
|
|
|
$links[] = ['bounty_place.php', 'Place Bounty']; |
23
|
|
|
|
24
|
|
|
$menuItems = []; |
25
|
|
|
$container = create_container('skeleton.php'); |
26
|
|
|
$container['LocationID'] = $var['LocationID']; |
27
|
|
|
foreach ($links as $link) { |
28
|
|
|
$container['body'] = $link[0]; |
29
|
|
|
$menuItems[] = [ |
30
|
|
|
'Link' => SmrSession::getNewHREF($container), |
31
|
|
|
'Text' => $link[1], |
32
|
|
|
]; |
33
|
|
|
} |
34
|
|
|
$template->assign('MenuItems', $menuItems); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public static function planet_list($alliance_id, $selected_index) { |
38
|
|
|
global $template; |
39
|
|
|
|
40
|
|
|
$menuItems = array(); |
41
|
|
|
$menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Defense'); |
42
|
|
|
$menuItems[] = array('Link'=>Globals::getPlanetListFinancialHREF($alliance_id), 'Text'=>'Financial'); |
43
|
|
|
// make the selected index bold |
44
|
|
|
$boldItem =& $menuItems[$selected_index]['Text']; |
45
|
|
|
$boldItem = '<span class="bold">' . $boldItem . '</span>'; |
46
|
|
|
$template->assign('MenuItems', $menuItems); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public static function alliance($alliance_id = null, $alliance_leader_id = FALSE) { |
|
|
|
|
50
|
|
|
global $player, $template, $db; |
51
|
|
|
|
52
|
|
|
if ($alliance_id) { |
53
|
|
|
$in_alliance = ($alliance_id == $player->getAllianceID()); |
54
|
|
|
} else { |
55
|
|
|
$in_alliance = $player->hasAlliance(); |
56
|
|
|
} |
57
|
|
|
if (!$in_alliance) { |
58
|
|
|
$db->query('SELECT mb_read, mod_read, planet_land FROM alliance_treaties |
59
|
|
|
WHERE (alliance_id_1 = ' . $db->escapeNumber($alliance_id) . ' OR alliance_id_1 = ' . $db->escapeNumber($player->getAllianceID()) . ') |
60
|
|
|
AND (alliance_id_2 = ' . $db->escapeNumber($alliance_id) . ' OR alliance_id_2 = ' . $db->escapeNumber($player->getAllianceID()) . ') |
61
|
|
|
AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
62
|
|
|
AND (mb_read = 1 OR mod_read = 1 OR planet_land = 1) AND official = \'TRUE\''); |
63
|
|
|
if ($db->nextRecord()) { |
64
|
|
|
$mbRead = $db->getBoolean('mb_read'); |
65
|
|
|
$modRead = $db->getBoolean('mod_read'); |
66
|
|
|
$planetLand = $db->getBoolean('planet_land'); |
67
|
|
|
} else { |
68
|
|
|
$mbRead = FALSE; |
69
|
|
|
$modRead = FALSE; |
70
|
|
|
$planetLand = FALSE; |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
$role_id = $player->getAllianceRole($alliance_id); |
75
|
|
|
$db->query('SELECT send_alliance_msg FROM alliance_has_roles WHERE alliance_id = ' . $db->escapeNumber($alliance_id) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND role_id = ' . $db->escapeNumber($role_id)); |
76
|
|
|
if ($db->nextRecord()) { |
77
|
|
|
$send_alliance_msg = $db->getBoolean('send_alliance_msg'); |
78
|
|
|
} else { |
79
|
|
|
$send_alliance_msg = false; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
$menuItems = array(); |
83
|
|
|
if ($in_alliance || in_array($player->getAccountID(), Globals::getHiddenPlayers()) || $modRead) { |
|
|
|
|
84
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceMotdHREF($alliance_id), 'Text'=>'Message of the Day'); |
85
|
|
|
} |
86
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceRosterHREF($alliance_id), 'Text'=>'Roster'); |
87
|
|
|
if ($send_alliance_msg || in_array($player->getAccountID(), Globals::getHiddenPlayers())) { |
88
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceMessageHREF($alliance_id), 'Text'=>'Send Message'); |
89
|
|
|
} |
90
|
|
|
if ($in_alliance || in_array($player->getAccountID(), Globals::getHiddenPlayers()) || $mbRead) { |
|
|
|
|
91
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceMessageBoardHREF($alliance_id), 'Text'=>'Message Board'); |
92
|
|
|
} |
93
|
|
|
if ($in_alliance || in_array($player->getAccountID(), Globals::getHiddenPlayers()) || $planetLand) { |
|
|
|
|
94
|
|
|
$menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Planets'); |
95
|
|
|
} |
96
|
|
|
if ($in_alliance || in_array($player->getAccountID(), Globals::getHiddenPlayers())) { |
97
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceForcesHREF($alliance_id), 'Text'=>'Forces'); |
98
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceOptionsHREF($alliance_id), 'Text'=>'Options'); |
99
|
|
|
} |
100
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceListHREF(), 'Text'=>'List Alliances'); |
101
|
|
|
$menuItems[] = array('Link'=>Globals::getAllianceNewsHREF($alliance_id ? $alliance_id : $player->getAllianceID()), 'Text'=>'View News'); |
102
|
|
|
|
103
|
|
|
$template->assign('MenuItems', $menuItems); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public static function galactic_post() { |
107
|
|
|
global $template, $player; |
108
|
|
|
$menuItems = array(); |
109
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('galactic_post_current.php')), 'Text'=>'Current Edition'); |
110
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'galactic_post_past.php')), 'Text'=>'Past Editions'); |
111
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'galactic_post_write_article.php')), 'Text'=>'Write an article'); |
112
|
|
|
if ($player->isGPEditor()) { |
113
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'galactic_post.php')), 'Text'=>'Editor Options'); |
114
|
|
|
} |
115
|
|
|
$template->assign('MenuItems', $menuItems); |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public static function history_games($selected_index) { |
119
|
|
|
global $template, $var; |
120
|
|
|
$menuItems = []; |
121
|
|
|
$container = create_container('skeleton.php', 'history_games.php'); |
122
|
|
|
$container['HistoryDatabase'] = $var['HistoryDatabase']; |
123
|
|
|
$container['view_game_id'] = $var['view_game_id']; |
124
|
|
|
$container['game_name'] = $var['game_name']; |
125
|
|
|
$menuItems[] = ['Link' => SmrSession::getNewHREF($container), |
126
|
|
|
'Text' => 'Game Details']; |
127
|
|
|
$container['body'] = 'history_games_detail.php'; |
128
|
|
|
$menuItems[] = ['Link' => SmrSession::getNewHREF($container), |
129
|
|
|
'Text' => 'Extended Stats']; |
130
|
|
|
$container['body'] = 'history_games_hof.php'; |
131
|
|
|
$menuItems[] = ['Link' => SmrSession::getNewHREF($container), |
132
|
|
|
'Text' => 'Hall of Fame']; |
133
|
|
|
$container['body'] = 'history_games_news.php'; |
134
|
|
|
$menuItems[] = ['Link' => SmrSession::getNewHREF($container), |
135
|
|
|
'Text' => 'Game News']; |
136
|
|
|
// make the selected index bold |
137
|
|
|
$boldItem =& $menuItems[$selected_index]['Text']; |
138
|
|
|
$boldItem = '<b>' . $boldItem . '</b>'; |
139
|
|
|
$template->assign('MenuItems', $menuItems); |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
public static function messages() { |
143
|
|
|
global $player, $template; |
144
|
|
|
$menuItems = array(); |
145
|
|
|
$menuItems[] = array('Link'=>Globals::getViewMessagesHREF(), 'Text'=>'View Messages'); |
146
|
|
|
$menuItems[] = array('Link'=>Globals::getSendGlobalMessageHREF(), 'Text'=>'Send Global Message'); |
147
|
|
|
if ($player->isOnCouncil()) { |
148
|
|
|
$menuItems[] = array('Link'=>Globals::getSendCouncilMessageHREF($player->getRaceID()), 'Text'=>'Send Council Message'); |
149
|
|
|
} |
150
|
|
|
$menuItems[] = array('Link'=>Globals::getManageBlacklistHREF(), 'Text'=>'Manage Blacklist'); |
151
|
|
|
|
152
|
|
|
$template->assign('MenuItems', $menuItems); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
public static function combat_log() { |
156
|
|
|
global $template; |
157
|
|
|
|
158
|
|
|
$container = create_container('skeleton.php', 'combat_log_list.php'); |
159
|
|
|
$menuItems = array(); |
160
|
|
|
|
161
|
|
|
$container['action'] = COMBAT_LOG_PERSONAL; |
162
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Personal'); |
163
|
|
|
$container['action'] = COMBAT_LOG_ALLIANCE; |
164
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Alliance'); |
165
|
|
|
$container['action'] = COMBAT_LOG_FORCE; |
166
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Force'); |
167
|
|
|
$container['action'] = COMBAT_LOG_PORT; |
168
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Port'); |
169
|
|
|
$container['action'] = COMBAT_LOG_PLANET; |
170
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Planet'); |
171
|
|
|
$container['action'] = COMBAT_LOG_SAVED; |
172
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF($container), 'Text'=>'Saved'); |
173
|
|
|
|
174
|
|
|
$template->assign('MenuItems', $menuItems); |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
public static function trader() { |
178
|
|
|
global $player, $template; |
179
|
|
|
$template->assign('MenuItems', array( |
180
|
|
|
array('Link'=>Globals::getTraderStatusHREF(), 'Text'=>'Trader Status'), |
181
|
|
|
array('Link'=>Globals::getPlanetListHREF($player->getAllianceID()), 'Text'=>'Planets'), |
182
|
|
|
array('Link'=>Globals::getAllianceHREF($player->getAllianceID()), 'Text'=>'Alliance'), |
183
|
|
|
array('Link'=>Globals::getCouncilHREF(), 'Text'=>'Politics'), |
184
|
|
|
array('Link'=>Globals::getTraderRelationsHREF(), 'Text'=>'Relations'), |
185
|
|
|
array('Link'=>Globals::getTraderBountiesHREF(), 'Text'=>'Bounties'))); |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
public static function planet($planet) { |
189
|
|
|
global $template; |
190
|
|
|
|
191
|
|
|
$menu_array = array(); |
192
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetMainHREF(), 'Text'=>'Planet Main'); |
193
|
|
|
if ($planet->hasMenuOption('CONSTRUCTION')) { |
194
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetConstructionHREF(), 'Text'=>'Construction'); |
195
|
|
|
} |
196
|
|
|
if ($planet->hasMenuOption('DEFENSE')) { |
197
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetDefensesHREF(), 'Text'=>'Defense'); |
198
|
|
|
} |
199
|
|
|
if ($planet->hasMenuOption('OWNERSHIP')) { |
200
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetOwnershipHREF(), 'Text'=>'Ownership'); |
201
|
|
|
} |
202
|
|
|
if ($planet->hasMenuOption('STOCKPILE')) { |
203
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetStockpileHREF(), 'Text'=>'Stockpile'); |
204
|
|
|
} |
205
|
|
|
if ($planet->hasMenuOption('FINANCE')) { |
206
|
|
|
$menu_array[] = array('Link'=>Globals::getPlanetFinancesHREF(), 'Text'=>'Financial'); |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
$template->assign('MenuItems', $menu_array); |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/* |
213
|
|
|
* $active_level1 - the id of the active menu on the first level |
214
|
|
|
* $active_level1 - the id of the active menu on the second level |
215
|
|
|
*/ |
216
|
|
|
public static function rankings($active_level1 = 0, $active_level2 = 0) { |
217
|
|
|
|
218
|
|
|
$menu = array(); |
219
|
|
|
|
220
|
|
|
// player rankings |
221
|
|
|
$menu_item = array(); |
222
|
|
|
$menu_item['entry'] = create_link(create_container('skeleton.php', 'rankings_player_experience.php'), 'Player Rankings', 'nav'); |
223
|
|
|
|
224
|
|
|
$menu_subitem = array(); |
225
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_player_experience.php'), 'Experience', 'nav'); |
226
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_player_profit.php'), 'Profit', 'nav'); |
227
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_player_kills.php'), 'Kills', 'nav'); |
228
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_player_death.php'), 'Deaths', 'nav'); |
229
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_player_assists.php'), 'Assists', 'nav'); |
230
|
|
|
|
231
|
|
|
$menu_item['submenu'] = $menu_subitem; |
232
|
|
|
|
233
|
|
|
$menu[] = $menu_item; |
234
|
|
|
|
235
|
|
|
// alliance rankings |
236
|
|
|
$menu_item = array(); |
237
|
|
|
$menu_item['entry'] = create_link(create_container('skeleton.php', 'rankings_alliance_experience.php'), 'Alliance Rankings', 'nav'); |
238
|
|
|
|
239
|
|
|
$menu_subitem = array(); |
240
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_alliance_experience.php'), 'Experience', 'nav'); |
241
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_alliance_profit.php'), 'Profit', 'nav'); |
242
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_alliance_kills.php'), 'Kills', 'nav'); |
243
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_alliance_death.php'), 'Deaths', 'nav'); |
244
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_alliance_vs_alliance.php'), 'Versus', 'nav'); |
245
|
|
|
|
246
|
|
|
$menu_item['submenu'] = $menu_subitem; |
247
|
|
|
|
248
|
|
|
$menu[] = $menu_item; |
249
|
|
|
|
250
|
|
|
// racial rankings |
251
|
|
|
$menu_item = array(); |
252
|
|
|
$menu_item['entry'] = create_link(create_container('skeleton.php', 'rankings_race.php'), 'Racial Standings', 'nav'); |
253
|
|
|
|
254
|
|
|
$menu_subitem = array(); |
255
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_race.php'), 'Experience', 'nav'); |
256
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_race_kills.php'), 'Kills', 'nav'); |
257
|
|
|
$menu_subitem[] = create_link(create_container('skeleton.php', 'rankings_race_death.php'), 'Deaths', 'nav'); |
258
|
|
|
|
259
|
|
|
$menu_item['submenu'] = $menu_subitem; |
260
|
|
|
|
261
|
|
|
$menu[] = $menu_item; |
262
|
|
|
|
263
|
|
|
// sector rankings |
264
|
|
|
$menu_item = array(); |
265
|
|
|
$menu_item['entry'] = create_link(create_container('skeleton.php', 'rankings_sector_kill.php'), 'Sector Kills', 'nav'); |
266
|
|
|
$menu[] = $menu_item; |
267
|
|
|
|
268
|
|
|
create_sub_menu($menu, $active_level1, $active_level2); |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
public static function bank() { |
272
|
|
|
global $player, $template; |
273
|
|
|
|
274
|
|
|
$links = []; |
275
|
|
|
$links[] = ['bank_personal.php', 'Personal Account']; |
276
|
|
|
if ($player->hasAlliance()) { |
277
|
|
|
$links[] = ['bank_alliance.php', 'Alliance Account']; |
278
|
|
|
} |
279
|
|
|
$links[] = ['bank_anon.php', 'Anonymous Account']; |
280
|
|
|
|
281
|
|
|
$menuItems = []; |
282
|
|
|
$container = create_container('skeleton.php'); |
283
|
|
|
foreach ($links as $link) { |
284
|
|
|
$container['body'] = $link[0]; |
285
|
|
|
$menuItems[] = [ |
286
|
|
|
'Link' => SmrSession::getNewHREF($container), |
287
|
|
|
'Text' => $link[1], |
288
|
|
|
]; |
289
|
|
|
} |
290
|
|
|
$template->assign('MenuItems', $menuItems); |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
public static function council($race_id) { |
294
|
|
|
global $player, $template; |
295
|
|
|
|
296
|
|
|
$container = create_container('skeleton.php', 'council_list.php'); |
297
|
|
|
$menu_items = []; |
298
|
|
|
$menu_items[] = [ |
299
|
|
|
'Link' => SmrSession::getNewHREF($container), |
300
|
|
|
'Text' => 'View Council', |
301
|
|
|
]; |
302
|
|
|
|
303
|
|
|
$container = create_container('skeleton.php'); |
304
|
|
|
$container['body'] = 'council_politics.php'; |
305
|
|
|
$container['race_id'] = $race_id; |
306
|
|
|
$menu_items[] = [ |
307
|
|
|
'Link' => SmrSession::getNewHREF($container), |
308
|
|
|
'Text' => 'Political Status', |
309
|
|
|
]; |
310
|
|
|
|
311
|
|
|
$container['body'] = 'council_send_message.php'; |
312
|
|
|
$container['race_id'] = $race_id; |
313
|
|
|
$menu_items[] = [ |
314
|
|
|
'Link' => SmrSession::getNewHREF($container), |
315
|
|
|
'Text' => 'Send Message', |
316
|
|
|
]; |
317
|
|
|
|
318
|
|
|
if ($player->getRaceID() == $race_id) { |
319
|
|
|
if ($player->isOnCouncil()) { |
320
|
|
|
$container = create_container('skeleton.php', 'council_vote.php'); |
321
|
|
|
$menu_items[] = [ |
322
|
|
|
'Link' => SmrSession::getNewHREF($container), |
323
|
|
|
'Text' => 'Voting Center', |
324
|
|
|
]; |
325
|
|
|
} |
326
|
|
|
if ($player->isPresident()) { |
327
|
|
|
$container = create_container('skeleton.php', 'council_embassy.php'); |
328
|
|
|
$menu_items[] = [ |
329
|
|
|
'Link' => SmrSession::getNewHREF($container), |
330
|
|
|
'Text' => 'Embassy', |
331
|
|
|
]; |
332
|
|
|
} |
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
$template->assign('MenuItems', $menu_items); |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
public static function bar() { |
339
|
|
|
global $template; |
340
|
|
|
$template->assign('MenuItems', array( |
341
|
|
|
array('Link'=>Globals::getBarMainHREF(), 'Text'=>'Bar Main'), |
342
|
|
|
array('Link'=>Globals::getBarLottoPlayHREF(), 'Text'=>'Lotto'), |
343
|
|
|
array('Link'=>Globals::getBarBlackjackHREF(), 'Text'=>'BlackJack'))); |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
public static function news(Template $template) { |
347
|
|
|
global $var; |
348
|
|
|
$menuItems = array(); |
349
|
|
|
if (SmrSession::getGameID() == $var['GameID']) { |
350
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'news_read_current.php', array('GameID'=>$var['GameID']))), 'Text'=>'Read Current News'); |
351
|
|
|
} |
352
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'news_read.php', array('GameID'=>$var['GameID']))), 'Text'=>'Read Latest News'); |
353
|
|
|
$menuItems[] = array('Link'=>SmrSession::getNewHREF(create_container('skeleton.php', 'news_read_advanced.php', array('GameID'=>$var['GameID']))), 'Text'=>'Advanced News'); |
354
|
|
|
|
355
|
|
|
$template->assign('MenuItems', $menuItems); |
356
|
|
|
} |
357
|
|
|
|
358
|
|
|
public static function navigation(Template $template, AbstractSmrPlayer $player) { |
359
|
|
|
$menuItems = array(); |
360
|
|
|
$menuItems[] = array('Link'=>Globals::getPlotCourseHREF(), 'Text'=>'Plot A Course'); |
361
|
|
|
if (!$player->isLandedOnPlanet()) { |
362
|
|
|
$menuItems[] = array('Link'=>Globals::getLocalMapHREF(), 'Text'=>'Local Map'); |
363
|
|
|
} |
364
|
|
|
$menuItems[] = array('Link'=>'map_galaxy.php" target="gal_map', 'Text'=>'Galaxy Map'); |
365
|
|
|
$template->assign('MenuItems', $menuItems); |
366
|
|
|
} |
367
|
|
|
|
368
|
|
|
} |
369
|
|
|
|
370
|
|
|
function create_sub_menu($menu, $active_level1, $active_level2) { |
371
|
|
|
global $template; |
372
|
|
|
$return = ('<table class="bar1">'); |
373
|
|
|
$return .= ('<tr>'); |
374
|
|
|
$return .= ('<td>'); |
375
|
|
|
$return .= ('<table class="fullwidth">'); |
376
|
|
|
$return .= ('<tr class="bar1">'); |
377
|
|
|
$return .= ('<td>'); |
378
|
|
|
|
379
|
|
|
$return .= ('<table class="center">'); |
380
|
|
|
$return .= ('<tr>'); |
381
|
|
|
foreach ($menu as $number => $entry) { |
382
|
|
|
// insert spacer |
383
|
|
|
if ($number > 0) { |
384
|
|
|
$return .= ('<td> | </td>'); |
385
|
|
|
} |
386
|
|
|
|
387
|
|
|
// if this is the active entry we mark it |
388
|
|
|
if ($number == $active_level1) { |
389
|
|
|
$active = ' class="bold"'; |
390
|
|
|
} else { |
391
|
|
|
$active = ''; |
392
|
|
|
} |
393
|
|
|
|
394
|
|
|
// echo entry itself |
395
|
|
|
$return .= ('<td ' . $active . '> ' . $entry['entry'] . '</td>'); |
396
|
|
|
|
397
|
|
|
} |
398
|
|
|
$return .= ('</tr>'); |
399
|
|
|
|
400
|
|
|
$return .= ('<tr>'); |
401
|
|
|
foreach ($menu as $number => $entry) { |
402
|
|
|
// if this entry has a submenu and is the active one |
403
|
|
|
if (isset($entry['submenu']) && $number == $active_level1) { |
404
|
|
|
$return .= ('<td><small>'); |
405
|
|
|
foreach ($entry['submenu'] as $sub_number => $sub_entry) { |
406
|
|
|
if ($sub_number > 0) { |
407
|
|
|
$return .= (' | '); |
408
|
|
|
} |
409
|
|
|
|
410
|
|
|
if ($sub_number == $active_level2) { |
411
|
|
|
$return .= ('<span class="bold">' . $sub_entry . '</span>'); |
412
|
|
|
} else { |
413
|
|
|
$return .= ($sub_entry); |
414
|
|
|
} |
415
|
|
|
} |
416
|
|
|
$return .= ('</small></td>'); |
417
|
|
|
} else { |
418
|
|
|
// if it's not the first entry we have to put |
419
|
|
|
// additional empty cell for the spacer |
420
|
|
|
//if ($number > 0) |
421
|
|
|
//echo ('<td> <td>'); |
422
|
|
|
|
423
|
|
|
// emppty cell (no submenu) |
424
|
|
|
$return .= ('<td> <td>'); |
425
|
|
|
} |
426
|
|
|
} |
427
|
|
|
$return .= ('</tr>'); |
428
|
|
|
|
429
|
|
|
$return .= ('</table>'); |
430
|
|
|
|
431
|
|
|
$return .= ('</td>'); |
432
|
|
|
$return .= ('</tr>'); |
433
|
|
|
$return .= ('</table>'); |
434
|
|
|
$return .= ('</td>'); |
435
|
|
|
$return .= ('</tr>'); |
436
|
|
|
$return .= ('</table>'); |
437
|
|
|
$template->unassign('MenuItems'); |
438
|
|
|
$template->assign('SubMenuBar', $return); |
439
|
|
|
} |
440
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.