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