[TYPO3-dev] typolink und JSWindow

Steffen Kamper steffen at dislabs.de
Sat Feb 10 22:40:33 CET 2007


"Steffen Kamper" <steffen at dislabs.de> schrieb im Newsbeitrag 
news:mailman.1.1171142736.24646.typo3-dev at lists.netfielders.de...
>
> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb 
> im Newsbeitrag 
> news:mailman.1.1171141790.22765.typo3-dev at lists.netfielders.de...
>> Steffen Kamper schrieb:
>>> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb 
>>> im Newsbeitrag 
>>> news:mailman.1.1171127953.20414.typo3-dev at lists.netfielders.de...
>>>> Steffen Kamper schrieb:
>>>>> Hi,
>>>>>
>>>>> I use on a page popup-Links with JSWindow. The problem is, that all 
>>>>> links are referenced to the same window, i need a window for each 
>>>>> link.
>>>> Do you mean "a new window object" (this is what the JS variable vHWin 
>>>> will hold) or "a new window on my screen" (in this case the window name 
>>>> FEopenLink is what you're looking for)?
>>>>
>>>> Either way you are right, you have to hack to change them.
>>>>
>>>> Masi
>>>
>>> Hi Masi,
>>>
>>> ok, i did a little patch and it works perfect. It's based on 4.1RC1 and 
>>> i posted here:
>>> http://bugs.typo3.org/view.php?id=4963
>>>
>>> would be nice if you can have a look.
>>
>> This change is wrong:
>>
>> - $target = ' target="FEopenLink"';
>> + $target = $target;
>>
>> Must be:
>>
>> - $target = ' target="FEopenLink"';
>> + $target = ' target="'.$target.'"';
>>
>
> you're right.
> I did another patch cause $target is needed in both ways, with
> ... target="'.$target.'" ...
> and in window.open as '$target"
> so i renamed the tempVar to $wtarget.
>
> unfortunally my tortoise doesn't produce the right diff - so there is a 
> double line in it.
> I will make a 3rd one.
>
>> And I don't see the point in creating random variable names like that. If 
>> it's random you cannot use it easily from JS.
>>
>> So I suggest:
>>
>> $winObj =
>>  $conf['JSWindow.']['windowVar'] ?
>>  $conf['JSWindow.']['windowVar'] :
>>  'vHWin_'.md5(rand());
>>
> Yes, you're right, i change this .
>
>>
>> So we have always a unique name (with rand()), but may use a name of our 
>> choice.
>>
>> Masi
>
> thx Masi !
>
> vg  Steffen
>


sry, my tortoise did a really bad job, i have to control the diff-Files 
manually.
Here is the complete new section


if ($JSwindowParams) {
                 $wtarget=$conf['JSWindow.']['target']?$conf['JSWindow.']['target']:'FEopenLink';
                 $winObj = $conf['JSWindow.']['windowVar'] ? 
$conf['JSWindow.']['windowVar'] : 'vHWin_'.md5(rand());

     // Create TARGET-attribute only if the right doctype is used
    if (!t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2', 
$GLOBALS['TSFE']->xhtmlDoctype)) {
     $target = ' target="'.$wtarget.'"';
    } else {
     $target = '';
    }

    $onClick=$winObj."=window.open('".$GLOBALS['TSFE']->baseUrlWrap($finalTagParts['url'])."','$wtarget','".$JSwindowParams."');".$winObj.".focus();return 
false;";
    $res = '<a href="'.htmlspecialchars($finalTagParts['url']).'"'. $target 
.' onclick="'.htmlspecialchars($onClick).'"'.($title?' 
title="'.$title.'"':'').($linkClass?' 
class="'.$linkClass.'"':'').$finalTagParts['aTagParams'].'>';
   } else {
...

sry for confusing.

vg   Steffen 






More information about the TYPO3-dev mailing list