Index: library/Zend/Navigation/Container.php =================================================================== --- library/Zend/Navigation/Container.php (revision 24447) +++ library/Zend/Navigation/Container.php (working copy) @@ -143,21 +143,29 @@ /** * Adds several pages at once * - * @param array|Zend_Config $pages pages to add - * @return Zend_Navigation_Container fluent interface, returns self - * @throws Zend_Navigation_Exception if $pages is not array or Zend_Config + * @param array|Zend_Config|Zend_Navigation_Container $pages pages to add + * @return Zend_Navigation_Container fluent interface, + * returns self + * @throws Zend_Navigation_Exception if $pages is not + * array, Zend_Config or + * Zend_Navigation_Container */ public function addPages($pages) { if ($pages instanceof Zend_Config) { $pages = $pages->toArray(); } + + if ($pages instanceof Zend_Navigation_Container) { + $pages = iterator_to_array($pages); + } if (!is_array($pages)) { require_once 'Zend/Navigation/Exception.php'; throw new Zend_Navigation_Exception( - 'Invalid argument: $pages must be an array or an ' . - 'instance of Zend_Config'); + 'Invalid argument: $pages must be an array, an ' . + 'instance of Zend_Config or an instance of ' . + 'Zend_Navigation_Container'); } foreach ($pages as $page) { @@ -215,7 +223,7 @@ unset($this->_index[$hash]); $this->_dirtyIndex = true; return true; - } + } return false; }