r2576 - toss file management UI a bit: render download/size code like renderFileCell...
[racktables] / inc / navigation.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2/*
3*
4* This file implements generic navigation for RackTables.
5*
6*/
7
83dd1b15
DO
8$page = array();
9$tab = array();
83dd1b15
DO
10$trigger = array();
11$ophandler = array();
81bab70c 12$tabhandler = array();
2f48b72b
DO
13$tabextraclass = array();
14$delayauth = array();
baf37d01 15$msgcode = array();
83dd1b15 16
eebf9145 17$page['index']['title'] = 'Main page';
e673ee24
DO
18$page['index']['handler'] = 'renderIndex';
19
eebf9145 20$page['rackspace']['title'] = 'Rackspace';
e673ee24
DO
21$page['rackspace']['parent'] = 'index';
22$tab['rackspace']['default'] = 'Browse';
345fd640 23$tab['rackspace']['edit'] = 'Manage rows';
e673ee24 24$tab['rackspace']['history'] = 'History';
8b6ffe9c 25$tabhandler['rackspace']['default'] = 'renderRackspace';
345fd640 26$tabhandler['rackspace']['edit'] = 'renderRackspaceRowEditor';
8b6ffe9c 27$tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
345fd640
AD
28$ophandler['rackspace']['edit']['addRow'] = 'addRow';
29$ophandler['rackspace']['edit']['updateRow'] = 'updateRow';
9f14a7ef 30$ophandler['rackspace']['edit']['delete'] = 'deleteRow';
135080d8
DO
31$msgcode['addRow']['OK'] = 74;
32$msgcode['addRow']['ERR'] = 100;
33$msgcode['updateRow']['OK'] = 75;
34$msgcode['updateRow']['ERR'] = 100;
8628ae44 35$msgcode['deleteRow']['OK'] = 77;
9f14a7ef 36$msgcode['deleteRow']['ERR'] = 100;
e673ee24 37
eebf9145 38$page['objects']['title'] = 'Objects';
e673ee24
DO
39$page['objects']['parent'] = 'index';
40$tab['objects']['default'] = 'View';
216c84bb 41$tab['objects']['addmore'] = 'Add more';
7cc02fc1 42$tabhandler['objects']['default'] = 'renderObjectSpace';
216c84bb 43$tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
42d73cbf
DY
44$ophandler['objects']['addmore']['addObjects'] = 'addMultipleObjects';
45$ophandler['objects']['addmore']['addLotOfObjects'] = 'addLotOfObjects';
52b34485 46$ophandler['objects']['default']['deleteObject'] = 'deleteObject';
135080d8
DO
47$msgcode['deleteObject']['OK'] = 76;
48$msgcode['deleteObject']['ERR'] = 100;
e673ee24 49
eebf9145 50$page['row']['title_handler'] = 'dynamic_title_row';
e673ee24 51$page['row']['bypass'] = 'row_id';
8b6ffe9c 52$page['row']['bypass_type'] = 'uint';
e673ee24
DO
53$page['row']['parent'] = 'rackspace';
54$tab['row']['default'] = 'View';
55$tab['row']['newrack'] = 'Add new rack';
eb6ea26f 56$tab['row']['tagroller'] = 'Tag roller';
8b6ffe9c
DO
57$tabhandler['row']['default'] = 'renderRow';
58$tabhandler['row']['newrack'] = 'renderNewRackForm';
2f32cc32 59$tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
eb6ea26f 60$ophandler['row']['tagroller']['rollTags'] = 'rollTags';
f19c75d6 61$ophandler['row']['newrack']['addRack'] = 'addRack';
135080d8
DO
62$msgcode['rollTags']['OK'] = 67;
63$msgcode['rollTags']['ERR'] = 149;
64$msgcode['addRack']['OK'] = 65;
65$msgcode['addRack']['ERR1'] = 171;
66$msgcode['addRack']['ERR2'] = 172;
e673ee24 67
eebf9145 68$page['rack']['title_handler'] = 'dynamic_title_rack';
e673ee24 69$page['rack']['bypass'] = 'rack_id';
8b6ffe9c 70$page['rack']['bypass_type'] = 'uint';
e673ee24 71$page['rack']['parent'] = 'row';
41bd8c87
DO
72$page['rack']['tagloader'] = 'loadRackTags';
73$page['rack']['autotagloader'] = 'loadRackAutoTags';
e673ee24
DO
74$tab['rack']['default'] = 'View';
75$tab['rack']['edit'] = 'Properties';
76$tab['rack']['design'] = 'Design';
77$tab['rack']['problems'] = 'Problems';
41bd8c87 78$tab['rack']['tags'] = 'Tags';
e1ae3fb4 79$tab['rack']['files'] = 'Files';
8b6ffe9c
DO
80$tabhandler['rack']['default'] = 'renderRackPage';
81$tabhandler['rack']['edit'] = 'renderEditRackForm';
82$tabhandler['rack']['design'] = 'renderRackDesign';
83$tabhandler['rack']['problems'] = 'renderRackProblems';
482c7f35
DO
84$tabhandler['rack']['tags'] = 'renderEntityTags';
85$tabhandler['rack']['files'] = 'renderFilesForEntity';
41bd8c87 86$trigger['rack']['tags'] = 'trigger_tags';
4fbb5a00
DY
87$ophandler['rack']['design']['updateRack'] = 'updateRackDesign';
88$ophandler['rack']['problems']['updateRack'] = 'updateRackProblems';
7056988c 89$ophandler['rack']['edit']['updateRack'] = 'updateRack';
c8187437 90$ophandler['rack']['edit']['deleteRack'] = 'deleteRack';
3355ca56 91$ophandler['rack']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 92$ophandler['rack']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
93$ophandler['rack']['files']['linkFile'] = 'linkFileToEntity';
94$ophandler['rack']['files']['unlinkFile'] = 'unlinkFile';
95$ophandler['rack']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
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;
e673ee24 109
eebf9145 110$page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
3aeb15f3 111$page['objgroup']['handler'] = 'renderObjectGroup';
e673ee24 112$page['objgroup']['bypass'] = 'group_id';
105cea6e 113$page['objgroup']['bypass_type'] = 'uint0';
e673ee24 114$page['objgroup']['parent'] = 'objects';
52b34485 115$ophandler['objgroup']['default']['deleteObject'] = 'deleteObject';
e673ee24 116
eebf9145 117$page['object']['title_handler'] = 'dynamic_title_object';
e673ee24 118$page['object']['bypass'] = 'object_id';
3bebaebd 119$page['object']['bypass_type'] = 'uint';
e673ee24 120$page['object']['parent'] = 'objgroup';
2fb24351
DO
121$page['object']['tagloader'] = 'loadRackObjectTags';
122$page['object']['autotagloader'] = 'loadRackObjectAutoTags';
e673ee24
DO
123$tab['object']['default'] = 'View';
124$tab['object']['edit'] = 'Properties';
125$tab['object']['rackspace'] = 'Rackspace';
126$tab['object']['ports'] = 'Ports';
72d8ced3
DO
127$tab['object']['ipv4'] = 'IPv4';
128$tab['object']['nat4'] = 'NATv4';
46f92ff7 129$tab['object']['livevlans'] = 'Live VLANs';
9c67f713 130$tab['object']['snmpportfinder'] = 'SNMP port finder';
0dfaea8e 131$tab['object']['editrspvs'] = 'RS pools';
c030232f 132$tab['object']['lvsconfig'] = 'LVS config';
118e4c38 133$tab['object']['autoports'] = 'AutoPorts';
2fb24351 134$tab['object']['tags'] = 'Tags';
e1ae3fb4 135$tab['object']['files'] = 'Files';
e45a78d7
DO
136$tabhandler['object']['default'] = 'renderRackObject';
137$tabhandler['object']['edit'] = 'renderEditObjectForm';
138$tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
139$tabhandler['object']['ports'] = 'renderPortsForObject';
72d8ced3
DO
140$tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
141$tabhandler['object']['nat4'] = 'renderNATv4ForObject';
46f92ff7 142$tabhandler['object']['livevlans'] = 'renderVLANMembership';
e45a78d7 143$tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
3ee1252b 144$tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
118e4c38 145$tabhandler['object']['autoports'] = 'renderAutoPortsForm';
482c7f35
DO
146$tabhandler['object']['tags'] = 'renderEntityTags';
147$tabhandler['object']['files'] = 'renderFilesForEntity';
0dfaea8e 148$tabhandler['object']['editrspvs'] = 'renderObjectSLB';
08b16bf5
DO
149$tabextraclass['object']['snmpportfinder'] = 'attn';
150$tabextraclass['object']['autoports'] = 'attn';
72d8ced3
DO
151$trigger['object']['ipv4'] = 'trigger_ipv4';
152$trigger['object']['nat4'] = 'trigger_natv4';
46f92ff7 153$trigger['object']['livevlans'] = 'trigger_livevlans';
9c67f713 154$trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
0dfaea8e 155$trigger['object']['editrspvs'] = 'trigger_natv4';
094bb33c 156$trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
118e4c38 157$trigger['object']['autoports'] = 'trigger_autoports';
91dbb8a3 158$trigger['object']['tags'] = 'trigger_tags';
4fbb5a00 159$ophandler['object']['rackspace']['updateObjectAllocation'] = 'updateObjectAllocation';
e673ee24
DO
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';
72d8ced3
DO
167$ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
168$ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
169$ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
22bb04da 170$ophandler['object']['edit']['clearSticker'] = 'clearSticker';
22bb04da 171$ophandler['object']['edit']['update'] = 'updateObject';
72d8ced3
DO
172$ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
173$ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
174$ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
46f92ff7 175$ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
f3f0161f 176$ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
3355ca56 177$ophandler['object']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 178$ophandler['object']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
179$ophandler['object']['files']['linkFile'] = 'linkFileToEntity';
180$ophandler['object']['files']['unlinkFile'] = 'unlinkFile';
181$ophandler['object']['files']['deleteFile'] = 'deleteFile';
0dfaea8e
DO
182$ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
183$ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
184$ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
2987fc1f 185$ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
7056988c 186$ophandler['object']['snmpportfinder']['querySNMPData'] = 'querySNMPData';
46f92ff7 187$delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
135080d8
DO
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;
c8187437
DY
232$msgcode['deleteRack']['OK'] = 79;
233$msgcode['deleteRack']['ERR'] = 100;
234$msgcode['deleteRack']['ERR1'] = 206;
e673ee24 235
eebf9145 236$page['ipv4space']['title'] = 'IPv4 space';
e673ee24
DO
237$page['ipv4space']['parent'] = 'index';
238$tab['ipv4space']['default'] = 'Browse';
0bcdc163 239$tab['ipv4space']['newrange'] = 'Manage';
04d619d0
DO
240$tabhandler['ipv4space']['default'] = 'renderIPv4Space';
241$tabhandler['ipv4space']['newrange'] = 'renderIPv4SpaceEditor';
42023f03
DO
242$ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
243$ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
04d619d0 244$ophandler['ipv4space']['newrange']['updIPv4Prefix'] = 'updIPv4Prefix';
135080d8
DO
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;
e673ee24 253
e1ae3fb4
AD
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';
482c7f35
DO
268$tabhandler['ipv4net']['tags'] = 'renderEntityTags';
269$tabhandler['ipv4net']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
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';
e1ae3fb4
AD
275$ophandler['ipv4net']['files']['linkFile'] = 'linkFileToEntity';
276$ophandler['ipv4net']['files']['unlinkFile'] = 'unlinkFile';
277$ophandler['ipv4net']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
278$msgcode['updIPv4Prefix']['OK'] = 25;
279$msgcode['updIPv4Prefix']['ERR'] = 100;
280$msgcode['importPTRData']['OK'] = 26;
281$msgcode['importPTRData']['ERR'] = 141;
e673ee24 282
eebf9145 283$page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
e1ae3fb4 284$page['ipaddress']['parent'] = 'ipv4net';
e673ee24 285$page['ipaddress']['bypass'] = 'ip';
1fbc9fd6 286$page['ipaddress']['bypass_type'] = 'inet4';
d817ba03 287$page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
e673ee24
DO
288$tab['ipaddress']['default'] = 'Browse';
289$tab['ipaddress']['properties'] = 'Properties';
290$tab['ipaddress']['assignment'] = 'Allocation';
7e13adfe 291$tab['ipaddress']['editrslist'] = '[SLB real servers]';
2d318652
DO
292$tabhandler['ipaddress']['default'] = 'renderIPv4Address';
293$tabhandler['ipaddress']['properties'] = 'renderIPv4AddressProperties';
294$tabhandler['ipaddress']['assignment'] = 'renderIPv4AddressAllocations';
1fbc9fd6 295$tabhandler['ipaddress']['editrslist'] = 'dragon';
e673ee24 296$ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
b4c1ef87
DO
297$ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
298$ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
299$ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
135080d8
DO
300$msgcode['editAddress']['OK'] = 27;
301$msgcode['editAddress']['ERR'] = 100;
e673ee24 302
f973f491
DO
303$page['ipv4slb']['title'] = 'IPv4 SLB';
304$page['ipv4slb']['parent'] = 'index';
305$page['ipv4slb']['handler'] = 'renderIPv4SLB';
306
a239e016
DO
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';
135080d8
DO
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;
b3c50e6c 323
2bb798a3
DO
324$page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
325$page['ipv4vs']['parent'] = 'ipv4vslist';
49fb2686 326$page['ipv4vs']['bypass'] = 'vs_id';
2bb798a3
DO
327$page['ipv4vs']['bypass_type'] = 'uint';
328$page['ipv4vs']['tagloader'] = 'loadIPv4VSTags';
329$page['ipv4vs']['autotagloader'] = 'loadIPv4VSAutoTags';
330$tab['ipv4vs']['default'] = 'View';
c9890988 331$tab['ipv4vs']['edit'] = 'Edit';
49fb2686 332$tab['ipv4vs']['editlblist'] = 'Load balancers';
2bb798a3 333$tab['ipv4vs']['tags'] = 'Tags';
e1ae3fb4 334$tab['ipv4vs']['files'] = 'Files';
2bb798a3
DO
335$tabhandler['ipv4vs']['default'] = 'renderVirtualService';
336$tabhandler['ipv4vs']['edit'] = 'renderEditVService';
49fb2686 337$tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
482c7f35
DO
338$tabhandler['ipv4vs']['tags'] = 'renderEntityTags';
339$tabhandler['ipv4vs']['files'] = 'renderFilesForEntity';
e1ae3fb4 340$trigger['ipv4vs']['tags'] = 'trigger_tags';
e02e1941 341$ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
49fb2686
DO
342$ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
343$ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
344$ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
e1ae3fb4
AD
345$ophandler['ipv4vs']['tags']['saveTags'] = 'saveEntityTags';
346$ophandler['ipv4vs']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
347$ophandler['ipv4vs']['files']['linkFile'] = 'linkFileToEntity';
348$ophandler['ipv4vs']['files']['unlinkFile'] = 'unlinkFile';
349$ophandler['ipv4vs']['files']['deleteFile'] = 'deleteFile';
c9b4588f 350
ee437dab
DO
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';
135080d8
DO
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;
e1ae3fb4
AD
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';
482c7f35
DO
387$tabhandler['ipv4rspool']['tags'] = 'renderEntityTags';
388$tabhandler['ipv4rspool']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
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';
e1ae3fb4
AD
400$ophandler['ipv4rspool']['files']['linkFile'] = 'linkFileToEntity';
401$ophandler['ipv4rspool']['files']['unlinkFile'] = 'unlinkFile';
402$ophandler['ipv4rspool']['files']['deleteFile'] = 'deleteFile';
135080d8
DO
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;
71b8bda1 414
8253d9f0 415$page['rservers']['title'] = 'Real servers';
f973f491 416$page['rservers']['parent'] = 'ipv4slb';
8253d9f0 417$page['rservers']['handler'] = 'renderRealServerList';
b3c50e6c 418
4b0932b6 419$page['lbs']['title'] = 'Load balancers';
f973f491 420$page['lbs']['parent'] = 'ipv4slb';
4b0932b6 421$page['lbs']['handler'] = 'renderLBList';
b3c50e6c 422
eebf9145 423$page['search']['title_handler'] = 'dynamic_title_search';
3aeb15f3 424$page['search']['handler'] = 'renderSearchResults';
e673ee24
DO
425$page['search']['parent'] = 'index';
426$page['search']['bypass'] = 'q';
427
eebf9145 428$page['config']['title'] = 'Configuration';
3aeb15f3 429$page['config']['handler'] = 'renderConfigMainpage';
e673ee24
DO
430$page['config']['parent'] = 'index';
431
82627005
DO
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';
135080d8
DO
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;
82627005
DO
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';
da958e52 451$page['user']['autotagloader'] = 'getUserAutoTags';
82627005 452$tab['user']['default'] = 'View';
82627005 453$tab['user']['tags'] = 'Tags';
e1ae3fb4 454$tab['user']['files'] = 'Files';
82627005 455$tabhandler['user']['default'] = 'renderUser';
482c7f35
DO
456$tabhandler['user']['tags'] = 'renderEntityTags';
457$tabhandler['user']['files'] = 'renderFilesForEntity';
3355ca56 458$ophandler['user']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 459$ophandler['user']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
460$ophandler['user']['files']['linkFile'] = 'linkFileToEntity';
461$ophandler['user']['files']['unlinkFile'] = 'unlinkFile';
462$ophandler['user']['files']['deleteFile'] = 'deleteFile';
e673ee24 463
eebf9145 464$page['perms']['title'] = 'Permissions';
e673ee24
DO
465$page['perms']['parent'] = 'config';
466$tab['perms']['default'] = 'View';
82627005
DO
467$tab['perms']['edit'] = 'Edit';
468$tabhandler['perms']['default'] = 'renderRackCodeViewer';
469$tabhandler['perms']['edit'] = 'renderRackCodeEditor';
470$ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
135080d8
DO
471$msgcode['saveRackCode']['OK'] = 43;
472$msgcode['saveRackCode']['ERR1'] = 154;
473$msgcode['saveRackCode']['ERR2'] = 155;
e673ee24 474
eebf9145 475$page['portmap']['title'] = 'Port compatibility map';
e673ee24
DO
476$page['portmap']['parent'] = 'config';
477$tab['portmap']['default'] = 'View';
478$tab['portmap']['edit'] = 'Change';
17c32f4c
DO
479$tabhandler['portmap']['default'] = 'renderPortMapViewer';
480$tabhandler['portmap']['edit'] = 'renderPortMapEditor';
e673ee24 481$ophandler['portmap']['edit']['save'] = 'savePortMap';
135080d8
DO
482$msgcode['savePortMap']['OK'] = 44;
483$msgcode['savePortMap']['ERR'] = 108;
e673ee24 484
eebf9145 485$page['attrs']['title'] = 'Attributes';
e673ee24
DO
486$page['attrs']['parent'] = 'config';
487$tab['attrs']['default'] = 'View';
488$tab['attrs']['editattrs'] = 'Edit attributes';
489$tab['attrs']['editmap'] = 'Edit map';
8b6ffe9c
DO
490$tabhandler['attrs']['default'] = 'renderAttributes';
491$tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
492$tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
e673ee24
DO
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';
135080d8
DO
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;
e673ee24 508
eebf9145 509$page['dict']['title'] = 'Dictionary';
e673ee24
DO
510$page['dict']['parent'] = 'config';
511$tab['dict']['default'] = 'View';
e673ee24 512$tab['dict']['chapters'] = 'Manage chapters';
8b6ffe9c 513$tabhandler['dict']['default'] = 'renderDictionary';
8b6ffe9c 514$tabhandler['dict']['chapters'] = 'renderChaptersEditor';
e673ee24
DO
515$ophandler['dict']['chapters']['del'] = 'delChapter';
516$ophandler['dict']['chapters']['upd'] = 'updateChapter';
517$ophandler['dict']['chapters']['add'] = 'addChapter';
135080d8
DO
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;
e673ee24 524
4034ab9e
DO
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
eebf9145 543$page['ui']['title'] = 'User interface';
e673ee24 544$page['ui']['parent'] = 'config';
0a1b1268 545$tab['ui']['default'] = 'View';
4fe32e78 546$tab['ui']['edit'] = 'Change';
b07f617c 547$tab['ui']['reset'] = 'Reset';
8b6ffe9c
DO
548$tabhandler['ui']['default'] = 'renderUIConfig';
549$tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
550$tabhandler['ui']['reset'] = 'renderUIResetForm';
4fe32e78 551$ophandler['ui']['edit']['upd'] = 'updateUI';
b07f617c 552$ophandler['ui']['reset']['go'] = 'resetUIConfig';
135080d8
DO
553$msgcode['updateUI']['OK'] = 56;
554$msgcode['updateUI']['ERR'] = 125;
555$msgcode['resetUIConfig']['OK'] = 57;
e673ee24 556
931bf334
DO
557$page['tagtree']['title'] = 'Tag tree';
558$page['tagtree']['parent'] = 'config';
559$tab['tagtree']['default'] = 'View';
49fb1027 560$tab['tagtree']['edit'] = 'Edit';
931bf334
DO
561$tabhandler['tagtree']['default'] = 'renderTagTree';
562$tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
fe7044ad
DO
563$ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
564$ophandler['tagtree']['edit']['createTag'] = 'createTag';
565$ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
135080d8
DO
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;
931bf334 575
9457ca59
DO
576$page['myaccount']['title'] = 'My account';
577$page['myaccount']['parent'] = 'config';
578$tab['myaccount']['default'] = 'Info';
0ac7e4b3
DO
579$tab['myaccount']['mypassword'] = 'Password change';
580$tab['myaccount']['myrealname'] = '[Real name change]';
581$trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
9457ca59
DO
582$tabhandler['myaccount']['default'] = 'renderMyAccount';
583$tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
0ac7e4b3 584$tabhandler['myaccount']['myrealname'] = 'dragon';
9457ca59 585$ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
135080d8
DO
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;
9457ca59 591
eebf9145 592$page['reports']['title'] = 'Reports';
e673ee24 593$page['reports']['parent'] = 'index';
e5c4506d 594$tab['reports']['default'] = 'System';
88d513cd 595$tab['reports']['rackcode'] = 'RackCode';
09620506 596$tab['reports']['ipv4'] = 'IPv4';
e5c4506d
DO
597$tab['reports']['local'] = 'Local';
598$trigger['reports']['local'] = 'trigger_localreports';
599$tabhandler['reports']['default'] = 'renderSystemReports';
88d513cd 600$tabhandler['reports']['rackcode'] = 'renderRackCodeReports';
09620506 601$tabhandler['reports']['ipv4'] = 'renderIPv4Reports';
e5c4506d 602$tabhandler['reports']['local'] = 'renderLocalReports';
e673ee24 603
e1ae3fb4
AD
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';
135080d8
DO
611$msgcode['addFileWithoutLink']['OK'] = 69;
612$msgcode['addFileWithoutLink']['ERR'] = 100;
e1ae3fb4
AD
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
cd35db83 621$page['file']['title_handler'] = 'dynamic_title_file';
e1ae3fb4
AD
622$page['file']['bypass'] = 'file_id';
623$page['file']['bypass_type'] = 'uint';
f4d879a9 624$page['file']['parent'] = 'files';
e1ae3fb4
AD
625$page['file']['tagloader'] = 'loadFileTags';
626$page['file']['autotagloader'] = 'loadFileAutoTags';
627$tab['file']['default'] = 'View';
6ee41bd4 628$tab['file']['edit'] = 'Properties';
e1ae3fb4 629$tab['file']['tags'] = 'Tags';
8628ae44 630$tab['file']['editText'] = 'Edit text';
db55cf54 631$tab['file']['replaceData'] = 'Upload replacement';
e1ae3fb4 632$trigger['file']['tags'] = 'trigger_tags';
8628ae44 633$trigger['file']['editText'] = 'trigger_file_editText';
e1ae3fb4 634$tabhandler['file']['default'] = 'renderFile';
6ee41bd4
DO
635$tabhandler['file']['edit'] = 'renderFileProperties';
636$tabhandler['file']['tags'] = 'renderEntityTags';
8628ae44 637$tabhandler['file']['editText'] = 'renderTextEditor';
db55cf54 638$tabhandler['file']['replaceData'] = 'renderFileReuploader';
6ee41bd4 639$ophandler['file']['edit']['updateFile'] = 'updateFile';
e1ae3fb4 640$ophandler['file']['tags']['saveTags'] = 'saveEntityTags';
8628ae44 641$ophandler['file']['editText']['updateFileText'] = 'updateFileText';
db55cf54
DO
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;
8628ae44 647$msgcode['updateFileText']['OK'] = 78;
70cb9b56
DO
648$msgcode['updateFileText']['ERR1'] = 179;
649$msgcode['updateFileText']['ERR2'] = 180;
e1ae3fb4 650
e673ee24
DO
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.
654function 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
669function showPathAndSearch ($pageno)
670{
9c0b0016 671 global $root, $page;
e673ee24 672 // Path.
73635d32 673 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
eebf9145
DO
674 $path = getPath ($pageno);
675 foreach ($path as $no)
e673ee24 676 {
eebf9145
DO
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]';
52c836b1 684 echo ": <a href='${root}?page=${no}&tab=default";
eebf9145
DO
685 foreach ($title['params'] as $param_name => $param_value)
686 echo "&${param_name}=${param_value}";
687 echo "'>" . $title['name'] . "</a>";
e673ee24
DO
688 }
689 echo "</td>";
690 // Search form.
691 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
e09e31d5 692 echo "<form name=search method=get action='${root}'><td>";
e673ee24
DO
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
698function getTitle ($pageno, $tabno)
699{
9c0b0016 700 global $page;
eebf9145
DO
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
9c0b0016 709 return getConfigVar ('enterprise');
e673ee24
DO
710}
711
712function showTabs ($pageno, $tabno)
713{
08b16bf5 714 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
e673ee24
DO
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.
810e3422 721 if (!permitted ($pageno, $tabidx))
e673ee24 722 continue;
641fe9b0 723 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
545eaaca
DO
724 if (isset ($trigger[$pageno][$tabidx]))
725 {
545eaaca 726 $ok = $trigger[$pageno][$tabidx] ();
545eaaca
DO
727 if (!$ok)
728 continue;
729 }
08b16bf5
DO
730 $class = ($tabidx == $tabno) ? 'current' : 'std';
731 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
732 echo "<li><a class=${class}{$extra}";
e673ee24
DO
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.
747function 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
00f887f4 755 $cpage['parent'] == $pageno
e673ee24
DO
756 )
757 $children[$cpageno] = $cpage;
758 return $children;
759}
760
761function 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?>