Fixed bug #5048: JSMENU produces error if using baseurls (thanks to Jens Koester)
authorOliver Hader <oliver.hader@typo3.org>
Sat, 7 Jul 2007 12:50:01 +0000 (12:50 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 7 Jul 2007 12:50:01 +0000 (12:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-1@2393 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/jsfunc.menu.js
typo3/sysext/cms/tslib/class.tslib_menu.php

index 16d6885..5cc493c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-07-07  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #5053: imgNameNotRandom on TMENU/GMENU could break rollover behaviour (thanks to Ralf Hettinger)
+       * Fixed bug #5048: JSMENU produces error if using baseurls (thanks to Jens Koester)
 
 2007-07-06  Michael Stucki  <michael@typo3.org>
 
index 8092f0b..af9ef94 100755 (executable)
@@ -108,9 +108,10 @@ function JSactivate(level) {
                        this.entry[this.entry[entryID].parent].openID = entryID;
                }
                if (this.entry[entryID].url)    {
-                       if (document.getElementsByTagName("base").size && document.getElementsByTagName("base")[0].href != "") {
-                               if (this.entry[entryID].url.substr(0,7) != "http://")   {
-                                       this.entry[entryID].url = document.getElementsByTagName("base")[0].href + this.entry[entryID].url;
+                       var baseURLs = document.getElementsByTagName('base');
+                       if (baseURLs.length && baseURLs[0].href.length > 0) {
+                               if (this.entry[entryID].url.search(/^http[s]?:\/\//))   {
+                                       this.entry[entryID].url = baseURLs[0].href + this.entry[entryID].url;
                                }
                        }
                        if (!this.entry[entryID].target || this.entry[entryID].target=="_self") {
index b65e06e..4df2bb3 100755 (executable)
@@ -2784,10 +2784,10 @@ class tslib_jsmenu extends tslib_menu {
                                                        // If access restricted pages should be shown in menus, change the link of such pages to link to a redirection page:
                                                $this->changeLinksForAccessRestrictedPages($LD, $data, $this->mconf['target'], $this->mconf['forceTypeValue']);
 
-                                               $url = $LD['totalURL'];
+                                               $url = $GLOBALS['TSFE']->baseUrlWrap($LD['totalURL']);
                                                $target = $LD['target'];
                                        }
-                                       $codeLines.="\n".$var.$count."=".$menuName.".add(".$parent.",".$prev.",0,".t3lib_div::quoteJSvalue($title, true).",".t3lib_div::quoteJSvalue($GLOBALS['TSFE']->baseUrlWrap($url), true).",".t3lib_div::quoteJSvalue($target, true).");";
+                                       $codeLines.="\n".$var.$count."=".$menuName.".add(".$parent.",".$prev.",0,".t3lib_div::quoteJSvalue($title, true).",".t3lib_div::quoteJSvalue($url, true).",".t3lib_div::quoteJSvalue($target, true).");";
                                                // If the active one should be chosen...
                                        $active = ($levelConf['showActive'] && $data['uid'] == $this->tmpl->rootLine[$count]['uid']);
                                                // If the first item should be shown