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