Project

General

Profile

Bug #25168 » 17754.patch

Administrator Admin, 2011-02-27 15:12

View differences:

typo3/sysext/lowlevel/config/index.php (working copy)
if (t3lib_div::_GP('writetoexttables')) { // Write the line to extTables.php
// change value to $GLOBALS
$length = strpos($line, '[');
$var = substr($line, 0, $length);
$var = substr($line, 1, $length-1);
$changedLine = '$GLOBALS[\'' . substr($line, 1, $length - 1) . '\']' . substr($line, $length);
// insert line in extTables.php
// load current extTables.php
$extTables = t3lib_div::getURL(PATH_typo3conf . TYPO3_extTableDef_script);
// check if we're editing the TCA
if ($var == 'TCA') {
preg_match_all("/\['([^']+)'\]/", $line, $parts);
// anything else than ctrl section requires a loadTCA()
if ($parts[1][1] != 'ctrl') {
$loadTCA = 't3lib_div::loadTCA(\'' . $parts[1][0] . '\');';
// check if the loadTCA statement is not already present in the file
if (strpos($extTables, $loadTCA) === false)
$changedLine = $loadTCA . "\n" . $changedLine;
}
}
// insert line in extTables.php
$extTables = '<?php' . preg_replace('/<\?php|\?>/is', '', $extTables) . $changedLine . LF . '?>';
$success = t3lib_div::writeFile(PATH_typo3conf . TYPO3_extTableDef_script, $extTables);
if ($success) {
(2-2/4)