r2044 + fixed a typo
[racktables] / inc / navigation.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2/*
3*
4* This file implements generic navigation for RackTables.
5*
6*/
7
83dd1b15
DO
8$page = array();
9$tab = array();
83dd1b15
DO
10$trigger = array();
11$ophandler = array();
81bab70c 12$tabhandler = array();
83dd1b15 13
eebf9145 14$page['index']['title'] = 'Main page';
e673ee24
DO
15$page['index']['handler'] = 'renderIndex';
16
eebf9145 17$page['rackspace']['title'] = 'Rackspace';
e673ee24
DO
18$page['rackspace']['parent'] = 'index';
19$tab['rackspace']['default'] = 'Browse';
20$tab['rackspace']['history'] = 'History';
9b0cf84f
DO
21$tab['rackspace']['firstrow'] = 'Click me!';
22$trigger['rackspace']['firstrow'] = 'trigger_emptyRackspace';
8b6ffe9c
DO
23$tabhandler['rackspace']['default'] = 'renderRackspace';
24$tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
25$tabhandler['rackspace']['firstrow'] = 'renderFirstRowForm';
08b16bf5 26$tabextraclass['rackspace']['firstrow'] = 'attn';
e673ee24 27
eebf9145 28$page['objects']['title'] = 'Objects';
e673ee24
DO
29$page['objects']['parent'] = 'index';
30$tab['objects']['default'] = 'View';
216c84bb 31$tab['objects']['addmore'] = 'Add more';
7cc02fc1 32$tabhandler['objects']['default'] = 'renderObjectSpace';
216c84bb 33$tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
e673ee24 34
eebf9145 35$page['row']['title_handler'] = 'dynamic_title_row';
e673ee24 36$page['row']['bypass'] = 'row_id';
8b6ffe9c 37$page['row']['bypass_type'] = 'uint';
e673ee24
DO
38$page['row']['parent'] = 'rackspace';
39$tab['row']['default'] = 'View';
40$tab['row']['newrack'] = 'Add new rack';
eb6ea26f 41$tab['row']['tagroller'] = 'Tag roller';
8b6ffe9c
DO
42$tabhandler['row']['default'] = 'renderRow';
43$tabhandler['row']['newrack'] = 'renderNewRackForm';
2f32cc32 44$tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
eb6ea26f 45$ophandler['row']['tagroller']['rollTags'] = 'rollTags';
e673ee24 46
eebf9145 47$page['rack']['title_handler'] = 'dynamic_title_rack';
e673ee24 48$page['rack']['bypass'] = 'rack_id';
8b6ffe9c 49$page['rack']['bypass_type'] = 'uint';
e673ee24 50$page['rack']['parent'] = 'row';
41bd8c87
DO
51$page['rack']['tagloader'] = 'loadRackTags';
52$page['rack']['autotagloader'] = 'loadRackAutoTags';
e673ee24
DO
53$tab['rack']['default'] = 'View';
54$tab['rack']['edit'] = 'Properties';
55$tab['rack']['design'] = 'Design';
56$tab['rack']['problems'] = 'Problems';
41bd8c87 57$tab['rack']['tags'] = 'Tags';
8b6ffe9c
DO
58$tabhandler['rack']['default'] = 'renderRackPage';
59$tabhandler['rack']['edit'] = 'renderEditRackForm';
60$tabhandler['rack']['design'] = 'renderRackDesign';
61$tabhandler['rack']['problems'] = 'renderRackProblems';
41bd8c87
DO
62$tabhandler['rack']['tags'] = 'renderRackTags';
63$trigger['rack']['tags'] = 'trigger_tags';
82627005 64$ophandler['rack']['tags']['saveTags'] = 'saveRackTags';
e673ee24 65
eebf9145 66$page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
3aeb15f3 67$page['objgroup']['handler'] = 'renderObjectGroup';
e673ee24 68$page['objgroup']['bypass'] = 'group_id';
105cea6e 69$page['objgroup']['bypass_type'] = 'uint0';
e673ee24
DO
70$page['objgroup']['parent'] = 'objects';
71
eebf9145 72$page['object']['title_handler'] = 'dynamic_title_object';
e673ee24 73$page['object']['bypass'] = 'object_id';
3bebaebd 74$page['object']['bypass_type'] = 'uint';
e673ee24 75$page['object']['parent'] = 'objgroup';
2fb24351
DO
76$page['object']['tagloader'] = 'loadRackObjectTags';
77$page['object']['autotagloader'] = 'loadRackObjectAutoTags';
e673ee24
DO
78$tab['object']['default'] = 'View';
79$tab['object']['edit'] = 'Properties';
80$tab['object']['rackspace'] = 'Rackspace';
81$tab['object']['ports'] = 'Ports';
82$tab['object']['network'] = 'IPv4';
737f9ac1 83$tab['object']['portfwrd'] = 'NATv4';
46f92ff7 84$tab['object']['livevlans'] = 'Live VLANs';
9c67f713 85$tab['object']['snmpportfinder'] = 'SNMP port finder';
0dfaea8e 86$tab['object']['editrspvs'] = 'RS pools';
3ee1252b 87$tab['object']['lvsconfig'] = 'LVS configuration';
118e4c38 88$tab['object']['autoports'] = 'AutoPorts';
2fb24351 89$tab['object']['tags'] = 'Tags';
e45a78d7
DO
90$tabhandler['object']['default'] = 'renderRackObject';
91$tabhandler['object']['edit'] = 'renderEditObjectForm';
92$tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
93$tabhandler['object']['ports'] = 'renderPortsForObject';
94$tabhandler['object']['network'] = 'renderNetworkForObject';
eeb4a5d8 95$tabhandler['object']['portfwrd'] = 'renderNATv4ForObject';
46f92ff7 96$tabhandler['object']['livevlans'] = 'renderVLANMembership';
e45a78d7 97$tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
3ee1252b 98$tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
118e4c38 99$tabhandler['object']['autoports'] = 'renderAutoPortsForm';
2fb24351 100$tabhandler['object']['tags'] = 'renderObjectTags';
0dfaea8e 101$tabhandler['object']['editrspvs'] = 'renderObjectSLB';
08b16bf5
DO
102$tabextraclass['object']['snmpportfinder'] = 'attn';
103$tabextraclass['object']['autoports'] = 'attn';
6dbdc7c7
DO
104$trigger['object']['network'] = 'trigger_ipv4';
105$trigger['object']['portfwrd'] = 'trigger_natv4';
46f92ff7 106$trigger['object']['livevlans'] = 'trigger_livevlans';
9c67f713 107$trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
0dfaea8e 108$trigger['object']['editrspvs'] = 'trigger_natv4';
094bb33c 109$trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
118e4c38 110$trigger['object']['autoports'] = 'trigger_autoports';
91dbb8a3 111$trigger['object']['tags'] = 'trigger_tags';
e673ee24
DO
112$ophandler['object']['ports']['addPort'] = 'addPortForObject';
113$ophandler['object']['ports']['delPort'] = 'delPortFromObject';
114$ophandler['object']['ports']['editPort'] = 'editPortForObject';
115$ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
116$ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
117$ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
118$ophandler['object']['ports']['useup'] = 'useupPort';
b4c1ef87
DO
119$ophandler['object']['network']['updIPv4Allocation'] = 'updIPv4Allocation';
120$ophandler['object']['network']['addIPv4Allocation'] = 'addIPv4Allocation';
121$ophandler['object']['network']['delIPv4Allocation'] = 'delIPv4Allocation';
22bb04da
DO
122$ophandler['object']['edit']['clearSticker'] = 'clearSticker';
123$ophandler['object']['edit']['updateStickers'] = 'updateStickers';
124$ophandler['object']['edit']['update'] = 'updateObject';
e673ee24
DO
125$ophandler['object']['portfwrd']['forwardPorts'] = 'addPortForwarding';
126$ophandler['object']['portfwrd']['delPortForwarding'] = 'delPortForwarding';
127$ophandler['object']['portfwrd']['updPortForwarding'] = 'updPortForwarding';
46f92ff7 128$ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
f3f0161f 129$ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
82627005 130$ophandler['object']['tags']['saveTags'] = 'saveObjectTags';
0dfaea8e
DO
131$ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
132$ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
133$ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
46f92ff7 134$delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
e673ee24 135
eebf9145 136$page['ipv4space']['title'] = 'IPv4 space';
e673ee24
DO
137$page['ipv4space']['parent'] = 'index';
138$tab['ipv4space']['default'] = 'Browse';
0bcdc163 139$tab['ipv4space']['newrange'] = 'Manage';
8b6ffe9c
DO
140$tabhandler['ipv4space']['default'] = 'renderAddressspace';
141$tabhandler['ipv4space']['newrange'] = 'renderAddNewRange';
42023f03
DO
142$ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
143$ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
e673ee24 144
eebf9145 145$page['iprange']['title_handler'] = 'dynamic_title_iprange';
e673ee24
DO
146$page['iprange']['parent'] = 'ipv4space';
147$page['iprange']['bypass'] = 'id';
2fe5476a 148$page['iprange']['bypass_type'] = 'uint';
f9bc186f
DO
149$page['iprange']['autotagloader'] = 'loadIPv4PrefixAutoTags';
150$page['iprange']['tagloader'] = 'loadIPv4PrefixTags';
e673ee24
DO
151$tab['iprange']['default'] = 'Browse';
152$tab['iprange']['properties'] = 'Properties';
2fe5476a 153$tab['iprange']['liveptr'] = 'Live PTR';
2034d968 154$tab['iprange']['tags'] = 'Tags';
8b6ffe9c
DO
155$tabhandler['iprange']['default'] = 'renderIPRange';
156$tabhandler['iprange']['properties'] = 'renderIPRangeProperties';
2fe5476a 157$tabhandler['iprange']['liveptr'] = 'renderLivePTR';
2034d968
DO
158$tabhandler['iprange']['tags'] = 'renderIPv4PrefixTags';
159$trigger['iprange']['tags'] = 'trigger_tags';
e673ee24 160$ophandler['iprange']['properties']['editRange'] = 'editRange';
da958e52 161$ophandler['iprange']['liveptr']['importPTRData'] = 'importPTRData';
82627005 162$ophandler['iprange']['tags']['saveTags'] = 'saveIPv4PrefixTags';
e673ee24 163
eebf9145 164$page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
e673ee24
DO
165$page['ipaddress']['parent'] = 'iprange';
166$page['ipaddress']['bypass'] = 'ip';
1fbc9fd6 167$page['ipaddress']['bypass_type'] = 'inet4';
d817ba03 168$page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
e673ee24
DO
169$tab['ipaddress']['default'] = 'Browse';
170$tab['ipaddress']['properties'] = 'Properties';
171$tab['ipaddress']['assignment'] = 'Allocation';
7e13adfe 172$tab['ipaddress']['editrslist'] = '[SLB real servers]';
8b6ffe9c
DO
173$tabhandler['ipaddress']['default'] = 'renderIPAddress';
174$tabhandler['ipaddress']['properties'] = 'renderIPAddressProperties';
175$tabhandler['ipaddress']['assignment'] = 'renderIPAddressAssignment';
1fbc9fd6 176$tabhandler['ipaddress']['editrslist'] = 'dragon';
e673ee24 177$ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
b4c1ef87
DO
178$ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
179$ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
180$ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
e673ee24 181
f973f491
DO
182$page['ipv4slb']['title'] = 'IPv4 SLB';
183$page['ipv4slb']['parent'] = 'index';
184$page['ipv4slb']['handler'] = 'renderIPv4SLB';
185
a239e016
DO
186$page['ipv4vslist']['title'] = 'Virtual services';
187$page['ipv4vslist']['parent'] = 'ipv4slb';
188$tab['ipv4vslist']['default'] = 'View';
189$tab['ipv4vslist']['edit'] = 'Edit';
190$tabhandler['ipv4vslist']['default'] = 'renderVSList';
191$tabhandler['ipv4vslist']['edit'] = 'renderVSListEditForm';
192$ophandler['ipv4vslist']['edit']['add'] = 'addVService';
193$ophandler['ipv4vslist']['edit']['del'] = 'deleteVService';
194$ophandler['ipv4vslist']['edit']['upd'] = 'updateVService';
b3c50e6c 195
2bb798a3
DO
196$page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
197$page['ipv4vs']['parent'] = 'ipv4vslist';
49fb2686 198$page['ipv4vs']['bypass'] = 'vs_id';
2bb798a3
DO
199$page['ipv4vs']['bypass_type'] = 'uint';
200$page['ipv4vs']['tagloader'] = 'loadIPv4VSTags';
201$page['ipv4vs']['autotagloader'] = 'loadIPv4VSAutoTags';
202$tab['ipv4vs']['default'] = 'View';
c9890988 203$tab['ipv4vs']['edit'] = 'Edit';
49fb2686 204$tab['ipv4vs']['editlblist'] = 'Load balancers';
2bb798a3
DO
205$tab['ipv4vs']['tags'] = 'Tags';
206$tabhandler['ipv4vs']['default'] = 'renderVirtualService';
207$tabhandler['ipv4vs']['edit'] = 'renderEditVService';
49fb2686 208$tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
2bb798a3 209$tabhandler['ipv4vs']['tags'] = 'renderIPv4VSTags';
e02e1941 210$ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
2bb798a3 211$ophandler['ipv4vs']['tags']['saveTags'] = 'saveIPv4VSTags';
49fb2686
DO
212$ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
213$ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
214$ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
2bb798a3 215$trigger['ipv4vs']['tags'] = 'trigger_tags';
c9b4588f 216
ee437dab
DO
217$page['ipv4rsplist']['title'] = 'RS pools';
218$page['ipv4rsplist']['parent'] = 'ipv4slb';
219$tab['ipv4rsplist']['default'] = 'View';
220$tab['ipv4rsplist']['edit'] = 'Edit';
221$tabhandler['ipv4rsplist']['default'] = 'renderRSPoolList';
222$tabhandler['ipv4rsplist']['edit'] = 'editRSPools';
223$ophandler['ipv4rsplist']['edit']['add'] = 'addRSPool';
224$ophandler['ipv4rsplist']['edit']['del'] = 'deleteRSPool';
225$ophandler['ipv4rsplist']['edit']['upd'] = 'updateRSPool';
b3c50e6c 226
0e692350
DO
227$page['ipv4rsp']['title_handler'] = 'dynamic_title_rspool';
228$page['ipv4rsp']['parent'] = 'ipv4rsplist';
229$page['ipv4rsp']['bypass'] = 'pool_id';
230$page['ipv4rsp']['bypass_type'] = 'uint';
231$page['ipv4rsp']['tagloader'] = 'loadIPv4RSPoolTags';
232$page['ipv4rsp']['autotagloader'] = 'loadIPv4RSPoolAutoTags';
233$tab['ipv4rsp']['default'] = 'View';
ea5a3250 234$tab['ipv4rsp']['edit'] = 'Edit';
0e692350
DO
235$tab['ipv4rsp']['editlblist'] = 'Load Balancers';
236$tab['ipv4rsp']['editrslist'] = 'RS list';
237$tab['ipv4rsp']['rsinservice'] = 'RS in service';
238$tab['ipv4rsp']['tags'] = 'Tags';
239$trigger['ipv4rsp']['rsinservice'] = 'trigger_poolrscount';
240$trigger['ipv4rsp']['tags'] = 'trigger_tags';
241$tabhandler['ipv4rsp']['default'] = 'renderRSPool';
242$tabhandler['ipv4rsp']['edit'] = 'renderEditRSPool';
243$tabhandler['ipv4rsp']['editrslist'] = 'renderRSPoolServerForm';
244$tabhandler['ipv4rsp']['editlblist'] = 'renderRSPoolLBForm';
245$tabhandler['ipv4rsp']['rsinservice'] = 'renderRSPoolRSInServiceForm';
246$tabhandler['ipv4rsp']['tags'] = 'renderIPv4RSPoolTags';
247$ophandler['ipv4rsp']['editrslist']['addRS'] = 'addRealServer';
248$ophandler['ipv4rsp']['editrslist']['delRS'] = 'deleteRealServer';
249$ophandler['ipv4rsp']['editrslist']['updRS'] = 'updateRealServer';
250$ophandler['ipv4rsp']['editrslist']['addMany'] = 'addRealServers';
251$ophandler['ipv4rsp']['editlblist']['addLB'] = 'addLoadBalancer';
252$ophandler['ipv4rsp']['editlblist']['delLB'] = 'deleteLoadBalancer';
253$ophandler['ipv4rsp']['editlblist']['updLB'] = 'updateLoadBalancer';
254$ophandler['ipv4rsp']['rsinservice']['upd'] = 'updateRSInService';
255$ophandler['ipv4rsp']['tags']['saveTags'] = 'saveIPv4RSPoolTags';
ea5a3250 256$ophandler['ipv4rsp']['edit']['updIPv4RSP'] = 'updateRSPool';
71b8bda1 257
8253d9f0 258$page['rservers']['title'] = 'Real servers';
f973f491 259$page['rservers']['parent'] = 'ipv4slb';
8253d9f0 260$page['rservers']['handler'] = 'renderRealServerList';
b3c50e6c 261
4b0932b6 262$page['lbs']['title'] = 'Load balancers';
f973f491 263$page['lbs']['parent'] = 'ipv4slb';
4b0932b6 264$page['lbs']['handler'] = 'renderLBList';
b3c50e6c 265
eebf9145 266$page['search']['title_handler'] = 'dynamic_title_search';
3aeb15f3 267$page['search']['handler'] = 'renderSearchResults';
e673ee24
DO
268$page['search']['parent'] = 'index';
269$page['search']['bypass'] = 'q';
270
eebf9145 271$page['config']['title'] = 'Configuration';
3aeb15f3 272$page['config']['handler'] = 'renderConfigMainpage';
e673ee24
DO
273$page['config']['parent'] = 'index';
274
82627005
DO
275$page['userlist']['title'] = 'Users';
276$page['userlist']['parent'] = 'config';
277$tab['userlist']['default'] = 'View';
278$tab['userlist']['edit'] = 'Edit';
279$tabhandler['userlist']['default'] = 'renderUserList';
280$tabhandler['userlist']['edit'] = 'renderUserListEditor';
281$ophandler['userlist']['edit']['updateUser'] = 'updateUser';
282$ophandler['userlist']['edit']['createUser'] = 'createUser';
283$ophandler['userlist']['edit']['disableUser'] = 'disableUser';
284$ophandler['userlist']['edit']['enableUser'] = 'enableUser';
285
286$page['user']['title_handler'] = 'dynamic_title_user';
287$page['user']['parent'] = 'userlist';
288$page['user']['bypass'] = 'user_id';
289$page['user']['bypass_type'] = 'uint';
290$page['user']['tagloader'] = 'loadUserTags';
da958e52 291$page['user']['autotagloader'] = 'getUserAutoTags';
82627005 292$tab['user']['default'] = 'View';
82627005
DO
293$tab['user']['tags'] = 'Tags';
294$tabhandler['user']['default'] = 'renderUser';
82627005
DO
295$tabhandler['user']['tags'] = 'renderUserTags';
296$ophandler['user']['tags']['saveTags'] = 'saveUserTags';
e673ee24 297
eebf9145 298$page['perms']['title'] = 'Permissions';
e673ee24
DO
299$page['perms']['parent'] = 'config';
300$tab['perms']['default'] = 'View';
82627005
DO
301$tab['perms']['edit'] = 'Edit';
302$tabhandler['perms']['default'] = 'renderRackCodeViewer';
303$tabhandler['perms']['edit'] = 'renderRackCodeEditor';
304$ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
e673ee24 305
eebf9145 306$page['portmap']['title'] = 'Port compatibility map';
e673ee24
DO
307$page['portmap']['parent'] = 'config';
308$tab['portmap']['default'] = 'View';
309$tab['portmap']['edit'] = 'Change';
17c32f4c
DO
310$tabhandler['portmap']['default'] = 'renderPortMapViewer';
311$tabhandler['portmap']['edit'] = 'renderPortMapEditor';
e673ee24
DO
312$ophandler['portmap']['edit']['save'] = 'savePortMap';
313
eebf9145 314$page['attrs']['title'] = 'Attributes';
e673ee24
DO
315$page['attrs']['parent'] = 'config';
316$tab['attrs']['default'] = 'View';
317$tab['attrs']['editattrs'] = 'Edit attributes';
318$tab['attrs']['editmap'] = 'Edit map';
8b6ffe9c
DO
319$tabhandler['attrs']['default'] = 'renderAttributes';
320$tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
321$tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
e673ee24
DO
322$ophandler['attrs']['editattrs']['add'] = 'createAttribute';
323$ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
324$ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
325$ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
326$ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
327
eebf9145 328$page['dict']['title'] = 'Dictionary';
e673ee24
DO
329$page['dict']['parent'] = 'config';
330$tab['dict']['default'] = 'View';
331$tab['dict']['edit'] = 'Edit words';
332$tab['dict']['chapters'] = 'Manage chapters';
8b6ffe9c
DO
333$tabhandler['dict']['default'] = 'renderDictionary';
334$tabhandler['dict']['edit'] = 'renderDictionaryEditor';
335$tabhandler['dict']['chapters'] = 'renderChaptersEditor';
e673ee24
DO
336$ophandler['dict']['edit']['del'] = 'reduceDictionary';
337$ophandler['dict']['edit']['upd'] = 'updateDictionary';
338$ophandler['dict']['edit']['add'] = 'supplementDictionary';
339$ophandler['dict']['chapters']['del'] = 'delChapter';
340$ophandler['dict']['chapters']['upd'] = 'updateChapter';
341$ophandler['dict']['chapters']['add'] = 'addChapter';
342
eebf9145 343$page['ui']['title'] = 'User interface';
e673ee24 344$page['ui']['parent'] = 'config';
0a1b1268 345$tab['ui']['default'] = 'View';
4fe32e78 346$tab['ui']['edit'] = 'Change';
b07f617c 347$tab['ui']['reset'] = 'Reset';
8b6ffe9c
DO
348$tabhandler['ui']['default'] = 'renderUIConfig';
349$tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
350$tabhandler['ui']['reset'] = 'renderUIResetForm';
4fe32e78 351$ophandler['ui']['edit']['upd'] = 'updateUI';
b07f617c 352$ophandler['ui']['reset']['go'] = 'resetUIConfig';
e673ee24 353
931bf334
DO
354$page['tagtree']['title'] = 'Tag tree';
355$page['tagtree']['parent'] = 'config';
356$tab['tagtree']['default'] = 'View';
49fb1027 357$tab['tagtree']['edit'] = 'Edit';
931bf334
DO
358$tabhandler['tagtree']['default'] = 'renderTagTree';
359$tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
fe7044ad
DO
360$ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
361$ophandler['tagtree']['edit']['createTag'] = 'createTag';
362$ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
931bf334 363
9457ca59
DO
364$page['myaccount']['title'] = 'My account';
365$page['myaccount']['parent'] = 'config';
366$tab['myaccount']['default'] = 'Info';
0ac7e4b3
DO
367$tab['myaccount']['mypassword'] = 'Password change';
368$tab['myaccount']['myrealname'] = '[Real name change]';
369$trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
9457ca59
DO
370$tabhandler['myaccount']['default'] = 'renderMyAccount';
371$tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
0ac7e4b3 372$tabhandler['myaccount']['myrealname'] = 'dragon';
9457ca59
DO
373$ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
374
eebf9145 375$page['reports']['title'] = 'Reports';
e673ee24 376$page['reports']['parent'] = 'index';
79a10049 377$page['reports']['handler'] = 'renderReportSummary';
e673ee24
DO
378
379// This function returns array if page numbers leading to the target page
380// plus page number of target page itself. The first element is the target
381// page number and the last element is the index page number.
382function getPath ($targetno)
383{
384 global $page;
385 $path = array();
386 // Recursion breaks at first parentless page.
387 if (!isset ($page[$targetno]['parent']))
388 $path = array ($targetno);
389 else
390 {
391 $path = getPath ($page[$targetno]['parent']);
392 $path[] = $targetno;
393 }
394 return $path;
395}
396
397function showPathAndSearch ($pageno)
398{
9c0b0016 399 global $root, $page;
e673ee24 400 // Path.
73635d32 401 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
eebf9145
DO
402 $path = getPath ($pageno);
403 foreach ($path as $no)
e673ee24 404 {
eebf9145
DO
405 $title['params'] = array();
406 if (isset ($page[$no]['title']))
407 $title['name'] = $page[$no]['title'];
408 elseif (isset ($page[$no]['title_handler']))
409 $title = $page[$no]['title_handler']($no);
410 else
411 $title['name'] = '[N/A]';
412 echo ": <a href='${root}?page=${no}";
413 foreach ($title['params'] as $param_name => $param_value)
414 echo "&${param_name}=${param_value}";
415 echo "'>" . $title['name'] . "</a>";
e673ee24
DO
416 }
417 echo "</td>";
418 // Search form.
419 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
e09e31d5 420 echo "<form name=search method=get action='${root}'><td>";
e673ee24
DO
421 echo '<input type=hidden name=page value=search>';
422 // This input will be the first, if we don't add ports or addresses.
423 echo "<input type=text name=q size=20 tabindex=1000></td></form></tr></table></td>";
424}
425
426function getTitle ($pageno, $tabno)
427{
9c0b0016 428 global $page;
eebf9145
DO
429 if (isset ($page[$pageno]['title']))
430 return $page[$pageno]['title'];
431 elseif (isset ($page[$pageno]['title_handler']))
432 {
433 $tmp = $page[$pageno]['title_handler']($pageno);
434 return $tmp['name'];
435 }
436 else
9c0b0016 437 return getConfigVar ('enterprise');
e673ee24
DO
438}
439
440function showTabs ($pageno, $tabno)
441{
08b16bf5 442 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
e673ee24
DO
443 if (!isset ($tab[$pageno]['default']))
444 return;
445 echo "<td><div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
446 foreach ($tab[$pageno] as $tabidx => $tabtitle)
447 {
448 // Hide forbidden tabs.
810e3422 449 if (!permitted ($pageno, $tabidx))
e673ee24 450 continue;
641fe9b0 451 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
545eaaca
DO
452 if (isset ($trigger[$pageno][$tabidx]))
453 {
454// $t1 = microtime (TRUE);
455 $ok = $trigger[$pageno][$tabidx] ();
456// $t2 = microtime (TRUE);
457// echo 'DEBUG: ' . $trigger[$pageno][$tabidx] . ': ' . sprintf ('%0.4f', $t2 - $t1) . '<br>';
458 if (!$ok)
459 continue;
460 }
08b16bf5
DO
461 $class = ($tabidx == $tabno) ? 'current' : 'std';
462 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
463 echo "<li><a class=${class}{$extra}";
e673ee24
DO
464 echo " href='${root}?page=${pageno}&tab=${tabidx}";
465 if (isset ($page[$pageno]['bypass']) and isset ($_REQUEST[$page[$pageno]['bypass']]))
466 {
467 $bpname = $page[$pageno]['bypass'];
468 $bpval = $_REQUEST[$bpname];
469 echo "&${bpname}=${bpval}";
470 }
471 echo "'>${tabtitle}</a></li>\n";
472 }
473 echo "</ul></div></td>\n";
474}
475
476// This function returns pages, which are direct children of the requested
477// page and are accessible by the current user.
478function getDirectChildPages ($pageno)
479{
480 global $page, $remote_username;
481 $children = array();
482 foreach ($page as $cpageno => $cpage)
483 if
484 (
485 isset ($cpage['parent']) and
486 $cpage['parent'] == $pageno and
810e3422 487 accessibleSubpage ($cpageno) == TRUE
e673ee24
DO
488 )
489 $children[$cpageno] = $cpage;
490 return $children;
491}
492
493function getAllChildPages ($parent)
494{
495 global $page;
496 // Array pointer is global, so if we don't create local copies of
497 // the global array, we can't advance any more after nested call
498 // of getAllChildPages returns.
499 $mypage = $page;
500 $mykids = array();
501 foreach ($mypage as $ctitle => $cpage)
502 if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
503 $mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
504 return $mykids;
505}
506
507?>