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