Index: t3lib/class.t3lib_parsehtml_proc.php =================================================================== --- t3lib/class.t3lib_parsehtml_proc.php (Revision 89610) +++ t3lib/class.t3lib_parsehtml_proc.php (Arbeitskopie) @@ -619,6 +619,19 @@ unset($attribArray_copy['style']); unset($attribArray_copy['rteerror']); } + + // remove additional params + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['removeParams_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['removeParams_PostProc'])) { + $_params = array( + 'conf' => &$conf, + 'aTagParams' => &$attribArray_copy + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['removeParams_PostProc'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $attribArray_copy = $processor->removeParams( $_params, $this); + } + } + if (!count($attribArray_copy)) { // Only if href, target and class are the only attributes, we can alter the link! // Quoting class and title attributes if they contain spaces $attribArray['class'] = preg_match('/ /', $attribArray['class']) ? '"' . $attribArray['class'] . '"' : $attribArray['class']; @@ -628,7 +641,22 @@ $href = $attribArray['external'] ? $attribArray['href'] : $info['url'] . ($info['query'] ? ',0,' . $info['query'] : ''); $bTag = ''; $eTag = ''; - $blockSplit[$k] = $bTag . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . $eTag; + + // modify params + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'])) { + $_params = array( + 'conf' => &$conf, + 'currentBlock' => $v, + 'url' => $href, + 'attributes' => $attribArray + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksDb_PostProc'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $blockSplit[$k] = $processor->modifyParamsLinksDb( $_params, $this); + } + } else { + $blockSplit[$k] = $bTag . $this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])) . $eTag; + } } else { // ... otherwise store the link as a-tag. // Unsetting 'rtekeep' attribute if that had been set. unset($attribArray['rtekeep']); @@ -665,7 +693,6 @@ $siteUrl = $this->siteUrl(); foreach ($blockSplit as $k => $v) { $error = ''; - $external = FALSE; if ($k % 2) { // block: $tagCode = t3lib_div::unQuoteFilenames(trim(substr($this->getFirstTag($v), 0, -1)), true); $link_param = $tagCode[1]; @@ -678,6 +705,7 @@ } else { $fileChar = intval(strpos($link_param, '/')); $urlChar = intval(strpos($link_param, '.')); + $external = FALSE; // Parse URL: $pU = parse_url($link_param); // Detects if a file is found in site-root OR is a simulateStaticDocument. @@ -732,7 +760,24 @@ ($error ? ' rteerror="' . htmlspecialchars($error) . '" style="background-color: yellow; border:2px red solid; color: black;"' : '') . // Should be OK to add the style; the transformation back to databsae will remove it... '>'; $eTag = ''; - $blockSplit[$k] = $bTag . $this->TS_links_rte($this->removeFirstAndLastTag($blockSplit[$k])) . $eTag; + + // modify params + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'])) { + $_params = array( + 'conf' => &$conf, + 'currentBlock' => $v, + 'url' => $href, + 'tagCode' => $tagCode, + 'external' => $external, + 'error' => $error + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $blockSplit[$k] = $processor->modifyParamsLinksRte( $_params, $this); + } + } else { + $blockSplit[$k] = $bTag . $this->TS_links_rte($this->removeFirstAndLastTag($blockSplit[$k])) . $eTag; + } } } Index: typo3/class.browse_links.php =================================================================== --- typo3/class.browse_links.php (Revision 89610) +++ typo3/class.browse_links.php (Arbeitskopie) @@ -828,9 +828,24 @@ 'title' => $currentLinkParts[3], 'params' => $currentLinkParts[4] ); + $this->curUrlArray = (is_array(t3lib_div::_GP('curUrl'))) ? array_merge($initialCurUrlArray, t3lib_div::_GP('curUrl')) : $initialCurUrlArray; + + // additional fields for page links + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendUrlArray']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendUrlArray'])) { + $_params = array( + 'conf' => &$conf, + 'linkParts' => $currentLinkParts + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendUrlArray'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $processor->extendUrlArray( $_params, $this); + } + } + + $this->curUrlInfo = $this->parseCurUrl($this->siteURL.'?id='.$this->curUrlArray['href'], $this->siteURL); if ($this->curUrlInfo['pageid'] == 0 && $this->curUrlArray['href']) { // pageid == 0 means that this is not an internal (page) link if (file_exists(PATH_site.rawurldecode($this->curUrlArray['href']))) { // check if this is a link to a file @@ -1163,10 +1192,24 @@ BrowseLinks.focusOpenerAndClose(close); } '; + + // extends JavaScript code + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendJScode']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendJScode'])) { + $_params = array( + 'conf' => &$conf, + 'wizardUpdate' => $update, + 'addPassOnParams' => $addPassOnParams + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['extendJScode'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $JScode .= $processor->extendJScode( $_params, $this); + } + } // Finally, add the accumulated JavaScript to the template object: $this->doc->JScode.= $this->doc->wrapScriptTags($JScode); + // Debugging: if (FALSE) debug(array( 'pointer' => $this->pointer, @@ -1527,6 +1570,18 @@ '; + // additional fields for page links + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink'])) { + $_params = array( + 'conf' => &$conf, + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['addFields_PageLink'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $content .= $processor->addFields( $_params, $this); + } + } + + // Target: if ($this->act!='mail') { $ltarget=' Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (Revision 89610) +++ typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie) @@ -1654,6 +1654,19 @@ if ($addGlobal) { $aTagParams = ' ' . trim($GLOBALS['TSFE']->ATagParams . $aTagParams); } + + // extend params + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParams_PostProc']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParams_PostProc'])) { + $_params = array( + 'conf' => &$conf, + 'aTagParams' => &$aTagParams + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getATagParams_PostProc'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $aTagParams = $processor->process( $_params, $this); + } + } + return $aTagParams; } Index: typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php =================================================================== --- typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (Revision 89610) +++ typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (Arbeitskopie) @@ -585,6 +585,18 @@ } } '; + + // Hook to overwrite or extend javascript functions + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['extendJScode']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['extendJScode'])) { + $_params = array( + 'conf' => &$conf + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['extendJScode'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $JScode .= $processor->extendJScode( $_params, &$this); + } + } + return $JScode; } @@ -878,8 +890,20 @@ $lclass = $this->addClassSelector(); $ltitle = $this->addTitleSelector(); $rel = $this->addRelField(); + + // additional fields for page links + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['addAttributeFields']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['addAttributeFields'])) { + $_params = array( + 'conf' => &$conf + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['addAttributeFields'] as $objRef) { + $processor = &t3lib_div::getUserObj($objRef); + $additionalAttributeFields .= $processor->getAttributefields( $_params, $this); + } + } + if ($lpageId || $queryParameters || $ltarget || $lclass || $ltitle || $rel) { - $ltargetForm = $this->wrapInForm($lpageId.$queryParameters.$ltarget.$lclass.$ltitle.$rel); + $ltargetForm = $this->wrapInForm($lpageId . $queryParameters . $ltarget . $lclass . $ltitle . $rel . $additionalAttributeFields); } return $ltargetForm; }