uw              Tue Mar 13 13:49:04 2001 EDT

  Modified files:              
    /php4/pear/Experimental/HTML        Menu.php 
  Log:
  - fixed a rows bug
  - removed all \n
  
  
Index: php4/pear/Experimental/HTML/Menu.php
diff -u php4/pear/Experimental/HTML/Menu.php:1.6 
php4/pear/Experimental/HTML/Menu.php:1.7
--- php4/pear/Experimental/HTML/Menu.php:1.6    Mon Mar 12 16:18:38 2001
+++ php4/pear/Experimental/HTML/Menu.php        Tue Mar 13 13:49:04 2001
@@ -1,22 +1,4 @@
 <?php
-// +----------------------------------------------------------------------+
-// | PHP version 4.0                                                      |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.0 of the PHP license,       |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Ulf Wendel <[EMAIL PROTECTED]>                           |
-// +----------------------------------------------------------------------+
-//
-// $Id: Menu.php,v 1.6 2001/03/13 00:18:38 uw Exp $
-
 /**
 * Generates a HTML menu from a multidimensional hash.
 * 
@@ -83,7 +65,7 @@
     * This can be the URL of the current page but it must not be exactly the 
     * return value of getCurrentURL(). If there's no entry for the return value
     * in the menu hash getPath() tries to find the menu item that fits best
-    * by shortening the URL sign by sign until it find an entry that fits.
+    * by shortening the URL sign by sign until it finds an entry that fits.
     * 
     * @see  getCurrentURL(), getPath()
     */
@@ -177,15 +159,15 @@
 
         $this->html = ""; 
                    
-        // buildMenu for rows cares on this itself            
-        if ("rows" != $this->menu_type)             
+        // buildMenu for rows cares on this itself
+        if ("rows" != $this->menu_type)
             $this->html  .= $this->getStart();
         
         // storing to a class variable saves some recursion overhead
         $this->path = $this->getPath();
         $this->buildMenu($this->menu);
     
-        if ("rows" != $this->menu_typ)
+        if ("rows" != $this->menu_type)
             $this->html .= $this->getEnd();
         
         return $this->html;
@@ -315,6 +297,7 @@
                 
                 // every (sub)menu has it's own table
                 $this->html .= $this->getStart();
+                
                 $submenu = false;
                 
                 // loop through the (sub)menu
@@ -534,13 +517,13 @@
                                     $indent,
                                     $node["url"],
                                     $node["title"],
-                                    ("urhere" == $this->menu_type) ? " >> " : ""
+                                    ("urhere" == $this->menu_type) ? " &gt;&gt; " : ""
                                 );
                 break;
                 
             case 3: 
                 // << previous url
-                $html .= sprintf('<td>%s<a href="%s"><< %s</a></td>',
+                $html .= sprintf('<td>%s<a href="%s">&lt;&lt; %s</a></td>',
                                     $indent,
                                     $node["url"],
                                     $node["title"]
@@ -549,7 +532,7 @@
 
             case 4:
                 // next url >>
-                $html .= sprintf('<td>%s<a href="%s">%s >></a></td>',
+                $html .= sprintf('<td>%s<a href="%s">%s &gt;&gt;</a></td>',
                                     $indent,
                                     $node["url"],
                                     $node["title"]
@@ -563,12 +546,12 @@
                                     $node["url"],
                                     $node["title"]
                           );
-                break;                          
+                break;
                 
         }
             
         if ("tree" == $this->menu_type)
-            $html .= "</tr>\n";
+            $html .= "</tr>";
 
         return $html;
     } // end func getEnty
@@ -582,13 +565,13 @@
     */
     function getPath() {
 
-        $this->current_url = $this->getCurrentURL();        
+        $this->current_url = $this->getCurrentURL();
         $this->buildPath($this->menu, array());  
 
         while ($this->current_url && !isset($this->urlmap[$this->current_url]))
           $this->current_url = substr($this->current_url, 0, -1);
         
-        return $this->urlmap[$this->current_url];          
+        return $this->urlmap[$this->current_url];
     } // end func getPath
     
     



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to