]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
removed a warning when creating the pages menu tree
authorCash Costello <cash.costello@gmail.com>
Tue, 3 Jul 2012 01:02:51 +0000 (21:02 -0400)
committerCash Costello <cash.costello@gmail.com>
Tue, 3 Jul 2012 01:02:51 +0000 (21:02 -0400)
mod/pages/lib/pages.php

index 3f27118a6d2c6fd14a695aa7cfbc5b78ff158010..9a9ba12e92283154c73efb515639face22fb3dca 100644 (file)
@@ -103,16 +103,18 @@ function pages_register_navigation_tree($container) {
                                'metadata_value' => $parent->getGUID(),
                                'limit' => 0,
                        ));
-                       
-                       foreach ($children as $child) {
-                               elgg_register_menu_item('pages_nav', array(
-                                       'name' => $child->getGUID(),
-                                       'text' => $child->title,
-                                       'href' => $child->getURL(),
-                                       'parent_name' => $parent->getGUID(),
-                               ));
-                               array_push($stack, $child);
+
+                       if ($children) {
+                               foreach ($children as $child) {
+                                       elgg_register_menu_item('pages_nav', array(
+                                               'name' => $child->getGUID(),
+                                               'text' => $child->title,
+                                               'href' => $child->getURL(),
+                                               'parent_name' => $parent->getGUID(),
+                                       ));
+                                       array_push($stack, $child);
+                               }
                        }
                }
        }
-}
\ No newline at end of file
+}