[Typo3] Altering RTE Element Browser to show uploading option for linking to Files

Alex Hobbs alexjhobbs at gmail.com
Tue Oct 18 04:34:53 CEST 2005


For those interested, with a bit of PHP know how.

I have clients inserting links to files using the RTE element browser. They
wanted to be able to upload the file they were linking to while inside the
RTE browser, not having to use the FileList method first.

I managed to do this by adding this code at line 1176 of
typo3/browse_links.php

// Create upload/create folder forms, if a path is given:
$fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$fileProcessor->init($GLOBALS['FILEMOUNTS'],
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
$path=$this->expandFolder;
if (!$path || !@is_dir($path)) {
$path = $fileProcessor->findTempFolder().'/'; // The closest TEMP-path is
found
}
if ($path!='/' && @is_dir($path)) {
$uploadForm=$this->uploadForm($path);
$createFolder=$this->createFolder($path);
} else {
$createFolder='';
$uploadForm='';
}
$content.=$uploadForm;

If it matters to you, you'll also need to change

typo3/sysext/land/locallang_browse_links.xml at line 15

so that 'Upload Image', says 'Upload File' (so that it's more universal).

Works fine, client happy. Why this isn't a standard feature I don't know.

Regards,
Alex Hobbs.



More information about the TYPO3-english mailing list