Hallo
Ich habe eine EXT erstellt welche die Link-Popup-Ansicht des RTE erweitert um den TAP 'S3'.
Das sieht dann so aus wie auf dem angehängten ScreenShot.
Meine Frag ist jetzt; Welche Funktion muss jetzt mit welchen Parameter aufgerufen werden, damit der markierte Bereich im RTE entsprechend verlinkt wird?
Gehe ich richtig der Annahme, dass lediglich die Zeile "$aOnClick = '???';" noch angepasst werden muss? Oder habe ich noch etwas grundlegendes übersehen?
<?php
/**
* Returns a new tab for the browse links wizard
* Returns the 'S3' tab to the RTE link browser
*
* @param string current link selector action
* @return string a tab for the selected link action
*/
public function getTab($linkSelectorAction) {
$content = '';
if($linkSelectorAction=='tx_kiddogs3'){
//AWS access info
if (!defined('awsAccessKey')) define('awsAccessKey', $this->awsAccessKey);
if (!defined('awsSecretKey')) define('awsSecretKey', $this->awsSecretKey);
//instantiate the class
$s3 = new S3(awsAccessKey, awsSecretKey);
// Get the contents of our bucket
$bucket_contents = $s3->getBucket($this->bucket);
foreach ($bucket_contents as $file){
$fname = $file['name'];
$furl = "http://".$this->bucket.".s3.amazonaws.com/".$fname;
$aOnClick = '???';
$content .= '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$fname.'</a>';
}
}
return $content;
}
?>
<?php
/**
* Checks the current URL and determines what to do
* If the link was determined to be a file link, then set the action to 'media'
*
* @param unknown_type $href
* @param unknown_type $siteUrl
* @param unknown_type $info
* @return unknown_type
*/
public function parseCurrentUrl($href, $siteUrl, $info) {
if($linkSelectorAction=='tx_kiddogs3'){
$info['act'] = 'tx_kiddogs3';
$info['siteUrl'] = "http://".$this->bucket.".s3.amazonaws.com/";
}
return $info;
}
?>
Vielen Dank
Jürg
