Commit 29276f2d authored by Christian Kuhn's avatar Christian Kuhn Committed by Benni Mack
Browse files

[!!!][TASK] RTE reloaded

Main refactoring of RTE on PHP side. Classes AbstractRte,
RteHtmlAreaBase and the instantiator API RTEgetObj() are
dropped and inlined to the FormEngine class construct.
Lots of code is simplified or moved around.

Change-Id: Ibd4ff3e7fa8fe695a96b03355c905640d2efa351
Resolves: #67917
Releases: master
Reviewed-on: http://review.typo3.org/40842


Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
parent bc483186
......@@ -143,12 +143,6 @@ class RteController extends AbstractWizardController {
$formEngine = GeneralUtility::makeInstance(FormEngine::class);
// SPECIAL: Disables all wizards - we are NOT going to need them.
$formEngine->disableWizards = 1;
// Initialize style for RTE object:
// Getting reference to the RTE object used to render the field!
$RTEObject = BackendUtility::RTEgetObj();
if ($RTEObject->ID === 'rte') {
$RTEObject->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';
}
// Fetching content of record:
/** @var DataPreprocessor $dataPreprocessor */
$dataPreprocessor = GeneralUtility::makeInstance(DataPreprocessor::class);
......
......@@ -75,6 +75,7 @@ class SingleFieldContainer extends AbstractContainer {
if (
$parameterArray['fieldConf']['exclude'] && !$backendUser->check('non_exclude_fields', $table . ':' . $fieldName)
|| $parameterArray['fieldConf']['config']['type'] === 'passthrough'
// @todo: Drop option "showIfRTE" ?
|| !$backendUser->isRTE() && $parameterArray['fieldConf']['config']['showIfRTE']
|| $GLOBALS['TCA'][$table]['ctrl']['languageField'] && !$parameterArray['fieldConf']['l10n_display'] && $parameterArray['fieldConf']['l10n_mode'] === 'exclude' && ($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] > 0)
|| $GLOBALS['TCA'][$table]['ctrl']['languageField'] && $this->globalOptions['localizationMode'] && $this->globalOptions['localizationMode'] !== $parameterArray['fieldConf']['l10n_cat']
......
......@@ -432,7 +432,6 @@ class FormEngine {
'inlineStructure' => $this->inlineStackProcessor->getStructure(),
'overruleTypesArray' => array(),
'hiddenFieldListArray' => $this->hiddenFieldListArr,
'isAjaxContext' => FALSE,
'flexFormFieldIdentifierPrefix' => 'ID',
'nodeFactory' => $this->nodeFactory,
);
......@@ -535,7 +534,6 @@ class FormEngine {
$options['inlineRelatedRecordToRender'] = $record;
$options['inlineRelatedRecordConfig'] = $config;
$options['inlineStructure'] = $this->inlineStackProcessor->getStructure();
$options['isAjaxContext'] = TRUE;
$options['renderType'] = 'inlineRecordContainer';
$childArray = $this->nodeFactory->create($options)->render();
......@@ -657,7 +655,6 @@ class FormEngine {
$options['inlineRelatedRecordToRender'] = $record;
$options['inlineRelatedRecordConfig'] = $config;
$options['inlineStructure'] = $this->inlineStackProcessor->getStructure();
$options['isAjaxContext'] = TRUE;
$options['renderType'] = 'inlineRecordContainer';
$childArray = $this->nodeFactory->create($options)->render();
......@@ -756,7 +753,6 @@ class FormEngine {
$options['inlineRelatedRecordToRender'] = $row;
$options['inlineRelatedRecordConfig'] = $parent['config'];
$options['inlineStructure'] = $this->inlineStackProcessor->getStructure();
$options['isAjaxContext'] = TRUE;
$options['renderType'] = 'inlineRecordContainer';
$childArray = $this->nodeFactory->create($options)->render();
......@@ -1026,7 +1022,7 @@ class FormEngine {
*/
protected function getInlineHeadTags() {
$headTags = array();
$headDataRaw = $this->JStop() . $this->getJavaScriptAndStyleSheetsOfPageRenderer();
$headDataRaw = $this->JStop() . $this->getJavaScriptOfPageRenderer();
if ($headDataRaw) {
// Create instance of the HTML parser:
$parseObj = GeneralUtility::makeInstance(HtmlParser::class);
......@@ -1035,7 +1031,10 @@ class FormEngine {
// Removes leading spaces of a multi-line string:
$headDataRaw = trim(preg_replace('/(^|\\r|\\n)( |\\t)+/', '$1', $headDataRaw));
// Get script and link tags:
$tags = array_merge($parseObj->getAllParts($parseObj->splitTags('link', $headDataRaw)), $parseObj->getAllParts($parseObj->splitIntoBlock('script', $headDataRaw)));
$tags = array_merge(
$parseObj->getAllParts($parseObj->splitTags('link', $headDataRaw)),
$parseObj->getAllParts($parseObj->splitIntoBlock('script', $headDataRaw))
);
foreach ($tags as $tagData) {
$tagAttributes = $parseObj->get_tag_attributes($parseObj->getFirstTag($tagData), TRUE);
$headTags[] = array(
......@@ -1057,13 +1056,12 @@ class FormEngine {
* @return string
* @todo: aaaargs ...
*/
protected function getJavaScriptAndStyleSheetsOfPageRenderer() {
protected function getJavaScriptOfPageRenderer() {
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer = clone $GLOBALS['SOBE']->doc->getPageRenderer();
$pageRenderer->setCharSet($this->getLanguageService()->charSet);
$pageRenderer->setTemplateFile('EXT:backend/Resources/Private/Templates/helper_javascript_css.html');
$javaScriptAndStyleSheets = $pageRenderer->render();
return $javaScriptAndStyleSheets;
return $pageRenderer->render();
}
/**
......@@ -1202,12 +1200,8 @@ class FormEngine {
*/
public function JStop() {
$out = '';
// Additional top HTML:
if (!empty($this->additionalCode_pre)) {
$out .= implode('
<!-- NEXT: -->
', $this->additionalCode_pre);
$out = implode(LF, $this->additionalCode_pre) . LF;
}
return $out;
}
......@@ -1244,6 +1238,8 @@ class FormEngine {
$pageRenderer->loadPrototype();
$pageRenderer->loadJquery();
$pageRenderer->loadExtJS();
// rtehtmlarea needs extjs quick tips (?)
$pageRenderer->enableExtJSQuickTips();
$beUserAuth = $this->getBackendUserAuthentication();
// Make textareas resizable and flexible ("autogrow" in height)
$textareaSettings = array(
......
<?php
namespace TYPO3\CMS\Backend\Rte;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* RTE base class: Delivers browser-detection, TCEforms binding and transformation routines
* for the "rte" extension, registering it with the RTE API
* See "rte" extension for usage.
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
class AbstractRte {
/**
* Error messages regarding non-availability is collected here.
*
* @var array
*/
public $errorLog = array();
/**
* Set this to the extension key of the RTE so it can identify itself.
*
* @var string
*/
public $ID = '';
/***********************************
*
* Main API functions;
* When you create alternative RTEs, simply override these functions in your parent class.
* See the "rte" or "rtehtmlarea" extension as an example!
*
**********************************/
/**
* Returns TRUE if the RTE is available. Here you check if the browser requirements are met.
* If there are reasons why the RTE cannot be displayed you simply enter them as text in ->errorLog
*
* @return bool TRUE if this RTE object offers an RTE in the current browser environment
*/
public function isAvailable() {
return TRUE;
}
/**
* Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....)
* Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
*
* @param object $pObj parent object
* @param string $table The table name
* @param string $field The field name
* @param array $row The current row from which field is being rendered
* @param array $PA Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
* @param array $specConf "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
* @param array $thisConfig Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
* @param string $RTEtypeVal Record "type" field value.
* @param string $RTErelPath Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
* @param int $thePidValue PID value of record (true parent page id)
* @return string HTML code for RTE!
*/
public function drawRTE($pObj, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue) {
// Transform value:
$value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
// Create item:
$item = '
' . $this->triggerField($PA['itemFormElName']) . '
<textarea name="' . htmlspecialchars($PA['itemFormElName']) . '"' . $pObj->formWidth('48') . ' rows="20" wrap="off" style="background-color: #99eebb;">' . GeneralUtility::formatForTextarea($value) . '</textarea>';
// Return form item:
return $item;
}
/**
* Performs transformation of content to/from RTE. The keyword $dirRTE determines the direction.
* This function is called in two situations:
* a) Right before content from database is sent to the RTE (see ->drawRTE()) it might need transformation
* b) When content is sent from the RTE and into the database it might need transformation back again (going on in TCEmain class; You can't affect that.)
*
* @param string $dirRTE Keyword: "rte" means direction from db to rte, "db" means direction from Rte to DB
* @param string $value Value to transform.
* @param string $table The table name
* @param string $field The field name
* @param array $row The current row from which field is being rendered
* @param array $specConf "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
* @param array $thisConfig Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
* @param string $RTErelPath Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
* @param int $pid PID value of record (true parent page id)
* @return string Transformed content
*/
public function transformContent($dirRTE, $value, $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $pid) {
if ($specConf['rte_transform']) {
$p = \TYPO3\CMS\Backend\Utility\BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
// There must be a mode set for transformation
if ($p['mode']) {
// Initialize transformation:
$parseHTML = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\RteHtmlParser::class);
$parseHTML->init($table . ':' . $field, $pid);
$parseHTML->setRelPath($RTErelPath);
// Perform transformation:
$value = $parseHTML->RTE_transform($value, $specConf, $dirRTE, $thisConfig);
}
}
return $value;
}
/***********************************
*
* Helper functions
*
**********************************/
/**
* Trigger field - this field tells the TCEmain that processing should be done on this value!
*
* @param string $fieldName Field name of the RTE field.
* @return string <input> field of type "hidden" with a flag telling the TCEmain that this fields content should be transformed back to database state.
*/
public function triggerField($fieldName) {
$triggerFieldName = preg_replace('/\\[([^]]+)\\]$/', '[_TRANSFORM_\\1]', $fieldName);
return '<input type="hidden" name="' . htmlspecialchars($triggerFieldName) . '" value="RTE" />';
}
}
......@@ -810,7 +810,7 @@ class BackendUtility {
* Note: This method is very similar to \TYPO3\CMS\Backend\Form\FormEngine::getRTypeNum(),
* however, it has two differences:
* 1) The method in TCEForms also takes care of localization (which is difficult to do here as the whole infrastructure for language overlays is only in TCEforms).
* 2) The $rec array looks different in TCEForms, as in there it's not the raw record but the \TYPO3\CMS\Backend\Form\DataPreprocessor version of it, which changes e.g. how "select"
* 2) The $row array looks different in TCEForms, as in there it's not the raw record but the \TYPO3\CMS\Backend\Form\DataPreprocessor version of it, which changes e.g. how "select"
* and "group" field values are stored, which makes different processing of the "foreign pointer field" type field variant necessary.
*
* @param string $table Table name present in TCA
......@@ -867,7 +867,7 @@ class BackendUtility {
/**
* Parses "defaultExtras" of $GLOBALS['TCA'] columns config section to an array.
* Elements are splitted by ":" and within those parts, parameters are splitted by "|".
* Elements are split by ":" and within those parts, parameters are split by "|".
*
* See unit tests for details.
*
......@@ -3568,8 +3568,7 @@ class BackendUtility {
* @internal
*/
static public function getPidForModTSconfig($table, $uid, $pid) {
$retVal = $table == 'pages' && MathUtility::canBeInterpretedAsInteger($uid) ? $uid : $pid;
return $retVal;
return $table === 'pages' && MathUtility::canBeInterpretedAsInteger($uid) ? $uid : $pid;
}
/**
......@@ -3605,7 +3604,8 @@ class BackendUtility {
* @param string $table Table name
* @param int $uid Record uid
* @param int $pid Record pid
* @return array Array of two ints; first is the REAL PID of a record and if its a new record negative values are resolved to the true PID, second value is the PID value for TSconfig (uid if table is pages, otherwise the pid)
* @return array Array of two ints; first is the REAL PID of a record and if its a new record negative values are resolved to the true PID,
* second value is the PID value for TSconfig (uid if table is pages, otherwise the pid)
* @internal
* @see \TYPO3\CMS\Core\DataHandling\DataHandler::setHistory(), \TYPO3\CMS\Core\DataHandling\DataHandler::process_datamap()
*/
......@@ -3660,7 +3660,8 @@ class BackendUtility {
}
/**
* Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain
* Returns processed RTE setup from an array with TSconfig.
* Merges table and type specific RTE configuration into 'default.'
*
* @param array $RTEprop The properties of Page TSconfig in the key "RTE.
* @param string $table Table name
......@@ -3687,8 +3688,10 @@ class BackendUtility {
* Usage: $RTEobj = BackendUtility::RTEgetObj();
*
* @return mixed If available, returns RTE object, otherwise an array of messages from possible RTEs
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
static public function RTEgetObj() {
GeneralUtility::logDeprecatedFunction();
// If no RTE object has been set previously, try to create it:
if (!isset($GLOBALS['T3_VAR']['RTEobj'])) {
// Set the object string to blank by default:
......
......@@ -2045,7 +2045,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
return FALSE;
}
$p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
if (isset($specConf['richtext'])) {
BackendUtility::fixVersioningPid($table, $row);
list($tscPID, $thePidValue) = BackendUtility::getTSCpid($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
......
###CSS_LIBS###
###CSS_INCLUDE###
###CSS_INLINE###
###JS_LIBS###
###JS_INCLUDE###
###JS_INLINE###
......
......@@ -72,7 +72,6 @@ return array(
't3lib_recordList' => \TYPO3\CMS\Backend\RecordList\AbstractRecordList::class,
'TBE_browser_recordList' => \TYPO3\CMS\Backend\RecordList\ElementBrowserRecordList::class,
't3lib_localRecordListGetTableHook' => \TYPO3\CMS\Backend\RecordList\RecordListGetTableHookInterface::class,
't3lib_rteapi' => \TYPO3\CMS\Backend\Rte\AbstractRte::class,
'extDirect_dataProvider_BackendLiveSearch' => \TYPO3\CMS\Backend\Search\LiveSearch\ExtDirect\LiveSearchDataProvider::class,
't3lib_search_liveSearch' => \TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch::class,
't3lib_search_liveSearch_queryParser' => \TYPO3\CMS\Backend\Search\LiveSearch\QueryParser::class,
......@@ -1164,7 +1163,6 @@ return array(
'tx_rtehtmlarea_image_folderTree' => \TYPO3\CMS\Rtehtmlarea\FolderTree::class,
'tx_rtehtmlarea_pageTree' => \TYPO3\CMS\Rtehtmlarea\PageTree::class,
'tx_rtehtmlarea_api' => \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi::class,
'tx_rtehtmlarea_base' => \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase::class,
'tx_rtehtmlarea_select_image' => \TYPO3\CMS\Rtehtmlarea\SelectImage::class,
'tx_rtehtmlarea_user' => \TYPO3\CMS\Rtehtmlarea\Controller\UserElementsController::class,
'TYPO3\\CMS\\Rtehtmlarea\\ImageFolderTree' => \TYPO3\CMS\Rtehtmlarea\FolderTree::class,
......
......@@ -366,11 +366,6 @@ class TBE_browser_recordList extends \TYPO3\CMS\Backend\RecordList\ElementBrowse
*/
interface t3lib_localRecordListGetTableHook extends \TYPO3\CMS\Backend\RecordList\RecordListGetTableHookInterface {}
/**
* @deprecated since 6.0, removed since 7.0
*/
abstract class t3lib_rteapi extends \TYPO3\CMS\Backend\Rte\AbstractRte {}
/**
* @deprecated since 6.0, removed since 7.0
*/
......@@ -5776,11 +5771,6 @@ class tx_rtehtmlarea_pageTree extends \TYPO3\CMS\Rtehtmlarea\PageTree {}
*/
class tx_rtehtmlarea_api extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {}
/**
* @deprecated since 6.0, removed since 7.0
*/
class tx_rtehtmlarea_base extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {}
/**
* @deprecated since 6.0, removed since 7.0
*/
......
......@@ -27,7 +27,6 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
* functions for the authentication process of backend users.
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
* @internal
*/
class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication {
......@@ -157,12 +156,6 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
*/
public $userTS_dontGetCached = FALSE;
/**
* RTE availability errors collected.
* @var array
*/
public $RTE_errors = array();
/**
* Contains last error message
* @var string
......@@ -545,26 +538,12 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
}
/**
* Returns TRUE if the RTE (Rich Text Editor) can be enabled for the user
* Strictly this is not permissions being checked but rather a series of settings like
* a loaded extension, browser/client type and a configuration option in ->uc[edit_RTE]
* The reasons for a FALSE return can be found in $this->RTE_errors
* Returns TRUE if the RTE (Rich Text Editor) is enabled for the user.
*
* @return bool
*/
public function isRTE() {
// Start:
$this->RTE_errors = array();
if (!$this->uc['edit_RTE']) {
$this->RTE_errors[] = 'RTE is not enabled for user!';
}
// Acquire RTE object:
$RTE = BackendUtility::RTEgetObj();
if (!is_object($RTE)) {
$this->RTE_errors = array_merge($this->RTE_errors, $RTE);
}
return empty($this->RTE_errors);
return (bool)$this->uc['edit_RTE'];
}
/**
......
......@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\Database\RelationHandler;
use TYPO3\CMS\Core\Html\RteHtmlParser;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Resource\ResourceFactory;
......@@ -1545,13 +1546,9 @@ class DataHandler {
}
$RTEsetup = $this->BE_USER->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
$thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $table, $vconf['field'], $theTypeString);
// Get RTE object, draw form and set flag:
$RTEobj = BackendUtility::RTEgetObj();
if (is_object($RTEobj)) {
$fieldArray[$vconf['field']] = $RTEobj->transformContent('db', $fieldArray[$vconf['field']], $table, $vconf['field'], $currentRecord, $vconf['spec'], $thisConfig, '', $currentRecord['pid']);
} else {
debug('NO RTE OBJECT FOUND!');
}
$fieldArray[$vconf['field']] = $this->transformRichtextContentToDatabase(
$fieldArray[$vconf['field']], $table, $vconf['field'], $vconf['spec'], $thisConfig, $currentRecord['pid']
);
}
}
}
......@@ -1559,6 +1556,34 @@ class DataHandler {
return $fieldArray;
}
/**
* Performs transformation of content from richtext element to database.
*
* @param string $value Value to transform.
* @param string $table The table name
* @param string $field The field name
* @param array $defaultExtras Default extras configuration of this field - typically "richtext:rte_transform[mode=ts_css]"
* @param array $thisConfig Configuration for RTEs; A mix between TSconfig and others. Configuration for additional transformation information
* @param int $pid PID value of record (true parent page id)
* @return string Transformed content
*/
protected function transformRichtextContentToDatabase($value, $table, $field, $defaultExtras, $thisConfig, $pid) {
if ($defaultExtras['rte_transform']) {
$parameters = BackendUtility::getSpecConfParametersFromArray($defaultExtras['rte_transform']['parameters']);
// There must be a mode set for transformation, this is typically 'ts_css'
if ($parameters['mode']) {
// Initialize transformation:
$parseHTML = GeneralUtility::makeInstance(RteHtmlParser::class);
$parseHTML->init($table . ':' . $field, $pid);
$parseHTML->setRelPath('');
// Perform transformation:
$value = $parseHTML->RTE_transform($value, $defaultExtras, 'db', $thisConfig);
}
}
return $value;
}
/*********************************************
*
* Evaluation of input values
......@@ -3011,13 +3036,9 @@ class DataHandler {
// Find, thisConfig:
$RTEsetup = $this->BE_USER->getTSConfig('RTE', BackendUtility::getPagesTSconfig($CVtscPID));
$thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $CVtable, $recFieldName, $theTypeString);
// Get RTE object, draw form and set flag:
$RTEobj = BackendUtility::RTEgetObj();
if (is_object($RTEobj)) {
$res['value'] = $RTEobj->transformContent('db', $res['value'], $CVtable, $recFieldName, $this->checkValue_currentRecord, $specConf, $thisConfig, '', $CVrealPid);
} else {
debug('NO RTE OBJECT FOUND!');
}
$res['value'] = $this->transformRichtextContentToDatabase(
$res['value'], $CVtable, $recFieldName, $specConf, $thisConfig, $CVrealPid
);
}
}
}
......
......@@ -146,7 +146,8 @@ class ExtensionManagementUtility {
throw new \BadFunctionCallException('TYPO3 Fatal Error: Extension key "' . $key . '" is NOT loaded!', 1365429673);
}
$relativePathToSiteRoot = self::siteRelPath($key);
if (substr($relativePathToSiteRoot, 0, $typo3MainDirLength = strlen(TYPO3_mainDir)) === TYPO3_mainDir) {
$typo3MainDirLength = strlen(TYPO3_mainDir);
if (substr($relativePathToSiteRoot, 0, $typo3MainDirLength) === TYPO3_mainDir) {
$relativePathToSiteRoot = substr($relativePathToSiteRoot, $typo3MainDirLength);
} else {
$relativePathToSiteRoot = '../' . $relativePathToSiteRoot;
......
......@@ -309,7 +309,6 @@ return array(
'diff_path' => 'diff', // Path to "diff" including the program name. Example: /somepath/specialdiff<br />For Windows this program can be downloaded here: <a href="http://unxutils.sourceforge.net/" target="_blank">unxutils.sourceforge.net</a>
'fileadminDir' => 'fileadmin/', // Path to the fileadmin dir. This is relative to PATH_site, DefaultStorage will be created with that configuration, do not access manually but ResourceFactory::getDefaultStorage()
'RTE_imageStorageDir' => 'uploads/', // Default storage directory for Rich Text Editor files
'RTE_reg' => array(), // Contains arrays of possible RTEs available (keys=extKey, values=cfg-array). Each array contains a key, "objRef", which contains a user function call with prefixed script path and instanciating a persistent global object. This can report back if browser requirements are OK, draw the RTE and do the transformations needed.
'lockRootPath' => '', // This path is used to evaluate if paths outside of PATH_site should be allowed. Ending slash required!
'userHomePath' => '', // Combined folder identifier of the directory where TYPO3 backend-users have their home-dirs. A combined folder identifier looks like this: [storageUid]:[folderIdentifier]. Eg. '2:users/'. A home for backend user 2 would be: '2:users/2/'. Ending slash required!
'groupHomePath' => '', // Combined folder identifier of the directory where TYPO3 backend-groups have their home-dirs. A combined folder identifier looks like this: [storageUid]:[folderIdentifier]. Eg. '2:groups/'. A home for backend group 1 would be: '2:groups/1/'. Ending slash required!
......
......@@ -7,22 +7,74 @@ Description
The ``RTE`` implementation was based on the main classes ``\TYPO3\CMS\Backend\Rte\AbstractRte``,
``\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase`` and ``\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi``. These
three main API classes contain changed signatures and internal method calls.
three main API were removed or changed method signatures and internal method calls.
The functionality to render ``RTE`` standalone and out of a context of ``FormEngine`` was dropped.
Impact
======
Extensions that extend those classes and rely on methods being called are likely to break.
Main API changes
----------------
* Method ``TYPO3\CMS\Backend\Utility\BackendUtility::RTEgetObj()`` is deprecated and no longer used.
``FormEngine`` now creates a ``RichTextElement`` with ``NodeFactory`` and ``makeInstance()``, the
created object is not a singleton but a prototype.
* With the deprecation of ``RTEgetObj`` method ``transformContent`` from ``AbstractRte`` has been inlined to
``DataHandler``.
* Method ``isAvailable`` from ``AbstractRte`` has been dropped. Every valid browser and browser version
for TYPO3 CMS 7 can render the default richtext editor nowadays. Custom checks may be implement via
``NodeResolverInterface`` in ``FormEngine``.
* Property ``RTE_errors`` in ``TYPO3\CMS\Core\Authentication\BackendUserAuthentication`` has been dropped along
with the ``RTEgetObj()`` deprecation.
RTE registration
----------------
* Different richtext implementations can no longer register in ``$GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']``.
Instead, registration in ``FormEngine`` must be done via ``NodeFactory`` API, method ``drawRTE`` has been dropped.
* Transformations are not available via ``AbstractRte`` anymore, hooks within ``RteHtmlParser`` can
be used for custom transformations.
PHP classes
-----------
* ``\TYPO3\CMS\Backend\Rte\AbstractRte`` has been dropped.
* ``\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase`` has been dropped and functionality moved to
``\TYPO3\CMS\Rtehtmlarea\Form\Element\RichtextElement``. All methods and properties except
the main entry method ``render()`` used by ``FormEngine`` are protected.
* ``\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi`` has been refactored. Method ``main()`` receives
a configuration array instead of an instance of the parent object. Some methods were dropped
and are no longer called.
RTE Plugin Configuration
------------------------
* Parameter ``$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['anExtensionKey']['plugins']['aPluginName']['addIconsToSkin']''
was dropped, plugin property ``relativePathToSkin`` is no longer evaluated.
* A couple of helper methods were added to ``RteHtmlAreaApi``
* This API may get further changes in the future.
Affected Installations
======================
Extensions that extend one of the above mentioned extensions.
Extensions that extend one of the above mentioned extensions or API.
Migration