Project

General

Profile

Feature #15043 » 2005-10-21_bugfix_1590_2.patch

Administrator Admin, 2005-10-25 17:11

View differences:

TYPO3core_patch1590/typo3/sysext/cms/tslib/class.tslib_content.php 2005-10-25 16:53:10.000000000 +0200
}
$this->lastTypoLinkTarget = $target;
$finalTagParts['url']=$this->lastTypoLinkUrl;
$this->typoLink_registerExternal($this->lastTypoLinkUrl,$linktxt);
$finalTagParts['targetParams'] = $target ? ' target="'.$target.'"' : '';
$finalTagParts['TYPE']='url';
} elseif ($containsSlash || $isLocalFile) { // file (internal)
......
$finalTagParts['TYPE'] = 'file';
} else {
$GLOBALS['TT']->setTSlogMessage("typolink(): File '".$splitLinkParam[0]."' did not exist, so '".$linktxt."' was not linked.",1);
$this->typoLink_error($splitLinkParam[0], 'file', $linktxt);
return $linktxt;
}
} else { // integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to definition in $TCA!)
......
$page = $GLOBALS['TSFE']->sys_page->getPage($mount_info['mount_pid'],$disableGroupAccessCheck);
if (!count($page)) {
$GLOBALS['TT']->setTSlogMessage("typolink(): Mount point '".$mount_info['mount_pid']."' was not available, so '".$linktxt."' was not linked.",1);
$this->typoLink_error($mount_info['mount_pid'], 'mount', $linktxt);
return $linktxt;
}
$MPvarAcc['re-map'] = $mount_info['MPvar'];
......
$finalTagParts['TYPE']='page';
} else {
$GLOBALS['TT']->setTSlogMessage("typolink(): Page id '".$link_param."' was not found, so '".$linktxt."' was not linked.",1);
$this->typoLink_error($link_param, 'page', $linktxt);
return $linktxt;
}
}
......
}
/**
* here, a hook function can be called which handles all the things which should happen when a link is not found or a link *might* be not found
*
* @param string Target of the link, can be an integer for pages, or a file reference
* @param string either 'file', 'page', or 'mount', or 'external'
* @param string linked text
* @param boolean has to be set to zero if the link still needs to be checked (in the backend) - needed for external links
* @private
*/
function typoLink_error($linkurl,$type,$linktext,$is_error = 1) {
global $TYPO3_CONF_VARS;
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_error'])) {
$params = array('target' => $linkurl, 'type' => $type, 'linktext' => $linktext, 'is_error' => $is_error);
$fakeThis = FALSE;
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_error'] as $hookMethod) {
t3lib_div::callUserFunction($hookMethod,$params,$fakeThis);
}
}
}
/**
* wrapper for typoLink_error for external links. This function is called for all external links because they need to be checked seperately in the backend.
*
* @param string Target of the link, can be an integer for pages, or a file reference
* @param string linked text
* @private
*/
function typoLink_registerExternal($linkurl,$linktext) {
$this->typoLink_error($linkurl,'external',$linktext,0);
}
/**
* Based on the input "TypoLink" TypoScript configuration this will return the generated URL
*
* ' @see typoLink()
(4-4/4)