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