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