[Phplib-trackers] [ phplib-Bugs-450721 ] PHP4 and menu.inc
Brought to you by:
nhruby,
richardarcher
From: <no...@so...> - 2001-08-20 06:52:14
|
Bugs item #450721, was opened at 2001-08-14 00:19 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450721&group_id=31885 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Richard Archer (richardarcher) Assigned to: Nobody/Anonymous (nobody) Summary: PHP4 and menu.inc Initial Comment: reposted from the mailing list this is a patch against the -devel tree, but it looks af it would apply cleanly to -stable too. At 2:13 PM +0300 16/1/01, Alexandr E. Bravo wrote: >Below is my solution (as a patch to original menu.inc) for menu under PHP4. It >differs a bit from Paolo's changes but allows to keep "" as a root item value. >Not sure that it's bugs free, checked it on two menu configurations only. > >------------- > >--- /tmp/php-lib/php/html/menu.inc Wed Jul 12 15:05:15 2000 >+++ menu.inc Tue Jan 16 13:58:12 2001 >@@ -5,7 +5,7 @@ > * Copyright (c) 1999 NetUSE GmbH > * Kristian Koehntopp > * >- * $Id: menu.inc,v 1.2 2000/07/12 11:05:15 kk Exp $ >+ * $Id: menu.inc,v 1.1 2000/11/19 11:02:42 abravo Exp $ > * > */ > class Menu { >@@ -184,10 +184,11 @@ > /* private: normalize current menu position > */ > function normalize_pos($pos) { >- if ( $m = $this->urlmap[basename($pos)] ) >+ $m = $this->urlmap[basename($pos)]; >+ if ( isset($m) ) > return($m); > $m = $pos; >- while(substr($m, 0, 1)) { >+ while( strlen($m)>1 ) { > if ($this->urlmap[$m]) > break; > $m = dirname($m); >@@ -244,6 +245,7 @@ > reset($this->urlmap); > while(list($k, $v) = each($this->urlmap)) { > $base = dirname($v); >+ if ($base=="/") { $base=""; } > $this->children[$base][] = $v; > $this->item[$v]["url"] = $k; > } > ---------------------------------------------------------------------- >Comment By: Richard Archer (richardarcher) Date: 2001-08-19 23:52 Message: Logged In: YES user_id=279311 Many problems with menu.inc have been fixed in both CVS trees. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450721&group_id=31885 |