Project

General

Profile

Actions

Bug #16944

closed

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

Added by Pascal Collins over 17 years ago. Updated over 11 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
Content Rendering
Target version:
-
Start date:
2007-07-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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=|<br> || |<br> || |<br> || |<br> || </td><td class="myclass" valign="top">|<br> || |<br> || |<br> || |<br> || </td><td class="myclass" valign="top">|<br> || |<br> || |<br> || |<br> || </td><td class="myclass" valign="top">| || | || | ||
    }
    2.wrap=<table valign="top"><tr><td class="myclass" valign="top">|</td></tr></table>
    }
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=&lt;td&gt;|&lt;/td&gt;
}
1.wrap=&lt;table align=&quot;right&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&gt;&lt;tr&gt;|&lt;/tr&gt;&lt;/table&gt;
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=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd&quot;>

(issue imported from #M6029)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #46358: Separate ext:statictemplates code from coreClosed2013-03-16

Actions
Actions #1

Updated by Oliver Hader over 17 years ago

I can confirm this issue, the JavaScript with the error looks like this:
if (parseInt(GLV_menuOn["fa6241"].left)+GL_getObj(id).width>789) GLV_menuOn["fa6241"].left=789-GL_getObj(id).width;
if (parseInt(GLV_menuOn["fa6241"].top)+GL_getObj(id).height>250) GLV_menuOn["fa6241"].top=250-GL_getObj(id).height;

  • the width and height attributes shoudl also be wrapped with a "parseInt"
  • setting the left and top attribute should contain the "px" as suggested by Pascal
Actions #2

Updated by Christian Kuhn over 11 years ago

  • Status changed from Accepted to Rejected
  • Target version deleted (0)
  • TYPO3 Version set to 6.1

With 6.1 issue #46358, the _layers menus where moved to statictemplates, and statictemplates was removed from core afterwards. This issue won't be solved in the core anymore.

Actions

Also available in: Atom PDF