Index: typo3/sysext/cms/tslib/class.tslib_fe.php =================================================================== RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/cms/tslib/class.tslib_fe.php,v retrieving revision 1.63 diff -u -r1.63 class.tslib_fe.php --- typo3/sysext/cms/tslib/class.tslib_fe.php 7 Mar 2005 15:32:35 -0000 1.63 +++ typo3/sysext/cms/tslib/class.tslib_fe.php 8 Mar 2005 12:06:43 -0000 @@ -3189,11 +3189,13 @@ ' // JS function for mouse-over function over(name,imgObj) { // if (version == "n3" && document[name]) {document[name].src = eval(name+"_h.src");} + else if (version == "n3" && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_h.src");} else if (imgObj) {imgObj.src = eval(name+"_h.src");} } // JS function for mouse-out function out(name,imgObj) { // if (version == "n3" && document[name]) {document[name].src = eval(name+"_n.src");} + else if (version == "n3" && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_n.src");} else if (imgObj) {imgObj.src = eval(name+"_n.src");} }'; break; Index: typo3/sysext/cms/tslib/class.tslib_menu.php =================================================================== RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/cms/tslib/class.tslib_menu.php,v retrieving revision 1.26 diff -u -r1.26 class.tslib_menu.php --- typo3/sysext/cms/tslib/class.tslib_menu.php 14 Feb 2005 17:23:54 -0000 1.26 +++ typo3/sysext/cms/tslib/class.tslib_menu.php 8 Mar 2005 12:06:44 -0000 @@ -172,6 +172,7 @@ var $WMmenuItems; var $WMextraScript; var $alternativeMenuTempArray=''; // Can be set to contain menu item arrays for sub-levels. + var $nameAttribute = 'name'; // Will be 'id' in XHTML-mode /** * The initialization of the object. This just sets some internal variables. @@ -192,6 +193,18 @@ $this->mconf = $conf[$this->menuNumber.'.']; $this->debug=$GLOBALS['TSFE']->debug; + // In XHTML there is no "name" attribute anymore + switch ($GLOBALS['TSFE']->config['config']['doctype']) { + case 'xhtml_strict': + case 'xhtml_11': + case 'xhtml_2': + $this->nameAttribute = 'id'; + break; + default: + $this->nameAttribute = 'name'; + break; + } + // Sets the internal vars. $tmpl MUST be the template-object. $sys_page MUST be the sys_page object if ($this->conf[$this->menuNumber] && is_object($tmpl) && is_object($sys_page)) { $this->tmpl = &$tmpl; @@ -1588,7 +1601,7 @@ $imgROInfo[3] = t3lib_div::png_to_gif_by_imagemagick($imgROInfo[3]); if ($imgROInfo) { $theName = $this->imgNamePrefix.$this->I['uid'].$this->I['INPfix'].$pref; - $name = ' name="'.$theName.'"'; + $name = ' '.$this->nameAttribute.'="'.$theName.'"'; $GLOBALS['TSFE']->JSImgCode.= chr(10).$theName.'_n=new Image(); '.$theName.'_n.src = "'.$GLOBALS['TSFE']->absRefPrefix.$imgInfo[3].'"; '; $GLOBALS['TSFE']->JSImgCode.= chr(10).$theName.'_h=new Image(); '.$theName.'_h.src = "'.$GLOBALS['TSFE']->absRefPrefix.$imgROInfo[3].'"; '; } @@ -2092,7 +2105,7 @@ // Set rollover if ($this->result['RO'][$key] && !$this->I['noLink']) { $this->I['theName'] = $this->imgNamePrefix.$this->I['uid'].$this->I['INPfix']; - $this->I['name'] = ' name="'.$this->I["theName"].'"'; + $this->I['name'] = ' '.$this->nameAttribute.'="'.$this->I["theName"].'"'; $this->I['linkHREF']['onMouseover']=$this->WMfreezePrefix.'over(\''.$this->I['theName'].'\');'; $this->I['linkHREF']['onMouseout']=$this->WMfreezePrefix.'out(\''.$this->I['theName'].'\');'; $GLOBALS['TSFE']->JSImgCode.= chr(10).$this->I['theName'].'_n=new Image(); '.$this->I['theName'].'_n.src = "'.$GLOBALS['TSFE']->absRefPrefix.$this->I['val']['output_file'].'"; ';