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