Issue Bug Rejected

#16944GMenu and TMenu: Rendering "borderswithin" doesn't work with Firefox and Doctype HTML 4.01 Transitional

Pascal Collins 07/26/07, 16:41 updated 04/01/13, 12:01

Description

When using the Doctype HTML 4.01 Transitional the menu option “borderswithin” (which makes sure that submenus stay within a certain frame) won’t work. Might also be an issue with other Doctypes, have only tested it on 4.01 yet.

Already found out how to fix it.
The problem is in the following files:
tmenu_layers.php and gmenu_layers.php
These files are found in:
typo3_src/typo3/sysext/cms/tslib/media/scripts/

It’s the function extCalcBorderWithin
Original script:

function extCalcBorderWithin($kind,$integer) {
if ($integer) {
switch($kind) {
case ‘right’:
case ‘bottom’:
$add=’‘;
if ($kind==‘right’) {$add=‘GL_getObj(id).width’; $key = ‘left’;}
if ($kind==‘bottom’) {$add=‘GL_getObj(id).height’; $key = ‘top’;}
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$key.’)+’.$add.’>’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$key.’=’.$integer.’-’.$add.’;’;
break;
default:
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$kind.’)<’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$kind.’=’.$integer.’;’;
break;
}
}
return $str;
}

——————————————-
It creates the Javascript that corrects the position if the x- or y-value plus the width or height exceed the borders. The line to be corrected is the following one:
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$key.’)+’.$add.’>’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$key.’=’.$integer.’-’.$add.’;’;

it should say :
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$key.’)+’.$add.’>’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$key.’=’.$integer.’-’.$add.’+“px”;’;

Same with the other line:
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$kind.’)<’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$kind.’=’.$integer.’;’;

it should say:
$str = ‘if (parseInt(GLV_menuOn[“’.$this->WMid.’”].’.$kind.’)<’.$integer.’) GLV_menuOn[“’.$this->WMid.’”].’.$kind.’=’.$integer.’+“px”;’;

Problem occured on a menu like this:

MAINNAV=HMENU
MAINNAV{
  1. the following offsets were needed in my case, might depend on the CSS you use
    yPosOffset=100
    topOffset=105
    NO=1
  2. the following creates up to four columns of four items per column
    NO.linkWrap=|
    || |
    || |
    || |
    || |
    || |
    || |
    || |
    || |
    || |
    || |
    || |
    || | || | || | ||
    }
    2.wrap=
    |

    }
special=directory
special.value=25
entryLevel=0
expAll=1
1=GMENU_LAYERS
1{
freezeMouseover=1
layerStyle = position:absolute;VISIBILITY:hidden;
lockPosition=y
leftOffset=12
yPosOffset=-10
topOffset = 102
hideMenuWhenNotOver = 50
hideMenuTimer = 70
dontFollowMouse=0
directionUp=0
relativeToTriggerItem=1
blankStrEqFalse=0
bordersWithin=0,0,789,250,0,0
}
1.NO=1
1.expAll=1
1.NO{
XY=[10.w]+16,18
10=TEXT
10.text.field=title
10.fontColor=#666666
10.fontFile=fileadmin/fonts/myfont.ttf
10.fontSize=11
10.niceText=1
10.offset=12,12
wrap=<td>|</td>
}
1.wrap=<table align=“right” cellpadding=“0” cellspacing=“0” border=“0”><tr>|</tr></table>
1.RO < .1.NO
1.RO.10.fontColor=black
    2=TMENU_LAYERS
2{
lockPosition=x
layerStyle=position:absolute;VISIBILITY:visible;
relativeToParentLayer=0
relativeToTriggerItem=0

Doctype was set like this:
page.config.doctype=

(issue imported from #M6029)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.