r1837 + fix browsing "all" 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
14 $page['index']['title'] = 'Main page';
15 $page['index']['handler'] = 'renderIndex';
16
17 $page['rackspace']['title'] = 'Rackspace';
18 $page['rackspace']['parent'] = 'index';
19 $tab['rackspace']['default'] = 'Browse';
20 $tab['rackspace']['history'] = 'History';
21 $tab['rackspace']['firstrow'] = 'Click me!';
22 $trigger['rackspace']['firstrow'] = 'trigger_emptyRackspace';
23 $tabhandler['rackspace']['default'] = 'renderRackspace';
24 $tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
25 $tabhandler['rackspace']['firstrow'] = 'renderFirstRowForm';
26 $tabextraclass['rackspace']['firstrow'] = 'attn';
27
28 $page['objects']['title'] = 'Objects';
29 $page['objects']['parent'] = 'index';
30 $tab['objects']['default'] = 'View';
31 $tab['objects']['newobj'] = 'Add an object';
32 $tab['objects']['newmulti'] = 'Add multiple objects';
33 $tabhandler['objects']['default'] = 'renderObjectSpace';
34 $tabhandler['objects']['newobj'] = 'renderNewObjectForm';
35 $tabhandler['objects']['newmulti'] = 'renderAddMultipleObjectsForm';
36
37 $page['row']['title_handler'] = 'dynamic_title_row';
38 $page['row']['bypass'] = 'row_id';
39 $page['row']['bypass_type'] = 'uint';
40 $page['row']['parent'] = 'rackspace';
41 $tab['row']['default'] = 'View';
42 $tab['row']['newrack'] = 'Add new rack';
43 $tabhandler['row']['default'] = 'renderRow';
44 $tabhandler['row']['newrack'] = 'renderNewRackForm';
45
46 $page['rack']['title_handler'] = 'dynamic_title_rack';
47 $page['rack']['bypass'] = 'rack_id';
48 $page['rack']['bypass_type'] = 'uint';
49 $page['rack']['parent'] = 'row';
50 $page['rack']['tagloader'] = 'loadRackTags';
51 $page['rack']['autotagloader'] = 'loadRackAutoTags';
52 $tab['rack']['default'] = 'View';
53 $tab['rack']['edit'] = 'Properties';
54 $tab['rack']['design'] = 'Design';
55 $tab['rack']['problems'] = 'Problems';
56 $tab['rack']['tags'] = 'Tags';
57 $tabhandler['rack']['default'] = 'renderRackPage';
58 $tabhandler['rack']['edit'] = 'renderEditRackForm';
59 $tabhandler['rack']['design'] = 'renderRackDesign';
60 $tabhandler['rack']['problems'] = 'renderRackProblems';
61 $tabhandler['rack']['tags'] = 'renderRackTags';
62 $trigger['rack']['tags'] = 'trigger_tags';
63 $ophandler['rack']['tags']['save'] = 'saveRackTags';
64
65 $page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
66 $page['objgroup']['handler'] = 'renderObjectGroup';
67 $page['objgroup']['bypass'] = 'group_id';
68 $page['objgroup']['bypass_type'] = 'uint0';
69 $page['objgroup']['parent'] = 'objects';
70
71 $page['object']['title_handler'] = 'dynamic_title_object';
72 $page['object']['bypass'] = 'object_id';
73 $page['object']['bypass_type'] = 'uint';
74 $page['object']['parent'] = 'objgroup';
75 $page['object']['tagloader'] = 'loadRackObjectTags';
76 $page['object']['autotagloader'] = 'loadRackObjectAutoTags';
77 $tab['object']['default'] = 'View';
78 $tab['object']['edit'] = 'Properties';
79 $tab['object']['rackspace'] = 'Rackspace';
80 $tab['object']['ports'] = 'Ports';
81 $tab['object']['network'] = 'IPv4';
82 $tab['object']['portfwrd'] = 'NATv4';
83 $tab['object']['switchvlans'] = 'Live VLANs';
84 $tab['object']['snmpportfinder'] = 'SNMP port finder';
85 $tab['object']['slb'] = '[SLB]';
86 $tab['object']['lvsconfig'] = 'LVS configuration';
87 $tab['object']['autoports'] = 'AutoPorts';
88 $tab['object']['tags'] = 'Tags';
89 $tabhandler['object']['default'] = 'renderRackObject';
90 $tabhandler['object']['edit'] = 'renderEditObjectForm';
91 $tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
92 $tabhandler['object']['ports'] = 'renderPortsForObject';
93 $tabhandler['object']['network'] = 'renderNetworkForObject';
94 $tabhandler['object']['portfwrd'] = 'renderIPAddressPortForwarding';
95 $tabhandler['object']['switchvlans'] = 'renderVLANMembership';
96 $tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
97 $tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
98 $tabhandler['object']['autoports'] = 'renderAutoPortsForm';
99 $tabhandler['object']['tags'] = 'renderObjectTags';
100 $tabextraclass['object']['snmpportfinder'] = 'attn';
101 $tabextraclass['object']['autoports'] = 'attn';
102 $trigger['object']['network'] = 'trigger_ipv4';
103 $trigger['object']['portfwrd'] = 'trigger_natv4';
104 $trigger['object']['switchvlans'] = 'trigger_switchvlans';
105 $trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
106 $trigger['object']['slb'] = 'trigger_natv4';
107 $trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
108 $trigger['object']['autoports'] = 'trigger_autoports';
109 $trigger['object']['tags'] = 'trigger_tags';
110 $ophandler['object']['ports']['addPort'] = 'addPortForObject';
111 $ophandler['object']['ports']['delPort'] = 'delPortFromObject';
112 $ophandler['object']['ports']['editPort'] = 'editPortForObject';
113 $ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
114 $ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
115 $ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
116 $ophandler['object']['ports']['useup'] = 'useupPort';
117 $ophandler['object']['network']['editAddressFromObject'] = 'editAddressFromObject';
118 $ophandler['object']['network']['addAddrFObj'] = 'addAddressToObject';
119 $ophandler['object']['network']['delAddrFObj'] = 'delAddressFromObject';
120 $ophandler['object']['edit']['del'] = 'resetAttrValue';
121 $ophandler['object']['edit']['upd'] = 'updateAttrValues';
122 $ophandler['object']['portfwrd']['forwardPorts'] = 'addPortForwarding';
123 $ophandler['object']['portfwrd']['delPortForwarding'] = 'delPortForwarding';
124 $ophandler['object']['portfwrd']['updPortForwarding'] = 'updPortForwarding';
125 $ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
126 $ophandler['object']['tags']['save'] = 'saveObjectTags';
127
128 $page['ipv4space']['title'] = 'IPv4 space';
129 $page['ipv4space']['parent'] = 'index';
130 $tab['ipv4space']['default'] = 'Browse';
131 $tab['ipv4space']['newrange'] = 'Manage';
132 $tabhandler['ipv4space']['default'] = 'renderAddressspace';
133 $tabhandler['ipv4space']['newrange'] = 'renderAddNewRange';
134 $ophandler['ipv4space']['newrange']['addRange'] = 'addNewrange';
135 $ophandler['ipv4space']['newrange']['delRange'] = 'delRange';
136
137 $page['iprange']['title_handler'] = 'dynamic_title_iprange';
138 $page['iprange']['parent'] = 'ipv4space';
139 $page['iprange']['bypass'] = 'id';
140 $page['iprange']['bypass_type'] = 'uint';
141 $page['iprange']['autotagloader'] = 'loadIPv4PrefixAutoTags';
142 $page['iprange']['tagloader'] = 'loadIPv4PrefixTags';
143 $tab['iprange']['default'] = 'Browse';
144 $tab['iprange']['properties'] = 'Properties';
145 $tab['iprange']['liveptr'] = 'Live PTR';
146 $tab['iprange']['tags'] = 'Tags';
147 $tabhandler['iprange']['default'] = 'renderIPRange';
148 $tabhandler['iprange']['properties'] = 'renderIPRangeProperties';
149 $tabhandler['iprange']['liveptr'] = 'renderLivePTR';
150 $tabhandler['iprange']['tags'] = 'renderIPv4PrefixTags';
151 $trigger['iprange']['tags'] = 'trigger_tags';
152 $ophandler['iprange']['properties']['editRange'] = 'editRange';
153 $ophandler['iprange']['liveptr']['import'] = 'importPTRData';
154 $ophandler['iprange']['tags']['save'] = 'saveIPv4PrefixTags';
155
156 $page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
157 $page['ipaddress']['parent'] = 'iprange';
158 $page['ipaddress']['bypass'] = 'ip';
159 $page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
160 $tab['ipaddress']['default'] = 'Browse';
161 $tab['ipaddress']['properties'] = 'Properties';
162 $tab['ipaddress']['assignment'] = 'Allocation';
163 $tab['ipaddress']['editrslist'] = '[SLB real servers]';
164 $tabhandler['ipaddress']['default'] = 'renderIPAddress';
165 $tabhandler['ipaddress']['properties'] = 'renderIPAddressProperties';
166 $tabhandler['ipaddress']['assignment'] = 'renderIPAddressAssignment';
167 $ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
168 $ophandler['ipaddress']['assignment']['delIpAssignment'] = 'delIpAssignment';
169 $ophandler['ipaddress']['assignment']['editBondForAddress'] = 'editIpAssignment';
170 $ophandler['ipaddress']['assignment']['bindObjectToIp'] = 'addIpAssignment';
171
172 $page['ipv4slb']['title'] = 'IPv4 SLB';
173 $page['ipv4slb']['parent'] = 'index';
174 $page['ipv4slb']['handler'] = 'renderIPv4SLB';
175
176 $page['vservices']['title'] = 'Virtual services';
177 $page['vservices']['parent'] = 'ipv4slb';
178 $tab['vservices']['default'] = 'View';
179 $tab['vservices']['edit'] = 'Edit';
180 $tabhandler['vservices']['default'] = 'renderVSList';
181 $tabhandler['vservices']['edit'] = 'renderVSListEditForm';
182 $ophandler['vservices']['edit']['add'] = 'addVService';
183 $ophandler['vservices']['edit']['del'] = 'deleteVService';
184 $ophandler['vservices']['edit']['upd'] = 'updateVService';
185
186 $page['vservice']['title_handler'] = 'dynamic_title_vservice';
187 $page['vservice']['parent'] = 'vservices';
188 $page['vservice']['bypass'] = 'id';
189 $page['vservice']['bypass_type'] = 'uint';
190 $page['vservice']['tagloader'] = 'loadIPv4VSTags';
191 $page['vservice']['autotagloader'] = 'loadIPv4VSAutoTags';
192 $tab['vservice']['default'] = 'View';
193 $tab['vservice']['edit'] = '[Edit]';
194 $tab['vservice']['editlblist'] = '[Load balancers]';
195 $tab['vservice']['tags'] = 'Tags';
196 $tabhandler['vservice']['default'] = 'renderVirtualService';
197 $tabhandler['vservice']['tags'] = 'renderIPv4VSTags';
198 $ophandler['vservice']['tags']['save'] = 'saveIPv4VSTags';
199 $trigger['vservice']['tags'] = 'trigger_tags';
200
201 $page['rspools']['title'] = 'RS pools';
202 $page['rspools']['parent'] = 'ipv4slb';
203 $tab['rspools']['default'] = 'View';
204 $tab['rspools']['edit'] = 'Edit';
205 $tabhandler['rspools']['default'] = 'renderRSPoolList';
206 $tabhandler['rspools']['edit'] = 'editRSPools';
207 $ophandler['rspools']['edit']['add'] = 'addRSPool';
208 $ophandler['rspools']['edit']['del'] = 'deleteRSPool';
209 $ophandler['rspools']['edit']['upd'] = 'updateRSPool';
210
211 $page['rspool']['title_handler'] = 'dynamic_title_rspool';
212 $page['rspool']['parent'] = 'rspools';
213 $page['rspool']['bypass'] = 'pool_id';
214 $page['rspool']['bypass_type'] = 'uint';
215 $page['rspool']['tagloader'] = 'loadIPv4RSPoolTags';
216 $page['rspool']['autotagloader'] = 'loadIPv4RSPoolAutoTags';
217 $tab['rspool']['default'] = 'View';
218 $tab['rspool']['edit'] = '[Edit]';
219 $tab['rspool']['editlblist'] = 'Load Balancers';
220 $tab['rspool']['editrslist'] = 'RS list';
221 $tab['rspool']['rsinservice'] = 'RS in service';
222 $tab['rspool']['tags'] = 'Tags';
223 $trigger['rspool']['rsinservice'] = 'trigger_poolrscount';
224 $trigger['rspool']['tags'] = 'trigger_tags';
225 $tabhandler['rspool']['default'] = 'renderRSPool';
226 $tabhandler['rspool']['editrslist'] = 'renderRSPoolServerForm';
227 $tabhandler['rspool']['editlblist'] = 'renderRSPoolLBForm';
228 $tabhandler['rspool']['rsinservice'] = 'renderRSPoolRSInServiceForm';
229 $tabhandler['rspool']['tags'] = 'renderIPv4RSPoolTags';
230 $ophandler['rspool']['editrslist']['addRS'] = 'addRealServer';
231 $ophandler['rspool']['editrslist']['delRS'] = 'deleteRealServer';
232 $ophandler['rspool']['editrslist']['updRS'] = 'updateRealServer';
233 $ophandler['rspool']['editrslist']['addMany'] = 'addRealServers';
234 $ophandler['rspool']['editlblist']['addLB'] = 'addLoadBalancer';
235 $ophandler['rspool']['editlblist']['delLB'] = 'deleteLoadBalancer';
236 $ophandler['rspool']['editlblist']['updLB'] = 'updateLoadBalancer';
237 $ophandler['rspool']['rsinservice']['upd'] = 'updateRSInService';
238 $ophandler['rspool']['tags']['save'] = 'saveIPv4RSPoolTags';
239
240 $page['rservers']['title'] = 'Real servers';
241 $page['rservers']['parent'] = 'ipv4slb';
242 $page['rservers']['handler'] = 'renderRealServerList';
243
244 $page['lbs']['title'] = 'Load balancers';
245 $page['lbs']['parent'] = 'ipv4slb';
246 $page['lbs']['handler'] = 'renderLBList';
247
248 $page['search']['title_handler'] = 'dynamic_title_search';
249 $page['search']['handler'] = 'renderSearchResults';
250 $page['search']['parent'] = 'index';
251 $page['search']['bypass'] = 'q';
252
253 $page['config']['title'] = 'Configuration';
254 $page['config']['handler'] = 'renderConfigMainpage';
255 $page['config']['parent'] = 'index';
256
257 $page['accounts']['title'] = 'Accounts';
258 $page['accounts']['parent'] = 'config';
259 $tab['accounts']['default'] = 'View';
260 $tab['accounts']['edit'] = 'Change';
261 $tabhandler['accounts']['default'] = 'renderAccounts';
262 $tabhandler['accounts']['edit'] = 'renderAccountsEditForm';
263 $ophandler['accounts']['edit']['updateAccount'] = 'updateUserAccount';
264 $ophandler['accounts']['edit']['createAccount'] = 'createUserAccount';
265 $ophandler['accounts']['edit']['disableAccount'] = 'disableUserAccount';
266 $ophandler['accounts']['edit']['enableAccount'] = 'enableUserAccount';
267
268 $page['perms']['title'] = 'Permissions';
269 $page['perms']['parent'] = 'config';
270 $tab['perms']['default'] = 'View';
271 $tab['perms']['edit'] = 'Change';
272 $tabhandler['perms']['default'] = 'renderPermissions';
273 $tabhandler['perms']['edit'] = 'renderPermissionsEditForm';
274 $ophandler['perms']['edit']['revoke'] = 'revokePermission';
275 $ophandler['perms']['edit']['grant'] = 'grantPermission';
276
277 $page['portmap']['title'] = 'Port compatibility map';
278 $page['portmap']['parent'] = 'config';
279 $tab['portmap']['default'] = 'View';
280 $tab['portmap']['edit'] = 'Change';
281 $tabhandler['portmap']['default'] = 'renderPortMapViewer';
282 $tabhandler['portmap']['edit'] = 'renderPortMapEditor';
283 $ophandler['portmap']['edit']['save'] = 'savePortMap';
284
285 $page['attrs']['title'] = 'Attributes';
286 $page['attrs']['parent'] = 'config';
287 $tab['attrs']['default'] = 'View';
288 $tab['attrs']['editattrs'] = 'Edit attributes';
289 $tab['attrs']['editmap'] = 'Edit map';
290 $tabhandler['attrs']['default'] = 'renderAttributes';
291 $tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
292 $tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
293 $ophandler['attrs']['editattrs']['add'] = 'createAttribute';
294 $ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
295 $ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
296 $ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
297 $ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
298
299 $page['dict']['title'] = 'Dictionary';
300 $page['dict']['parent'] = 'config';
301 $tab['dict']['default'] = 'View';
302 $tab['dict']['edit'] = 'Edit words';
303 $tab['dict']['chapters'] = 'Manage chapters';
304 $tabhandler['dict']['default'] = 'renderDictionary';
305 $tabhandler['dict']['edit'] = 'renderDictionaryEditor';
306 $tabhandler['dict']['chapters'] = 'renderChaptersEditor';
307 $ophandler['dict']['edit']['del'] = 'reduceDictionary';
308 $ophandler['dict']['edit']['upd'] = 'updateDictionary';
309 $ophandler['dict']['edit']['add'] = 'supplementDictionary';
310 $ophandler['dict']['chapters']['del'] = 'delChapter';
311 $ophandler['dict']['chapters']['upd'] = 'updateChapter';
312 $ophandler['dict']['chapters']['add'] = 'addChapter';
313
314 $page['ui']['title'] = 'User interface';
315 $page['ui']['parent'] = 'config';
316 $tab['ui']['default'] = 'View';
317 $tab['ui']['edit'] = 'Change';
318 $tab['ui']['reset'] = 'Reset';
319 $tabhandler['ui']['default'] = 'renderUIConfig';
320 $tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
321 $tabhandler['ui']['reset'] = 'renderUIResetForm';
322 $ophandler['ui']['edit']['upd'] = 'updateUI';
323 $ophandler['ui']['reset']['go'] = 'resetUIConfig';
324
325 $page['tagtree']['title'] = 'Tag tree';
326 $page['tagtree']['parent'] = 'config';
327 $tab['tagtree']['default'] = 'View';
328 $tab['tagtree']['edit'] = 'Change';
329 $tabhandler['tagtree']['default'] = 'renderTagTree';
330 $tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
331 $ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
332 $ophandler['tagtree']['edit']['createTag'] = 'createTag';
333 $ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
334
335 $page['reports']['title'] = 'Reports';
336 $page['reports']['parent'] = 'index';
337 $page['reports']['handler'] = 'renderReportSummary';
338
339 // This function returns array if page numbers leading to the target page
340 // plus page number of target page itself. The first element is the target
341 // page number and the last element is the index page number.
342 function getPath ($targetno)
343 {
344 global $page;
345 $path = array();
346 // Recursion breaks at first parentless page.
347 if (!isset ($page[$targetno]['parent']))
348 $path = array ($targetno);
349 else
350 {
351 $path = getPath ($page[$targetno]['parent']);
352 $path[] = $targetno;
353 }
354 return $path;
355 }
356
357 function showPathAndSearch ($pageno)
358 {
359 global $root, $page;
360 // Path.
361 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
362 $path = getPath ($pageno);
363 foreach ($path as $no)
364 {
365 $title['params'] = array();
366 if (isset ($page[$no]['title']))
367 $title['name'] = $page[$no]['title'];
368 elseif (isset ($page[$no]['title_handler']))
369 $title = $page[$no]['title_handler']($no);
370 else
371 $title['name'] = '[N/A]';
372 echo ": <a href='${root}?page=${no}";
373 foreach ($title['params'] as $param_name => $param_value)
374 echo "&${param_name}=${param_value}";
375 echo "'>" . $title['name'] . "</a>";
376 }
377 echo "</td>";
378 // Search form.
379 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
380 echo "<form name=search method=get action='${root}'><td>";
381 echo '<input type=hidden name=page value=search>';
382 // This input will be the first, if we don't add ports or addresses.
383 echo "<input type=text name=q size=20 tabindex=1000></td></form></tr></table></td>";
384 }
385
386 function getTitle ($pageno, $tabno)
387 {
388 global $page;
389 if (isset ($page[$pageno]['title']))
390 return $page[$pageno]['title'];
391 elseif (isset ($page[$pageno]['title_handler']))
392 {
393 $tmp = $page[$pageno]['title_handler']($pageno);
394 return $tmp['name'];
395 }
396 else
397 return getConfigVar ('enterprise');
398 }
399
400 function showTabs ($pageno, $tabno)
401 {
402 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
403 if (!isset ($tab[$pageno]['default']))
404 return;
405 echo "<td><div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
406 foreach ($tab[$pageno] as $tabidx => $tabtitle)
407 {
408 // Hide forbidden tabs.
409 if (authorized ($remote_username, $pageno, $tabidx) == FALSE)
410 continue;
411 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
412 if
413 (
414 isset ($trigger[$pageno][$tabidx]) &&
415 $trigger[$pageno][$tabidx] () != TRUE
416 )
417 continue;
418 $class = ($tabidx == $tabno) ? 'current' : 'std';
419 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
420 echo "<li><a class=${class}{$extra}";
421 echo " href='${root}?page=${pageno}&tab=${tabidx}";
422 if (isset ($page[$pageno]['bypass']) and isset ($_REQUEST[$page[$pageno]['bypass']]))
423 {
424 $bpname = $page[$pageno]['bypass'];
425 $bpval = $_REQUEST[$bpname];
426 echo "&${bpname}=${bpval}";
427 }
428 echo "'>${tabtitle}</a></li>\n";
429 }
430 echo "</ul></div></td>\n";
431 }
432
433 // This function returns pages, which are direct children of the requested
434 // page and are accessible by the current user.
435 function getDirectChildPages ($pageno)
436 {
437 global $page, $remote_username;
438 $children = array();
439 foreach ($page as $cpageno => $cpage)
440 if
441 (
442 isset ($cpage['parent']) and
443 $cpage['parent'] == $pageno and
444 authorized ($remote_username, $cpageno, 'default') == TRUE
445 )
446 $children[$cpageno] = $cpage;
447 return $children;
448 }
449
450 function getAllChildPages ($parent)
451 {
452 global $page;
453 // Array pointer is global, so if we don't create local copies of
454 // the global array, we can't advance any more after nested call
455 // of getAllChildPages returns.
456 $mypage = $page;
457 $mykids = array();
458 foreach ($mypage as $ctitle => $cpage)
459 if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
460 $mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
461 return $mykids;
462 }
463
464 ?>