Added argument to hook function call, see changelog
authorKasper Skårhøj <kasper@typo3.org>
Wed, 25 Feb 2009 18:33:08 +0000 (18:33 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Wed, 25 Feb 2009 18:33:08 +0000 (18:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5065 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index b6d4aa4..806678c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-25  Kasper Sk\8crh¿j
+
+       * Added a small feature (extra hook argument) to the external link handler I committet in january. I didn't ask because this feature was made by me and very new. Let me know if this is a problem. Credits to Hassan Ait Abdellah
+
 2009-02-23  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #10531: htmlArea RTE: JS error may be raised by Opera on page unload
index b5c48bf..7d1ea97 100755 (executable)
@@ -2969,14 +2969,14 @@ class tslib_cObj {
         * @param       string  URL of the website
         * @return  string      the additional tag properties
         */
-       function extLinkATagParams($URL)        {
+       function extLinkATagParams($URL, $TYPE) {
                $out = '';
 
                if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['extLinkATagParamsHandler']) {
                        $extLinkATagParamsHandler = &t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['extLinkATagParamsHandler']);
 
                        if(method_exists($extLinkATagParamsHandler, 'main')) {
-                               $out.= trim($extLinkATagParamsHandler->main($URL, $this));
+                               $out.= trim($extLinkATagParamsHandler->main($URL, $TYPE, $this));
                        }
                }
 
@@ -4710,14 +4710,14 @@ class tslib_cObj {
                                                        ' href="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode('http://'.$parts[0]).$GLOBALS['TSFE']->getMethodUrlIdToken).'"'.
                                                        ($target ? ' target="'.$target.'"' : '').
                                                        $aTagParams.
-                                                       $this->extLinkATagParams('http://'.$parts[0]).
+                                                       $this->extLinkATagParams('http://'.$parts[0], 'url').
                                                        '>';
                                } else {
                                        $res = '<a'.
                                                        ' href="http://'.htmlspecialchars($parts[0]).'"'.
                                                        ($target ? ' target="'.$target.'"' : '').
                                                        $aTagParams.
-                                                       $this->extLinkATagParams('http://'.$parts[0]).
+                                                       $this->extLinkATagParams('http://'.$parts[0], 'url').
                                                        '>';
                                }
                                if ($conf['ATagBeforeWrap'])    {
@@ -5391,7 +5391,7 @@ class tslib_cObj {
                                        $finalTagParts['url']=$this->lastTypoLinkUrl;
                                        $finalTagParts['targetParams'] = $target ? ' target="'.$target.'"' : '';
                                        $finalTagParts['TYPE']='url';
-                                       $finalTagParts['aTagParams'].=$this->extLinkATagParams($finalTagParts['url']);
+                                       $finalTagParts['aTagParams'].=$this->extLinkATagParams($finalTagParts['url'], $finalTagParts['TYPE']);
                                } elseif ($containsSlash || $isLocalFile)       {       // file (internal)
                                        $splitLinkParam = explode('?', $link_param);
                                        if (file_exists(rawurldecode($splitLinkParam[0])) || $isLocalFile)      {
@@ -5409,6 +5409,7 @@ class tslib_cObj {
                                                $finalTagParts['url'] = $this->lastTypoLinkUrl;
                                                $finalTagParts['targetParams'] = $target ? ' target="'.$target.'"' : '';
                                                $finalTagParts['TYPE'] = 'file';
+                                               $finalTagParts['aTagParams'].=$this->extLinkATagParams($finalTagParts['url'], $finalTagParts['TYPE']);
                                        } else {
                                                $GLOBALS['TT']->setTSlogMessage("typolink(): File '".$splitLinkParam[0]."' did not exist, so '".$linktxt."' was not linked.",1);
                                                return $linktxt;