r2377 - toss things around to let more config lines be generated by decoder script
[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();
baf37d01 15$msgcode = array();
83dd1b15 16
eebf9145 17$page['index']['title'] = 'Main page';
e673ee24
DO
18$page['index']['handler'] = 'renderIndex';
19
eebf9145 20$page['rackspace']['title'] = 'Rackspace';
e673ee24
DO
21$page['rackspace']['parent'] = 'index';
22$tab['rackspace']['default'] = 'Browse';
345fd640 23$tab['rackspace']['edit'] = 'Manage rows';
e673ee24 24$tab['rackspace']['history'] = 'History';
8b6ffe9c 25$tabhandler['rackspace']['default'] = 'renderRackspace';
345fd640 26$tabhandler['rackspace']['edit'] = 'renderRackspaceRowEditor';
8b6ffe9c 27$tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
345fd640
AD
28$ophandler['rackspace']['edit']['addRow'] = 'addRow';
29$ophandler['rackspace']['edit']['updateRow'] = 'updateRow';
135080d8
DO
30$msgcode['addRow']['OK'] = 74;
31$msgcode['addRow']['ERR'] = 100;
32$msgcode['updateRow']['OK'] = 75;
33$msgcode['updateRow']['ERR'] = 100;
e673ee24 34
eebf9145 35$page['objects']['title'] = 'Objects';
e673ee24
DO
36$page['objects']['parent'] = 'index';
37$tab['objects']['default'] = 'View';
216c84bb 38$tab['objects']['addmore'] = 'Add more';
7cc02fc1 39$tabhandler['objects']['default'] = 'renderObjectSpace';
216c84bb 40$tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
52b34485 41$ophandler['objects']['default']['deleteObject'] = 'deleteObject';
135080d8
DO
42$msgcode['deleteObject']['OK'] = 76;
43$msgcode['deleteObject']['ERR'] = 100;
e673ee24 44
eebf9145 45$page['row']['title_handler'] = 'dynamic_title_row';
e673ee24 46$page['row']['bypass'] = 'row_id';
8b6ffe9c 47$page['row']['bypass_type'] = 'uint';
e673ee24
DO
48$page['row']['parent'] = 'rackspace';
49$tab['row']['default'] = 'View';
50$tab['row']['newrack'] = 'Add new rack';
eb6ea26f 51$tab['row']['tagroller'] = 'Tag roller';
8b6ffe9c
DO
52$tabhandler['row']['default'] = 'renderRow';
53$tabhandler['row']['newrack'] = 'renderNewRackForm';
2f32cc32 54$tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
eb6ea26f 55$ophandler['row']['tagroller']['rollTags'] = 'rollTags';
f19c75d6 56$ophandler['row']['newrack']['addRack'] = 'addRack';
135080d8
DO
57$msgcode['rollTags']['OK'] = 67;
58$msgcode['rollTags']['ERR'] = 149;
59$msgcode['addRack']['OK'] = 65;
60$msgcode['addRack']['ERR1'] = 171;
61$msgcode['addRack']['ERR2'] = 172;
e673ee24 62
eebf9145 63$page['rack']['title_handler'] = 'dynamic_title_rack';
e673ee24 64$page['rack']['bypass'] = 'rack_id';
8b6ffe9c 65$page['rack']['bypass_type'] = 'uint';
e673ee24 66$page['rack']['parent'] = 'row';
41bd8c87
DO
67$page['rack']['tagloader'] = 'loadRackTags';
68$page['rack']['autotagloader'] = 'loadRackAutoTags';
e673ee24
DO
69$tab['rack']['default'] = 'View';
70$tab['rack']['edit'] = 'Properties';
71$tab['rack']['design'] = 'Design';
72$tab['rack']['problems'] = 'Problems';
41bd8c87 73$tab['rack']['tags'] = 'Tags';
e1ae3fb4 74$tab['rack']['files'] = 'Files';
8b6ffe9c
DO
75$tabhandler['rack']['default'] = 'renderRackPage';
76$tabhandler['rack']['edit'] = 'renderEditRackForm';
77$tabhandler['rack']['design'] = 'renderRackDesign';
78$tabhandler['rack']['problems'] = 'renderRackProblems';
482c7f35
DO
79$tabhandler['rack']['tags'] = 'renderEntityTags';
80$tabhandler['rack']['files'] = 'renderFilesForEntity';
41bd8c87 81$trigger['rack']['tags'] = 'trigger_tags';
7056988c 82$ophandler['rack']['edit']['updateRack'] = 'updateRack';
3355ca56 83$ophandler['rack']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4
AD
84$ophandler['rack']['files']['addFile'] = 'addFileToEntity';
85$ophandler['rack']['files']['updateFile'] = 'updateFile';
86$ophandler['rack']['files']['linkFile'] = 'linkFileToEntity';
87$ophandler['rack']['files']['unlinkFile'] = 'unlinkFile';
88$ophandler['rack']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
89$msgcode['updateRack']['OK'] = 68;
90$msgcode['updateRack']['ERR'] = 177;
91$msgcode['addFileToEntity']['OK'] = 69;
92$msgcode['addFileToEntity']['ERR'] = 100;
93$msgcode['updateFile']['OK'] = 70;
94$msgcode['updateFile']['ERR'] = 100;
95$msgcode['linkFileToEntity']['OK'] = 71;
96$msgcode['linkFileToEntity']['ERR1'] = 178;
97$msgcode['linkFileToEntity']['ERR2'] = 100;
98$msgcode['unlinkFile']['OK'] = 72;
99$msgcode['unlinkFile']['ERR'] = 100;
100$msgcode['deleteFile']['OK'] = 73;
101$msgcode['deleteFile']['ERR'] = 100;
e673ee24 102
eebf9145 103$page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
3aeb15f3 104$page['objgroup']['handler'] = 'renderObjectGroup';
e673ee24 105$page['objgroup']['bypass'] = 'group_id';
105cea6e 106$page['objgroup']['bypass_type'] = 'uint0';
e673ee24 107$page['objgroup']['parent'] = 'objects';
52b34485 108$ophandler['objgroup']['default']['deleteObject'] = 'deleteObject';
e673ee24 109
eebf9145 110$page['object']['title_handler'] = 'dynamic_title_object';
e673ee24 111$page['object']['bypass'] = 'object_id';
3bebaebd 112$page['object']['bypass_type'] = 'uint';
e673ee24 113$page['object']['parent'] = 'objgroup';
2fb24351
DO
114$page['object']['tagloader'] = 'loadRackObjectTags';
115$page['object']['autotagloader'] = 'loadRackObjectAutoTags';
e673ee24
DO
116$tab['object']['default'] = 'View';
117$tab['object']['edit'] = 'Properties';
118$tab['object']['rackspace'] = 'Rackspace';
119$tab['object']['ports'] = 'Ports';
72d8ced3
DO
120$tab['object']['ipv4'] = 'IPv4';
121$tab['object']['nat4'] = 'NATv4';
46f92ff7 122$tab['object']['livevlans'] = 'Live VLANs';
9c67f713 123$tab['object']['snmpportfinder'] = 'SNMP port finder';
0dfaea8e 124$tab['object']['editrspvs'] = 'RS pools';
c030232f 125$tab['object']['lvsconfig'] = 'LVS config';
118e4c38 126$tab['object']['autoports'] = 'AutoPorts';
2fb24351 127$tab['object']['tags'] = 'Tags';
e1ae3fb4 128$tab['object']['files'] = 'Files';
e45a78d7
DO
129$tabhandler['object']['default'] = 'renderRackObject';
130$tabhandler['object']['edit'] = 'renderEditObjectForm';
131$tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
132$tabhandler['object']['ports'] = 'renderPortsForObject';
72d8ced3
DO
133$tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
134$tabhandler['object']['nat4'] = 'renderNATv4ForObject';
46f92ff7 135$tabhandler['object']['livevlans'] = 'renderVLANMembership';
e45a78d7 136$tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
3ee1252b 137$tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
118e4c38 138$tabhandler['object']['autoports'] = 'renderAutoPortsForm';
482c7f35
DO
139$tabhandler['object']['tags'] = 'renderEntityTags';
140$tabhandler['object']['files'] = 'renderFilesForEntity';
0dfaea8e 141$tabhandler['object']['editrspvs'] = 'renderObjectSLB';
08b16bf5
DO
142$tabextraclass['object']['snmpportfinder'] = 'attn';
143$tabextraclass['object']['autoports'] = 'attn';
72d8ced3
DO
144$trigger['object']['ipv4'] = 'trigger_ipv4';
145$trigger['object']['nat4'] = 'trigger_natv4';
46f92ff7 146$trigger['object']['livevlans'] = 'trigger_livevlans';
9c67f713 147$trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
0dfaea8e 148$trigger['object']['editrspvs'] = 'trigger_natv4';
094bb33c 149$trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
118e4c38 150$trigger['object']['autoports'] = 'trigger_autoports';
91dbb8a3 151$trigger['object']['tags'] = 'trigger_tags';
e673ee24
DO
152$ophandler['object']['ports']['addPort'] = 'addPortForObject';
153$ophandler['object']['ports']['delPort'] = 'delPortFromObject';
154$ophandler['object']['ports']['editPort'] = 'editPortForObject';
155$ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
156$ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
157$ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
158$ophandler['object']['ports']['useup'] = 'useupPort';
72d8ced3
DO
159$ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
160$ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
161$ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
22bb04da 162$ophandler['object']['edit']['clearSticker'] = 'clearSticker';
22bb04da 163$ophandler['object']['edit']['update'] = 'updateObject';
72d8ced3
DO
164$ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
165$ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
166$ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
46f92ff7 167$ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
f3f0161f 168$ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
3355ca56 169$ophandler['object']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4
AD
170$ophandler['object']['files']['addFile'] = 'addFileToEntity';
171$ophandler['object']['files']['updateFile'] = 'updateFile';
172$ophandler['object']['files']['linkFile'] = 'linkFileToEntity';
173$ophandler['object']['files']['unlinkFile'] = 'unlinkFile';
174$ophandler['object']['files']['deleteFile'] = 'deleteFile';
0dfaea8e
DO
175$ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
176$ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
177$ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
2987fc1f 178$ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
7056988c 179$ophandler['object']['snmpportfinder']['querySNMPData'] = 'querySNMPData';
46f92ff7 180$delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
135080d8
DO
181$msgcode['addPortForwarding']['OK'] = 2;
182$msgcode['addPortForwarding']['ERR'] = 100;
183$msgcode['delPortForwarding']['OK'] = 3;
184$msgcode['delPortForwarding']['ERR'] = 100;
185$msgcode['updPortForwarding']['OK'] = 4;
186$msgcode['updPortForwarding']['ERR'] = 100;
187$msgcode['addPortForObject']['OK'] = 5;
188$msgcode['addPortForObject']['ERR1'] = 101;
189$msgcode['addPortForObject']['ERR2'] = 100;
190$msgcode['editPortForObject']['OK'] = 6;
191$msgcode['editPortForObject']['ERR1'] = 101;
192$msgcode['editPortForObject']['ERR2'] = 100;
193$msgcode['delPortFromObject']['OK'] = 7;
194$msgcode['delPortFromObject']['ERR'] = 100;
195$msgcode['linkPortForObject']['OK'] = 8;
196$msgcode['linkPortForObject']['ERR'] = 100;
197$msgcode['unlinkPortForObject']['OK'] = 9;
198$msgcode['unlinkPortForObject']['ERR'] = 100;
199$msgcode['addMultiPorts']['OK'] = 10;
200$msgcode['addMultiPorts']['ERR'] = 123;
201$msgcode['useupPort']['OK'] = 11;
202$msgcode['useupPort']['ERR'] = 124;
203$msgcode['updIPv4Allocation']['OK'] = 12;
204$msgcode['updIPv4Allocation']['ERR'] = 100;
205$msgcode['addIPv4Allocation']['OK'] = 13;
206$msgcode['addIPv4Allocation']['ERR1'] = 170;
207$msgcode['addIPv4Allocation']['ERR2'] = 100;
208$msgcode['delIPv4Allocation']['OK'] = 14;
209$msgcode['delIPv4Allocation']['ERR'] = 100;
210$msgcode['clearSticker']['OK'] = 15;
211$msgcode['clearSticker']['ERR'] = 120;
212$msgcode['updateObject']['OK'] = 16;
213$msgcode['updateObject']['ERR'] = 121;
214$msgcode['addLoadBalancer']['OK'] = 18;
215$msgcode['addLoadBalancer']['ERR'] = 137;
216$msgcode['delLoadBalancer']['OK'] = 19;
217$msgcode['deleteLoadBalancer']['ERR'] = 129;
218$msgcode['updateLoadBalancer']['OK'] = 20;
219$msgcode['updateLoadBalancer']['ERR'] = 134;
220$msgcode['generateAutoPorts']['OK'] = 21;
221$msgcode['generateAutoPorts']['ERR'] = 142;
222$msgcode['setPortVLAN']['ERR1'] = 156;
223$msgcode['saveEntityTags']['OK'] = 22;
224$msgcode['saveEntityTags']['ERR'] = 143;
e673ee24 225
eebf9145 226$page['ipv4space']['title'] = 'IPv4 space';
e673ee24
DO
227$page['ipv4space']['parent'] = 'index';
228$tab['ipv4space']['default'] = 'Browse';
0bcdc163 229$tab['ipv4space']['newrange'] = 'Manage';
04d619d0
DO
230$tabhandler['ipv4space']['default'] = 'renderIPv4Space';
231$tabhandler['ipv4space']['newrange'] = 'renderIPv4SpaceEditor';
42023f03
DO
232$ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
233$ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
04d619d0 234$ophandler['ipv4space']['newrange']['updIPv4Prefix'] = 'updIPv4Prefix';
135080d8
DO
235$msgcode['addIPv4Prefix']['OK'] = 23;
236$msgcode['addIPv4Prefix']['ERR'] = 100;
237$msgcode['addIPv4Prefix']['ERR1'] = 173;
238$msgcode['addIPv4Prefix']['ERR2'] = 174;
239$msgcode['addIPv4Prefix']['ERR3'] = 175;
240$msgcode['addIPv4Prefix']['ERR4'] = 176;
241$msgcode['delIPv4Prefix']['OK'] = 24;
242$msgcode['delIPv4Prefix']['ERR'] = 100;
e673ee24 243
e1ae3fb4
AD
244$page['ipv4net']['title_handler'] = 'dynamic_title_ipv4net';
245$page['ipv4net']['parent'] = 'ipv4space';
246$page['ipv4net']['bypass'] = 'id';
247$page['ipv4net']['bypass_type'] = 'uint';
248$page['ipv4net']['autotagloader'] = 'loadIPv4PrefixAutoTags';
249$page['ipv4net']['tagloader'] = 'loadIPv4PrefixTags';
250$tab['ipv4net']['default'] = 'Browse';
251$tab['ipv4net']['properties'] = 'Properties';
252$tab['ipv4net']['liveptr'] = 'Live PTR';
253$tab['ipv4net']['tags'] = 'Tags';
254$tab['ipv4net']['files'] = 'Files';
255$tabhandler['ipv4net']['default'] = 'renderIPv4Network';
256$tabhandler['ipv4net']['properties'] = 'renderIPv4NetworkProperties';
257$tabhandler['ipv4net']['liveptr'] = 'renderLivePTR';
482c7f35
DO
258$tabhandler['ipv4net']['tags'] = 'renderEntityTags';
259$tabhandler['ipv4net']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
260$trigger['ipv4net']['tags'] = 'trigger_tags';
261$ophandler['ipv4net']['properties']['editRange'] = 'updIPv4Prefix';
262$ophandler['ipv4net']['liveptr']['importPTRData'] = 'importPTRData';
263$ophandler['ipv4net']['tags']['saveTags'] = 'saveEntityTags';
264$ophandler['ipv4net']['files']['addFile'] = 'addFileToEntity';
265$ophandler['ipv4net']['files']['updateFile'] = 'updateFile';
266$ophandler['ipv4net']['files']['linkFile'] = 'linkFileToEntity';
267$ophandler['ipv4net']['files']['unlinkFile'] = 'unlinkFile';
268$ophandler['ipv4net']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
269$msgcode['updIPv4Prefix']['OK'] = 25;
270$msgcode['updIPv4Prefix']['ERR'] = 100;
271$msgcode['importPTRData']['OK'] = 26;
272$msgcode['importPTRData']['ERR'] = 141;
e673ee24 273
eebf9145 274$page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
e1ae3fb4 275$page['ipaddress']['parent'] = 'ipv4net';
e673ee24 276$page['ipaddress']['bypass'] = 'ip';
1fbc9fd6 277$page['ipaddress']['bypass_type'] = 'inet4';
d817ba03 278$page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
e673ee24
DO
279$tab['ipaddress']['default'] = 'Browse';
280$tab['ipaddress']['properties'] = 'Properties';
281$tab['ipaddress']['assignment'] = 'Allocation';
7e13adfe 282$tab['ipaddress']['editrslist'] = '[SLB real servers]';
2d318652
DO
283$tabhandler['ipaddress']['default'] = 'renderIPv4Address';
284$tabhandler['ipaddress']['properties'] = 'renderIPv4AddressProperties';
285$tabhandler['ipaddress']['assignment'] = 'renderIPv4AddressAllocations';
1fbc9fd6 286$tabhandler['ipaddress']['editrslist'] = 'dragon';
e673ee24 287$ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
b4c1ef87
DO
288$ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
289$ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
290$ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
135080d8
DO
291$msgcode['editAddress']['OK'] = 27;
292$msgcode['editAddress']['ERR'] = 100;
e673ee24 293
f973f491
DO
294$page['ipv4slb']['title'] = 'IPv4 SLB';
295$page['ipv4slb']['parent'] = 'index';
296$page['ipv4slb']['handler'] = 'renderIPv4SLB';
297
a239e016
DO
298$page['ipv4vslist']['title'] = 'Virtual services';
299$page['ipv4vslist']['parent'] = 'ipv4slb';
300$tab['ipv4vslist']['default'] = 'View';
301$tab['ipv4vslist']['edit'] = 'Edit';
302$tabhandler['ipv4vslist']['default'] = 'renderVSList';
303$tabhandler['ipv4vslist']['edit'] = 'renderVSListEditForm';
304$ophandler['ipv4vslist']['edit']['add'] = 'addVService';
305$ophandler['ipv4vslist']['edit']['del'] = 'deleteVService';
306$ophandler['ipv4vslist']['edit']['upd'] = 'updateVService';
135080d8
DO
307$msgcode['addVService']['OK'] = 28;
308$msgcode['addVService']['ERR1'] = 132;
309$msgcode['addVService']['ERR2'] = 100;
310$msgcode['deleteVService']['OK'] = 29;
311$msgcode['deleteVService']['ERR'] = 130;
312$msgcode['updateVService']['OK'] = 30;
313$msgcode['updateVService']['ERR'] = 135;
b3c50e6c 314
2bb798a3
DO
315$page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
316$page['ipv4vs']['parent'] = 'ipv4vslist';
49fb2686 317$page['ipv4vs']['bypass'] = 'vs_id';
2bb798a3
DO
318$page['ipv4vs']['bypass_type'] = 'uint';
319$page['ipv4vs']['tagloader'] = 'loadIPv4VSTags';
320$page['ipv4vs']['autotagloader'] = 'loadIPv4VSAutoTags';
321$tab['ipv4vs']['default'] = 'View';
c9890988 322$tab['ipv4vs']['edit'] = 'Edit';
49fb2686 323$tab['ipv4vs']['editlblist'] = 'Load balancers';
2bb798a3 324$tab['ipv4vs']['tags'] = 'Tags';
e1ae3fb4 325$tab['ipv4vs']['files'] = 'Files';
2bb798a3
DO
326$tabhandler['ipv4vs']['default'] = 'renderVirtualService';
327$tabhandler['ipv4vs']['edit'] = 'renderEditVService';
49fb2686 328$tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
482c7f35
DO
329$tabhandler['ipv4vs']['tags'] = 'renderEntityTags';
330$tabhandler['ipv4vs']['files'] = 'renderFilesForEntity';
e1ae3fb4 331$trigger['ipv4vs']['tags'] = 'trigger_tags';
e02e1941 332$ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
49fb2686
DO
333$ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
334$ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
335$ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
e1ae3fb4
AD
336$ophandler['ipv4vs']['tags']['saveTags'] = 'saveEntityTags';
337$ophandler['ipv4vs']['files']['addFile'] = 'addFileToEntity';
338$ophandler['ipv4vs']['files']['updateFile'] = 'updateFile';
339$ophandler['ipv4vs']['files']['linkFile'] = 'linkFileToEntity';
340$ophandler['ipv4vs']['files']['unlinkFile'] = 'unlinkFile';
341$ophandler['ipv4vs']['files']['deleteFile'] = 'deleteFile';
c9b4588f 342
ee437dab
DO
343$page['ipv4rsplist']['title'] = 'RS pools';
344$page['ipv4rsplist']['parent'] = 'ipv4slb';
345$tab['ipv4rsplist']['default'] = 'View';
346$tab['ipv4rsplist']['edit'] = 'Edit';
347$tabhandler['ipv4rsplist']['default'] = 'renderRSPoolList';
348$tabhandler['ipv4rsplist']['edit'] = 'editRSPools';
349$ophandler['ipv4rsplist']['edit']['add'] = 'addRSPool';
350$ophandler['ipv4rsplist']['edit']['del'] = 'deleteRSPool';
351$ophandler['ipv4rsplist']['edit']['upd'] = 'updateRSPool';
135080d8
DO
352$msgcode['addRSPool']['OK'] = 31;
353$msgcode['addRSPool']['ERR'] = 100;
354$msgcode['deleteRSPool']['OK'] = 32;
355$msgcode['deleteRSPool']['ERR'] = 138;
356$msgcode['updateRSPool']['OK'] = 33;
357$msgcode['updateRSPool']['ERR'] = 139;
e1ae3fb4
AD
358
359$page['ipv4rspool']['title_handler'] = 'dynamic_title_rspool';
360$page['ipv4rspool']['parent'] = 'ipv4rsplist';
361$page['ipv4rspool']['bypass'] = 'pool_id';
362$page['ipv4rspool']['bypass_type'] = 'uint';
363$page['ipv4rspool']['tagloader'] = 'loadIPv4RSPoolTags';
364$page['ipv4rspool']['autotagloader'] = 'loadIPv4RSPoolAutoTags';
365$tab['ipv4rspool']['default'] = 'View';
366$tab['ipv4rspool']['edit'] = 'Edit';
367$tab['ipv4rspool']['editlblist'] = 'Load Balancers';
368$tab['ipv4rspool']['editrslist'] = 'RS list';
369$tab['ipv4rspool']['rsinservice'] = 'RS in service';
370$tab['ipv4rspool']['tags'] = 'Tags';
371$tab['ipv4rspool']['files'] = 'Files';
372$trigger['ipv4rspool']['rsinservice'] = 'trigger_poolrscount';
373$trigger['ipv4rspool']['tags'] = 'trigger_tags';
374$tabhandler['ipv4rspool']['default'] = 'renderRSPool';
375$tabhandler['ipv4rspool']['edit'] = 'renderEditRSPool';
376$tabhandler['ipv4rspool']['editrslist'] = 'renderRSPoolServerForm';
377$tabhandler['ipv4rspool']['editlblist'] = 'renderRSPoolLBForm';
378$tabhandler['ipv4rspool']['rsinservice'] = 'renderRSPoolRSInServiceForm';
482c7f35
DO
379$tabhandler['ipv4rspool']['tags'] = 'renderEntityTags';
380$tabhandler['ipv4rspool']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
381$ophandler['ipv4rspool']['edit']['updIPv4RSP'] = 'updateRSPool';
382$ophandler['ipv4rspool']['editrslist']['addRS'] = 'addRealServer';
383$ophandler['ipv4rspool']['editrslist']['delRS'] = 'deleteRealServer';
384$ophandler['ipv4rspool']['editrslist']['updRS'] = 'updateRealServer';
385$ophandler['ipv4rspool']['editrslist']['addMany'] = 'addRealServers';
386$ophandler['ipv4rspool']['editlblist']['addLB'] = 'addLoadBalancer';
387$ophandler['ipv4rspool']['editlblist']['delLB'] = 'deleteLoadBalancer';
388$ophandler['ipv4rspool']['editlblist']['updLB'] = 'updateLoadBalancer';
389$ophandler['ipv4rspool']['rsinservice']['upd'] = 'updateRSInService';
390$ophandler['ipv4rspool']['tags']['saveTags'] = 'saveEntityTags';
391$ophandler['ipv4rspool']['files']['addFile'] = 'addFileToEntity';
392$ophandler['ipv4rspool']['files']['updateFile'] = 'updateFile';
393$ophandler['ipv4rspool']['files']['linkFile'] = 'linkFileToEntity';
394$ophandler['ipv4rspool']['files']['unlinkFile'] = 'unlinkFile';
395$ophandler['ipv4rspool']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
396$msgcode['addRealServer']['OK'] = 34;
397$msgcode['addRealServer']['ERR'] = 126;
398$msgcode['deleteRealServer']['OK'] = 35;
399$msgcode['deleteRealServer']['ERR'] = 128;
400$msgcode['updateRealServer']['OK'] = 36;
401$msgcode['updateRealServer']['ERR'] = 133;
402$msgcode['addRealServers']['OK'] = 37;
403$msgcode['addRealServers']['ERR1'] = 131;
404$msgcode['addRealServers']['ERR2'] = 127;
405$msgcode['updateRSInService']['OK'] = 38;
406$msgcode['updateRSInService']['ERR'] = 140;
71b8bda1 407
8253d9f0 408$page['rservers']['title'] = 'Real servers';
f973f491 409$page['rservers']['parent'] = 'ipv4slb';
8253d9f0 410$page['rservers']['handler'] = 'renderRealServerList';
b3c50e6c 411
4b0932b6 412$page['lbs']['title'] = 'Load balancers';
f973f491 413$page['lbs']['parent'] = 'ipv4slb';
4b0932b6 414$page['lbs']['handler'] = 'renderLBList';
b3c50e6c 415
eebf9145 416$page['search']['title_handler'] = 'dynamic_title_search';
3aeb15f3 417$page['search']['handler'] = 'renderSearchResults';
e673ee24
DO
418$page['search']['parent'] = 'index';
419$page['search']['bypass'] = 'q';
420
eebf9145 421$page['config']['title'] = 'Configuration';
3aeb15f3 422$page['config']['handler'] = 'renderConfigMainpage';
e673ee24
DO
423$page['config']['parent'] = 'index';
424
82627005
DO
425$page['userlist']['title'] = 'Users';
426$page['userlist']['parent'] = 'config';
427$tab['userlist']['default'] = 'View';
428$tab['userlist']['edit'] = 'Edit';
429$tabhandler['userlist']['default'] = 'renderUserList';
430$tabhandler['userlist']['edit'] = 'renderUserListEditor';
431$ophandler['userlist']['edit']['updateUser'] = 'updateUser';
432$ophandler['userlist']['edit']['createUser'] = 'createUser';
433$ophandler['userlist']['edit']['disableUser'] = 'disableUser';
434$ophandler['userlist']['edit']['enableUser'] = 'enableUser';
135080d8
DO
435$msgcode['updateUser']['OK'] = 39;
436$msgcode['updateUser']['ERR1'] = 103;
437$msgcode['updateUser']['ERR1'] = 104;
438$msgcode['createUser']['OK'] = 40;
439$msgcode['createUser']['ERR'] = 102;
440$msgcode['disableUser']['OK'] = 41;
441$msgcode['disableUser']['ERR1'] = 107;
442$msgcode['disableUser']['ERR2'] = 106;
443$msgcode['enableUser']['OK'] = 42;
444$msgcode['enableUser']['ERR'] = 105;
82627005
DO
445
446$page['user']['title_handler'] = 'dynamic_title_user';
447$page['user']['parent'] = 'userlist';
448$page['user']['bypass'] = 'user_id';
449$page['user']['bypass_type'] = 'uint';
450$page['user']['tagloader'] = 'loadUserTags';
da958e52 451$page['user']['autotagloader'] = 'getUserAutoTags';
82627005 452$tab['user']['default'] = 'View';
82627005 453$tab['user']['tags'] = 'Tags';
e1ae3fb4 454$tab['user']['files'] = 'Files';
82627005 455$tabhandler['user']['default'] = 'renderUser';
482c7f35
DO
456$tabhandler['user']['tags'] = 'renderEntityTags';
457$tabhandler['user']['files'] = 'renderFilesForEntity';
3355ca56 458$ophandler['user']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4
AD
459$ophandler['user']['files']['addFile'] = 'addFileToEntity';
460$ophandler['user']['files']['updateFile'] = 'updateFile';
461$ophandler['user']['files']['linkFile'] = 'linkFileToEntity';
462$ophandler['user']['files']['unlinkFile'] = 'unlinkFile';
463$ophandler['user']['files']['deleteFile'] = 'deleteFile';
e673ee24 464
eebf9145 465$page['perms']['title'] = 'Permissions';
e673ee24
DO
466$page['perms']['parent'] = 'config';
467$tab['perms']['default'] = 'View';
82627005
DO
468$tab['perms']['edit'] = 'Edit';
469$tabhandler['perms']['default'] = 'renderRackCodeViewer';
470$tabhandler['perms']['edit'] = 'renderRackCodeEditor';
471$ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
135080d8
DO
472$msgcode['saveRackCode']['OK'] = 43;
473$msgcode['saveRackCode']['ERR1'] = 154;
474$msgcode['saveRackCode']['ERR2'] = 155;
e673ee24 475
eebf9145 476$page['portmap']['title'] = 'Port compatibility map';
e673ee24
DO
477$page['portmap']['parent'] = 'config';
478$tab['portmap']['default'] = 'View';
479$tab['portmap']['edit'] = 'Change';
17c32f4c
DO
480$tabhandler['portmap']['default'] = 'renderPortMapViewer';
481$tabhandler['portmap']['edit'] = 'renderPortMapEditor';
e673ee24 482$ophandler['portmap']['edit']['save'] = 'savePortMap';
135080d8
DO
483$msgcode['savePortMap']['OK'] = 44;
484$msgcode['savePortMap']['ERR'] = 108;
e673ee24 485
eebf9145 486$page['attrs']['title'] = 'Attributes';
e673ee24
DO
487$page['attrs']['parent'] = 'config';
488$tab['attrs']['default'] = 'View';
489$tab['attrs']['editattrs'] = 'Edit attributes';
490$tab['attrs']['editmap'] = 'Edit map';
8b6ffe9c
DO
491$tabhandler['attrs']['default'] = 'renderAttributes';
492$tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
493$tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
e673ee24
DO
494$ophandler['attrs']['editattrs']['add'] = 'createAttribute';
495$ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
496$ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
497$ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
498$ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
135080d8
DO
499$msgcode['createAttribute']['OK'] = 45;
500$msgcode['createAttribute']['ERR'] = 116;
501$msgcode['changeAttribute']['OK'] = 46;
502$msgcode['changeAttribute']['ERR'] = 115;
503$msgcode['deleteAttribute']['OK'] = 47;
504$msgcode['deleteAttribute']['ERR'] = 117;
505$msgcode['supplementAttrMap']['OK'] = 48;
506$msgcode['supplementAttrMap']['ERR'] = 118;
507$msgcode['reduceAttrMap']['OK'] = 49;
508$msgcode['reduceAttrMap']['ERR'] = 119;
e673ee24 509
eebf9145 510$page['dict']['title'] = 'Dictionary';
e673ee24
DO
511$page['dict']['parent'] = 'config';
512$tab['dict']['default'] = 'View';
513$tab['dict']['edit'] = 'Edit words';
514$tab['dict']['chapters'] = 'Manage chapters';
8b6ffe9c
DO
515$tabhandler['dict']['default'] = 'renderDictionary';
516$tabhandler['dict']['edit'] = 'renderDictionaryEditor';
517$tabhandler['dict']['chapters'] = 'renderChaptersEditor';
e673ee24
DO
518$ophandler['dict']['edit']['del'] = 'reduceDictionary';
519$ophandler['dict']['edit']['upd'] = 'updateDictionary';
520$ophandler['dict']['edit']['add'] = 'supplementDictionary';
521$ophandler['dict']['chapters']['del'] = 'delChapter';
522$ophandler['dict']['chapters']['upd'] = 'updateChapter';
523$ophandler['dict']['chapters']['add'] = 'addChapter';
135080d8
DO
524$msgcode['reduceDictionary']['OK'] = 50;
525$msgcode['reduceDictionary']['ERR'] = 111;
526$msgcode['updateDictionary']['OK'] = 51;
527$msgcode['updateDictionary']['ERR'] = 109;
528$msgcode['supplementDictionary']['OK'] = 52;
529$msgcode['supplementDictionary']['ERR'] = 110;
530$msgcode['delChapter']['OK'] = 53;
531$msgcode['delChapter']['ERR'] = 114;
532$msgcode['updateChapter']['OK'] = 54;
533$msgcode['updateChapter']['ERR'] = 113;
534$msgcode['addChapter']['OK'] = 55;
535$msgcode['addChapter']['ERR'] = 112;
e673ee24 536
eebf9145 537$page['ui']['title'] = 'User interface';
e673ee24 538$page['ui']['parent'] = 'config';
0a1b1268 539$tab['ui']['default'] = 'View';
4fe32e78 540$tab['ui']['edit'] = 'Change';
b07f617c 541$tab['ui']['reset'] = 'Reset';
8b6ffe9c
DO
542$tabhandler['ui']['default'] = 'renderUIConfig';
543$tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
544$tabhandler['ui']['reset'] = 'renderUIResetForm';
4fe32e78 545$ophandler['ui']['edit']['upd'] = 'updateUI';
b07f617c 546$ophandler['ui']['reset']['go'] = 'resetUIConfig';
135080d8
DO
547$msgcode['updateUI']['OK'] = 56;
548$msgcode['updateUI']['ERR'] = 125;
549$msgcode['resetUIConfig']['OK'] = 57;
e673ee24 550
931bf334
DO
551$page['tagtree']['title'] = 'Tag tree';
552$page['tagtree']['parent'] = 'config';
553$tab['tagtree']['default'] = 'View';
49fb1027 554$tab['tagtree']['edit'] = 'Edit';
931bf334
DO
555$tabhandler['tagtree']['default'] = 'renderTagTree';
556$tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
fe7044ad
DO
557$ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
558$ophandler['tagtree']['edit']['createTag'] = 'createTag';
559$ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
135080d8
DO
560$msgcode['destroyTag']['OK'] = 58;
561$msgcode['destroyTag']['ERR'] = 144;
562$msgcode['createTag']['OK'] = 59;
563$msgcode['createTag']['ERR1'] = 145;
564$msgcode['createTag']['ERR2'] = 146;
565$msgcode['createTag']['ERR3'] = 147;
566$msgcode['updateTag']['OK'] = 60;
567$msgcode['updateTag']['ERR1'] = 145;
568$msgcode['updateTag']['ERR2'] = 148;
931bf334 569
9457ca59
DO
570$page['myaccount']['title'] = 'My account';
571$page['myaccount']['parent'] = 'config';
572$tab['myaccount']['default'] = 'Info';
0ac7e4b3
DO
573$tab['myaccount']['mypassword'] = 'Password change';
574$tab['myaccount']['myrealname'] = '[Real name change]';
575$trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
9457ca59
DO
576$tabhandler['myaccount']['default'] = 'renderMyAccount';
577$tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
0ac7e4b3 578$tabhandler['myaccount']['myrealname'] = 'dragon';
9457ca59 579$ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
135080d8
DO
580$msgcode['changeMyPassword']['OK'] = 61;
581$msgcode['changeMyPassword']['ERR1'] = 150;
582$msgcode['changeMyPassword']['ERR2'] = 151;
583$msgcode['changeMyPassword']['ERR3'] = 152;
584$msgcode['changeMyPassword']['ERR4'] = 153;
9457ca59 585
eebf9145 586$page['reports']['title'] = 'Reports';
e673ee24 587$page['reports']['parent'] = 'index';
e5c4506d 588$tab['reports']['default'] = 'System';
88d513cd 589$tab['reports']['rackcode'] = 'RackCode';
09620506 590$tab['reports']['ipv4'] = 'IPv4';
e5c4506d
DO
591$tab['reports']['local'] = 'Local';
592$trigger['reports']['local'] = 'trigger_localreports';
593$tabhandler['reports']['default'] = 'renderSystemReports';
88d513cd 594$tabhandler['reports']['rackcode'] = 'renderRackCodeReports';
09620506 595$tabhandler['reports']['ipv4'] = 'renderIPv4Reports';
e5c4506d 596$tabhandler['reports']['local'] = 'renderLocalReports';
e673ee24 597
e1ae3fb4
AD
598$page['files']['title'] = 'Files';
599$page['files']['parent'] = 'index';
600$tab['files']['default'] = 'View';
601$tab['files']['addmore'] = 'Upload';
602$tabhandler['files']['default'] = 'renderFileSpace';
603$tabhandler['files']['addmore'] = 'renderFileUploadForm';
604$ophandler['files']['addmore']['addFile'] = 'addFileWithoutLink';
135080d8
DO
605$msgcode['addFileWithoutLink']['OK'] = 69;
606$msgcode['addFileWithoutLink']['ERR'] = 100;
e1ae3fb4
AD
607
608$page['filesbylink']['title_handler'] = 'dynamic_title_file';
609$page['filesbylink']['handler'] = 'renderFilesByLink'; //renderObjectGroup
610$page['filesbylink']['bypass'] = 'entity_type';
611$page['filesbylink']['bypass_type'] = 'string';
612$page['filesbylink']['parent'] = 'files';
613$ophandler['filesbylink']['default']['deleteFile'] = 'deleteFile';
614
cd35db83 615$page['file']['title_handler'] = 'dynamic_title_file';
e1ae3fb4
AD
616$page['file']['bypass'] = 'file_id';
617$page['file']['bypass_type'] = 'uint';
f4d879a9 618$page['file']['parent'] = 'files';
e1ae3fb4
AD
619$page['file']['tagloader'] = 'loadFileTags';
620$page['file']['autotagloader'] = 'loadFileAutoTags';
621$tab['file']['default'] = 'View';
622$tab['file']['tags'] = 'Tags';
623$trigger['file']['tags'] = 'trigger_tags';
482c7f35 624$tabhandler['file']['tags'] = 'renderEntityTags';
e1ae3fb4
AD
625$tabhandler['file']['default'] = 'renderFile';
626$ophandler['file']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 627
e673ee24
DO
628// This function returns array if page numbers leading to the target page
629// plus page number of target page itself. The first element is the target
630// page number and the last element is the index page number.
631function getPath ($targetno)
632{
633 global $page;
634 $path = array();
635 // Recursion breaks at first parentless page.
636 if (!isset ($page[$targetno]['parent']))
637 $path = array ($targetno);
638 else
639 {
640 $path = getPath ($page[$targetno]['parent']);
641 $path[] = $targetno;
642 }
643 return $path;
644}
645
646function showPathAndSearch ($pageno)
647{
9c0b0016 648 global $root, $page;
e673ee24 649 // Path.
73635d32 650 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
eebf9145
DO
651 $path = getPath ($pageno);
652 foreach ($path as $no)
e673ee24 653 {
eebf9145
DO
654 $title['params'] = array();
655 if (isset ($page[$no]['title']))
656 $title['name'] = $page[$no]['title'];
657 elseif (isset ($page[$no]['title_handler']))
658 $title = $page[$no]['title_handler']($no);
659 else
660 $title['name'] = '[N/A]';
52c836b1 661 echo ": <a href='${root}?page=${no}&tab=default";
eebf9145
DO
662 foreach ($title['params'] as $param_name => $param_value)
663 echo "&${param_name}=${param_value}";
664 echo "'>" . $title['name'] . "</a>";
e673ee24
DO
665 }
666 echo "</td>";
667 // Search form.
668 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
e09e31d5 669 echo "<form name=search method=get action='${root}'><td>";
e673ee24
DO
670 echo '<input type=hidden name=page value=search>';
671 // This input will be the first, if we don't add ports or addresses.
672 echo "<input type=text name=q size=20 tabindex=1000></td></form></tr></table></td>";
673}
674
675function getTitle ($pageno, $tabno)
676{
9c0b0016 677 global $page;
eebf9145
DO
678 if (isset ($page[$pageno]['title']))
679 return $page[$pageno]['title'];
680 elseif (isset ($page[$pageno]['title_handler']))
681 {
682 $tmp = $page[$pageno]['title_handler']($pageno);
683 return $tmp['name'];
684 }
685 else
9c0b0016 686 return getConfigVar ('enterprise');
e673ee24
DO
687}
688
689function showTabs ($pageno, $tabno)
690{
08b16bf5 691 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
e673ee24
DO
692 if (!isset ($tab[$pageno]['default']))
693 return;
694 echo "<td><div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
695 foreach ($tab[$pageno] as $tabidx => $tabtitle)
696 {
697 // Hide forbidden tabs.
810e3422 698 if (!permitted ($pageno, $tabidx))
e673ee24 699 continue;
641fe9b0 700 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
545eaaca
DO
701 if (isset ($trigger[$pageno][$tabidx]))
702 {
703// $t1 = microtime (TRUE);
704 $ok = $trigger[$pageno][$tabidx] ();
705// $t2 = microtime (TRUE);
706// echo 'DEBUG: ' . $trigger[$pageno][$tabidx] . ': ' . sprintf ('%0.4f', $t2 - $t1) . '<br>';
707 if (!$ok)
708 continue;
709 }
08b16bf5
DO
710 $class = ($tabidx == $tabno) ? 'current' : 'std';
711 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
712 echo "<li><a class=${class}{$extra}";
e673ee24
DO
713 echo " href='${root}?page=${pageno}&tab=${tabidx}";
714 if (isset ($page[$pageno]['bypass']) and isset ($_REQUEST[$page[$pageno]['bypass']]))
715 {
716 $bpname = $page[$pageno]['bypass'];
717 $bpval = $_REQUEST[$bpname];
718 echo "&${bpname}=${bpval}";
719 }
720 echo "'>${tabtitle}</a></li>\n";
721 }
722 echo "</ul></div></td>\n";
723}
724
725// This function returns pages, which are direct children of the requested
726// page and are accessible by the current user.
727function getDirectChildPages ($pageno)
728{
729 global $page, $remote_username;
730 $children = array();
731 foreach ($page as $cpageno => $cpage)
732 if
733 (
734 isset ($cpage['parent']) and
735 $cpage['parent'] == $pageno and
810e3422 736 accessibleSubpage ($cpageno) == TRUE
e673ee24
DO
737 )
738 $children[$cpageno] = $cpage;
739 return $children;
740}
741
742function getAllChildPages ($parent)
743{
744 global $page;
745 // Array pointer is global, so if we don't create local copies of
746 // the global array, we can't advance any more after nested call
747 // of getAllChildPages returns.
748 $mypage = $page;
749 $mykids = array();
750 foreach ($mypage as $ctitle => $cpage)
751 if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
752 $mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
753 return $mykids;
754}
755
756?>