cvs: php4 /pear/Experimental/HTML Menu.php

From: Date: Tue, 13 Mar 2001 22:03:29 +0000
Subject: cvs: php4 /pear/Experimental/HTML Menu.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4553@lists.php.net to get a copy of this message
uw Tue Mar 13 14:03:29 2001 EDT Modified files: /php4/pear/Experimental/HTML Menu.php Log: API change: replaced getSitemap() with get("sitemap") Index: php4/pear/Experimental/HTML/Menu.php diff -u php4/pear/Experimental/HTML/Menu.php:1.7 php4/pear/Experimental/HTML/Menu.php:1.8 --- php4/pear/Experimental/HTML/Menu.php:1.7 Tue Mar 13 13:49:04 2001 +++ php4/pear/Experimental/HTML/Menu.php Tue Mar 13 14:03:28 2001 @@ -149,7 +149,7 @@ /** * Returns the HTML menu. * - * @param string Menu type: tree, urhere, rows, prevnext + * @param string Menu type: tree, urhere, rows, prevnext, sitemap * @return string HTML of the menu * @access public */ @@ -165,8 +165,17 @@ // storing to a class variable saves some recursion overhead $this->path = $this->getPath(); - $this->buildMenu($this->menu); - + + if ("sitemap" == $this->menu_type) { + + $this->setMenuType("tree"); + $this->buildSitemap($this->menu); + $this->setMenuType("sitemap"); + + } else { + $this->buildMenu($this->menu); + } + if ("rows" != $this->menu_type) $this->html .= $this->getEnd(); @@ -184,28 +193,7 @@ print $this->get($menu_type); } // end func show - /** - * Returns a sitemap. - * - * @return string HTML code - * @access public - */ - function getSitemap() { - - $oldtype = $this->menu_type; - $this->setMenuType("tree"); - - $this->html = $this->getStart(); - - $this->path = $this->getPath(); - $this->buildSitemap($this->menu); - $this->setMenuType($oldtype); - - return $this->html . $this->getEnd(); - } // end func getSitemap - - /** * Returns the prefix of the HTML menu items. * @@ -223,6 +211,7 @@ case "tree": case "urhere": + case "sitemap": $html .= "<table border>"; break; } @@ -248,6 +237,7 @@ case "tree": case "urhere": + case "sitemap": $html = "</table>"; break; }

« previous php.cvs (#4553) next »