[pLog-svn] r4140 - plog/branches/lifetype-1.1.2/class/template/menu

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Oct 18 19:57:47 GMT 2006


Author: oscar
Date: 2006-10-18 19:57:46 +0000 (Wed, 18 Oct 2006)
New Revision: 4140

Modified:
   plog/branches/lifetype-1.1.2/class/template/menu/menurenderer.class.php
Log:
Fixed issue 1054, at least the drop-down menu now appears when using Catalan.

Modified: plog/branches/lifetype-1.1.2/class/template/menu/menurenderer.class.php
===================================================================
--- plog/branches/lifetype-1.1.2/class/template/menu/menurenderer.class.php	2006-10-18 19:20:25 UTC (rev 4139)
+++ plog/branches/lifetype-1.1.2/class/template/menu/menurenderer.class.php	2006-10-18 19:57:46 UTC (rev 4140)
@@ -185,11 +185,14 @@
 				    	
 						$url = $child->getAttribute( "url" );
 						$localeId = $this->getLocaleId( $child );
+										
+						// escape the string for javascript
+						$menuText = strtr($this->_locale->tr( $localeId ), array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
 						
 						if( $url != "" ) 
-							$result .= "null, '".$this->_locale->tr($localeId)."', '".$child->getAttribute("url")."', '_self', null";
+							$result .= "null, '".$menuText."', '".$child->getAttribute("url")."', '_self', null";
 						else
-							$result .= "null, '".$this->_locale->tr($localeId)."', '#', '_self', null";
+							$result .= "null, '".$menuText."', '#', '_self', null";
 						
 						if( $depth > 0 )
 							$result .= $this->_renderJS( $child, $depth, $start, $activeOpt );



More information about the pLog-svn mailing list