/** * Recursively add pages to the container * * @param Zoo_Object_Tree $tree * @param Zend_Navigation_Container $container * @param int $key * @return void */ function treeToPageContainer(&$tree, Zend_Navigation_Page $container, $key = 0) { $children = $tree->getFirstChild($key); foreach ($children as $child) { $page = $this->nodeToPage($child); $container->addPage($page); $this->treeToPageContainer($tree, $page, $child->id); } }
/** * Add resources to ACL from a Zoo_Object_Tree * * @param Zoo_Object_Tree $tree */ function addResourcesFromTree(Zoo_Object_Tree $tree, $id = 0) { foreach ($tree->getFirstChild($id) as $role) { if ($role->parent == 0) { $this->service->add($role); } else { $this->service->add($role, $tree->getByKey($role->parent)); } $this->addResourcesFromTree($tree, $role->id); } }