Project

General

Profile

Bug #14601 ยป 0000874-TYPO3core-xhtml-id-instead-of-name.patch

Administrator Admin, 2005-03-08 13:11

View differences:

typo3/sysext/cms/tslib/class.tslib_fe.php 8 Mar 2005 12:06:43 -0000
' // 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;
typo3/sysext/cms/tslib/class.tslib_menu.php 8 Mar 2005 12:06:44 -0000
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.
......
$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;
......
$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].'"; ';
}
......
// 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'].'"; ';
    (1-1/1)