[TYPO3] TinyRTE and links button [trying to solve]
Cyprian Kowalczyk
cyprian at pi2.pl
Fri May 26 15:53:41 CEST 2006
Hi,
This topic origins from 'wysiwyg page editor that typo uses....' but I'd
like it to be a separate one.
I'm trying to solve the link button problem for TinyRTE and I came to
following conclusion:
1. Line 239 @ class.tx_tinyrte.php is wrong and should look like:
current="&curUrl[href]="+tinyMCE.getAttrib(node,
"href")+"&curUrl[target]="+tinyMCE.getAttrib(node,
"target")+"&curUrl[title]="+tinyMCE.getAttrib(node, "title");
There was no title param and the target was wrong (was curURL).
2. TinyRTE detects internal links in the wrong way, it checks:
var fz=curr.indexOf("?")+4;
But if the external link is, f.e., www.sthng.com?id=123, it will be
detected as internal link (because of '?' sign).
Now: I'm not quite sure yet how to check for the internal links.
The script could check for the site's path before '?' sign but what about
realURLs?
I didn't find (even check) the way to pass site's url to the script.
2. There is something wrong with class.browse_links.php I think.
There are two important params: 'mode' and 'act'.
When one use link browser from RTE the mode should be 'wizard', shouldn't
it?
But when you look at class.brwose_links.php:792, when the 'mode=wizard'
the current link's values are always taken from 'P'param.
This is wrong IMO. It should be checked if 'act' == 'page' and then 'P'
should be used (like for internal links),
otherwise 'curUrl' should be used (external links):
if ($this->act == 'page') {
$currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);
$this->curUrlArray = array(
'target' => $currentLinkParts[1]
);
$this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);
} else {
$this->curUrlArray = t3lib_div::_GP('curUrl');
if ($this->curUrlArray['all']) {
$this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
}
$this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
}
My solution works partially - there is problem with 'title' attribute for
internal links and problems with checking for internal links (no.2).
I'd be gratefull for any suggestions.
--
regards, Cyprian
http://pi2.pl ~ π^2 design project
TYPO3 4.0 @ MAMP1.1 [Apache/2.0.54 (Unix) + PHP/5.0.4 DAV/2
+ MySQL/4.1.12] @ MacOS X 10.4
More information about the TYPO3-english
mailing list