Project

General

Profile

Feature #15736 » rtehtmlarea_feature_2714_v3.patch

Administrator Admin, 2008-08-17 06:22

View differences:

t3lib/class.t3lib_parsehtml_proc.php (copie de travail)
}
if (!count($attribArray_copy)) { // Only if href, target and class are the only attributes, we can alter the link!
// Creating the TYPO3 pseudo-tag "<LINK>" for the link (includes href/url, target and class attributes):
$bTag='<link '.$info['url'].($attribArray['target']?' '.$attribArray['target']:(($attribArray['class'] || $attribArray['title'])?' -':'')).($attribArray['class']?' '.$attribArray['class']:($attribArray['title']?' -':'')).($attribArray['title']?' "'.$attribArray['title'].'"':'').'>';
$bTag='<link '.$info['url'].($info['query']?',0,'.$info['query']:'').($attribArray['target']?' '.$attribArray['target']:(($attribArray['class'] || $attribArray['title'])?' -':'')).($attribArray['class']?' '.$attribArray['class']:($attribArray['title']?' -':'')).($attribArray['title']?' "'.$attribArray['title'].'"':'').'>';
$eTag='</link>';
$blockSplit[$k] = $bTag.$this->TS_links_db($this->removeFirstAndLastTag($blockSplit[$k])).$eTag;
} else { // ... otherwise store the link as a-tag.
......
}
$page = t3lib_BEfunc::getRecord('pages', $idPart);
if (is_array($page)) { // Page must exist...
$href = $siteUrl.'?id='.$link_param;
$pairParts = t3lib_div::trimExplode(',',$link_param);
$href = $siteUrl.'?id='.$pairParts[0].($pairParts[2]?$pairParts[2]:'');
} else if(strtolower(substr($link_param, 0, 7)) == 'record:') {
// linkHandler - allowing links to start with "record:"
$href = $link_param;
......
$info['type']='anchor';
} elseif (!trim($uP['path']) || !strcmp($uP['path'],'index.php')) {
$pp = explode('id=',$uP['query']);
$id = trim($pp[1]);
$parameters = explode('&', $pp[1]);
$id = array_shift($parameters);
if ($id) {
$info['pageid']=$id;
$info['cElement']=$uP['fragment'];
$info['url']=$id.($info['cElement']?'#'.$info['cElement']:'');
$info['type']='page';
$info['query'] = $parameters[0]?'&'.implode('&', $parameters):'';
}
} else {
$info['url']=$info['relUrl'];
typo3/class.browse_links.php (copie de travail)
*
* Values:
* 0: form field name reference, eg. "data[tt_content][123][image]"
* 1: old/unused?
* 2: old/unused?
* 1: htlmArea RTE parameters: editorNo:contentTypo3Language:contentTypo3Charset
* 2: RTE config parameters: RTEtsConfigParams
* 3: allowed types. Eg. "tt_content" or "gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai"
* 4: IRRE uniqueness: target level object-id to perform actions/checks on, eg. "data[79][tt_address][1][<field>][<foreign_table>]"
* 5: IRRE uniqueness: name of function in opener window that checks if element is already used, eg. "inline.checkUniqueElement"
......
$uP=parse_url($rel);
if (!trim($uP['path'])) {
$pp = explode('id=',$uP['query']);
$id = $pp[1];
$parameters = explode('&', $pp[1]);
$id = array_shift($parameters);
if ($id) {
// Checking if the id-parameter is an alias.
if (!t3lib_div::testInt($id)) {
......
$info['pageid']=$id;
$info['cElement']=$uP['fragment'];
$info['act']='page';
$info['query'] = $parameters[0]?'&'.implode('&', $parameters):'';
}
}
}
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (copie de travail)
var add_title="'.($this->setTitle?'&curUrl[title]='.rawurlencode($this->setTitle):'').'";
var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
var cur_href="'.($this->curUrlArray['href'] ? ($this->curUrlInfo['query'] ? substr($this->curUrlArray['href'], 0, -strlen($this->curUrlInfo['query'])) :$this->curUrlArray['href']):'').'";
var cur_target="'.($this->setTarget?$this->setTarget:'').'";
var cur_class="'.($this->setClass?$this->setClass:'').'";
var cur_title="'.($this->setTitle?$this->setTitle:'').'";
......
// Functions used, if the link selector is in RTE mode:
$JScode.='
function link_typo3Page(id,anchor) {
var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
var parameters = document.ltargetform.query_parameters ? (document.ltargetform.query_parameters.value.charAt(0) == "&"?"":"&") + document.ltargetform.query_parameters.value : "";
var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"")+parameters;
if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
......
return false;
}
function link_current() { //
var parameters = document.ltargetform.query_parameters ? (document.ltargetform.query_parameters.value.charAt(0) == "&"?"":"&") + document.ltargetform.query_parameters.value : "";
if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
if (cur_href!="http://" && cur_href!="mailto:") {
plugin.createLink(cur_href,cur_target,cur_class,cur_title);
plugin.createLink(cur_href + parameters,cur_target,cur_class,cur_title);
}
return false;
}
......
function addAttributesForm() {
$ltargetForm = '';
// Add page id, target, class selector box and title field:
// Add page id, target, class selector box, title and parameters fields:
$lpageId = $this->addPageIdSelector();
$queryParameters = $this->addQueryParametersSelector();
$ltarget = $this->addTargetSelector();
$lclass = $this->addClassSelector();
$ltitle = $this->addTitleSelector();
if ($lpageId || $ltarget || $lclass || $ltitle) {
$ltargetForm = $this->wrapInForm($lpageId.$ltarget.$lclass.$ltitle);
if ($lpageId || $queryParameters || $ltarget || $lclass || $ltitle) {
$ltargetForm = $this->wrapInForm($lpageId.$queryParameters.$ltarget.$lclass.$ltitle);
}
return $ltargetForm;
}
......
</tr>':'';
}
function addQueryParametersSelector() {
global $LANG;
return ($this->act == 'page' && $this->buttonConfig && is_array($this->buttonConfig['queryParametersSelector.']) && $this->buttonConfig['queryParametersSelector.']['enabled'])?'
<tr>
<td>'.$LANG->getLL('query_parameters',1).':</td>
<td colspan="3">
<input type="text" name="query_parameters" value="' . ($this->curUrlInfo['query']?$this->curUrlInfo['query']:'') . '" ' . $this->doc->formWidth(30) . ' />
</td>
</tr>':'';
}
function addTargetSelector() {
global $LANG;
typo3/sysext/rtehtmlarea/mod3/locallang.xml (copie de travail)
<label index="currentLink">Current Link</label>
<label index="invalidChar">ERROR: Invalid character found in file path (%s). Cannot add the file!</label>
<label index="page_id">Page Id</label>
<label index="query_parameters">Query parameters</label>
</languageKey>
</data>
<orig_hash type="array">
(3-3/3)