Project

General

Profile

Feature #24041 » 0016374_4-4.patch

Administrator Admin, 2010-11-13 19:13

View differences:

t3lib/class.t3lib_loaddbgroup.php (Arbeitskopie)
var $MM_insert_fields = array(); // array of fields and value pairs used for insert in MM table
var $MM_table_where = ''; // extra MM table where
/**
* @var boolean
*/
protected $updateReferenceIndex = TRUE;
/**
* Initialization of the class.
......
}
/**
* Sets whether the reference index shall be updated.
*
* @param boolean $updateReferenceIndex Whether the reference index shall be updated
* @return void
*/
public function setUpdateReferenceIndex($updateReferenceIndex) {
$this->updateReferenceIndex = (bool)$updateReferenceIndex;
}
/**
* Explodes the item list and stores the parts in the internal arrays itemArray and tableArray from MM records.
*
* @param string Item list
......
$whereClause .= ' AND '.$foreign_table_field.'='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->currentTable, $foreign_table);
}
// Select children in the same workspace:
if (t3lib_BEfunc::isTableWorkspaceEnabled($this->currentTable) && t3lib_BEfunc::isTableWorkspaceEnabled($foreign_table)) {
$currentRecord = t3lib_BEfunc::getRecord($this->currentTable, $uid, 't3ver_wsid', '', $useDeleteClause);
$whereClause .= t3lib_BEfunc::getWorkspaceWhereClause($foreign_table, $currentRecord['t3ver_wsid']);
}
// get the correct sorting field
if ($conf['foreign_sortby']) { // specific manual sortby for data handled by this field
if ($conf['symmetric_sortby'] && $conf['symmetric_field']) {
......
*
* @param string Table name
* @param integer Record UID
* @return void
* @return array Information concerning modifications delivered by t3lib_refindex::updateRefIndexTable()
*/
function updateRefIndex($table,$id) {
$refIndexObj = t3lib_div::makeInstance('t3lib_refindex');
$result = $refIndexObj->updateRefIndexTable($table,$id);
if ($this->updateReferenceIndex === TRUE) {
/** @var $refIndexObj t3lib_refindex */
$refIndexObj = t3lib_div::makeInstance('t3lib_refindex');
return $refIndexObj->updateRefIndexTable($table,$id);
}
}
/**
t3lib/class.t3lib_tcemain.php (Arbeitskopie)
var $copyMappingArray = Array(); // Used by the copy action to track the ids of new pages so subpages are correctly inserted! THIS is internally cleared for each executed copy operation! DO NOT USE THIS FROM OUTSIDE! Read from copyMappingArray_merged instead which is accumulating this information.
var $remapStack = array(); // array used for remapping uids and values at the end of process_datamap
var $remapStackRecords = array(); // array used for remapping uids and values at the end of process_datamap (e.g. $remapStackRecords[<table>][<uid>] = <index in $remapStack>)
protected $remapStackChildIds = array(); // array used for checking whether new children need to be remapped
protected $remapStackActions = array(); // array used for executing addition actions after remapping happened (sett processRemapStack())
protected $remapStackRefIndex = array(); // array used for executing post-processing on the reference index
var $updateRefIndexStack = array(); // array used for additional calls to $this->updateRefIndex
var $callFromImpExp = false; // tells, that this TCEmain was called from tx_impext - this variable is set by tx_impexp
var $newIndexMap = array(); // Array for new flexform index mapping
......
}
$phShadowId = $this->insertDB($table,$id,$fieldArray,TRUE,0,TRUE); // When inserted, $this->substNEWwithIDs[$id] will be changed to the uid of THIS version and so the interface will pick it up just nice!
if ($phShadowId) {
$this->placeholderShadowing($table,$phShadowId);
// Processes fields of the placeholder record:
$this->triggerRemapAction(
$table,
$id,
array($this, 'placeholderShadowing'),
array($table, $phShadowId)
);
// Hold auto-versionized ids of placeholders:
$this->autoVersionIdMap[$table][$this->substNEWwithIDs[$id]] = $phShadowId;
}
......
// check, if there is a NEW... id in the value, that should be substituded later
if (strpos($value, 'NEW') !== false) {
$this->remapStackRecords[$table][$id] = array('remapStackIndex' => count($this->remapStack));
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = array(
'func' => 'checkValue_group_select_processDBdata',
'args' => array($valueArray, $tcaFieldConf, $id, $status, 'select', $table, $field),
......
// We need to decide whether we use the stack or can save the relation directly.
if(strpos($value, 'NEW') !== false || !t3lib_div::testInt($id)) {
$this->remapStackRecords[$table][$id] = array('remapStackIndex' => count($this->remapStack));
$this->addNewValuesToRemapStackChildIds($valueArray);
$this->remapStack[] = array(
'func' => 'checkValue_inline_processDBdata',
'args' => array($valueArray, $tcaFieldConf, $id, $status, $table, $field),
......
$this->accumulateForNotifEmail = array(); // Reset notification array
// Resolve dependencies of version/workspaces actions:
$this->cmdmap = $this->getCommandMap($this->cmdmap)->process()->get();
// Traverse command map:
foreach (array_keys($this->cmdmap) as $table) {
......
}
break;
case 'swap':
$swapMode = $this->BE_USER->getTSConfigVal('options.workspaces.swapMode');
$elementList = array();
if ($swapMode == 'any' || ($swapMode == 'page' && $table == 'pages')) {
// check if we are allowed to do synchronios publish. We must have a single element in the cmdmap to be allowed
if (count($this->cmdmap) == 1 && count($this->cmdmap[$table]) == 1) {
$elementList = $this->findPageElementsForVersionSwap($table, $id, $value['swapWith']);
}
}
if (count($elementList) == 0) {
$elementList[$table][] = array($id, $value['swapWith']);
}
foreach ($elementList as $tbl => $idList) {
foreach ($idList as $idKey => $idSet) {
$this->version_swap($tbl,$idSet[0],$idSet[1],$value['swapIntoWS']);
}
}
$this->version_swap($table, $id, $value['swapWith'], $value['swapIntoWS']);
break;
case 'clearWSID':
$this->version_clearWSID($table,$id);
......
$this->version_clearWSID($table,$id,TRUE);
break;
case 'setStage':
$elementList = array();
$idList = $elementList[$table] = t3lib_div::trimExplode(',',$id,1);
$setStageMode = $this->BE_USER->getTSConfigVal('options.workspaces.changeStageMode');
if ($setStageMode == 'any' || $setStageMode == 'page') {
if (count($idList) == 1) {
$rec = t3lib_BEfunc::getRecord($table, $idList[0], 't3ver_wsid');
$workspaceId = $rec['t3ver_wsid'];
}
else {
$workspaceId = $this->BE_USER->workspace;
}
if ($table !== 'pages') {
if ($setStageMode == 'any') {
// (1) Find page to change stage and (2) find other elements from the same ws to change stage
$pageIdList = array();
$this->findPageIdsForVersionStateChange($table, $idList, $workspaceId, $pageIdList, $elementList);
$this->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
}
}
else {
// Find all elements from the same ws to change stage
$this->findRealPageIds($idList);
$this->findPageElementsForVersionStageChange($idList, $workspaceId, $elementList);
}
$elementIds = t3lib_div::trimExplode(',', $id, TRUE);
foreach ($elementIds as $elementId) {
$this->version_setStage($table, $elementId, $value['stageId'],
(isset($value['comment']) && $value['comment'] ? $value['comment'] : $this->generalComment),
TRUE);
}
foreach ($elementList as $tbl => $elementIdList) {
foreach($elementIdList as $elementId) {
$this->version_setStage($tbl,$elementId,$value['stageId'],$value['comment']?$value['comment']:$this->generalComment, TRUE);
}
}
break;
}
break;
......
}
// Finally, before exit, check if there are ID references to remap. This might be the case if versioning or copying has taken place!
$this->processRemapStack();
$this->remapListedDBRecords();
......
if ($theNewSQLID) {
$this->copyRecord_fixRTEmagicImages($table, t3lib_BEfunc::wsMapId($table, $theNewSQLID));
$this->copyMappingArray[$table][$origUid] = $theNewSQLID;
// Keep automatically versionized record information:
if (isset($copyTCE->autoVersionIdMap[$table][$theNewSQLID])) {
$this->autoVersionIdMap[$table][$theNewSQLID] = $copyTCE->autoVersionIdMap[$table][$theNewSQLID];
}
}
// Copy back the cached TSconfig
......
} else {
if (!t3lib_div::testInt($realDestPid)) {
$newId = $this->copyRecord($v['table'], $v['id'], -$v['id']);
} elseif ($realDestPid == -1) {
$newId = $this->versionizeRecord($v['table'], $v['id'], 'Auto-created for WS #'.$this->BE_USER->workspace);
} elseif ($realDestPid == -1 && t3lib_BEfunc::isTableWorkspaceEnabled($v['table'])) {
$workspaceVersion = t3lib_BEfunc::getWorkspaceVersionOfRecord(
$this->BE_USER->workspace, $v['table'], $v['id'], 'uid'
);
// If workspace version does not exist, create a new one:
if ($workspaceVersion === FALSE) {
$newId = $this->versionizeRecord($v['table'], $v['id'], 'Auto-created for WS #' . $this->BE_USER->workspace);
// If workspace version already exists, use it:
} else {
$newId = $workspaceVersion['uid'];
}
} else {
$newId = $this->copyRecord_raw($v['table'], $v['id'], $realDestPid);
}
......
// Execute the copy:
$newId = $this->copyRecord($table, $uid, -$uid, 1, $overrideValues, implode(',', $excludeFields), $language);
$autoVersionNewId = $this->getAutoVersionId($table, $newId);
if (is_null($autoVersionNewId) === FALSE) {
$this->triggerRemapAction(
$table,
$newId,
array($this, 'placeholderShadowing'),
array($table, $autoVersionNewId),
TRUE
);
}
} else {
// Create new record:
......
if (t3lib_div::testInt($type) && isset($elementsOriginal[$type])) {
$item = $elementsOriginal[$type];
$item['id'] = $this->localize($item['table'], $item['id'], $language);
$item['id'] = $this->overlayAutoVersionId($item['table'], $item['id']);
$dbAnalysisCurrent->itemArray[] = $item;
} elseif (t3lib_div::inList('localize,synchronize', $type)) {
foreach ($elementsOriginal as $originalId => $item) {
$item['id'] = $this->localize($item['table'], $item['id'], $language);
$item['id'] = $this->overlayAutoVersionId($item['table'], $item['id']);
$dbAnalysisCurrent->itemArray[] = $item;
}
}
......
$verTablesArray[] = $tN;
}
}
// Remove the possible inline child tables from the tables to be versioniozed automatically:
$verTablesArray = array_diff($verTablesArray, $this->getPossibleInlineChildTablesOfParentTable('pages'));
// Begin to copy pages if we're allowed to:
if ($this->admin || in_array('pages',$allowedTablesArray)) {
......
$this->deleteEl($table, $movePlhID, TRUE, TRUE); // For delete + completely delete!
} else { // Otherwise update the movePlaceholder:
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table,'uid='.intval($movePlhID),$movePlh);
$this->updateRefIndex($table,$movePlhID);
$this->addRemapStackRefIndex($table, $movePlhID);
}
}
......
$this->newlog2(($swapIntoWS ? 'Swapping' : 'Publishing').' successful for table "'.$table.'" uid '.$id.'=>'.$swapWith, $table, $id, $swapVersion['pid']);
// Update reference index of the live record:
$this->updateRefIndex($table,$id);
$this->addRemapStackRefIndex($table, $id);
// Set log entry for live record:
$propArr = $this->getRecordPropertiesFromRow($table, $swapVersion);
if ( $propArr['_ORIG_pid'] == -1) {
......
$this->setHistory($table, $id, $theLogId);
// Update reference index of the offline record:
$this->updateRefIndex($table,$swapWith);
$this->addRemapStackRefIndex($table, $swapWith);
// Set log entry for offline record:
$propArr = $this->getRecordPropertiesFromRow($table, $curVersion);
if ( $propArr['_ORIG_pid'] == -1) {
......
// Process pointer fields on normalized database:
if ($inlineType == 'field') {
// Read relations that point to the current record (e.g. live record):
// Read relations that point to the current record (e.g. live record):
/** @var $dbAnalysisCur t3lib_loadDBGroup */
$dbAnalysisCur = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysisCur->setUpdateReferenceIndex(FALSE);
$dbAnalysisCur->start('', $conf['foreign_table'], '', $curVersion['uid'], $table, $conf);
// Read relations that point to the record to be swapped with e.g. draft record):
// Read relations that point to the record to be swapped with e.g. draft record):
/** @var $dbAnalysisSwap t3lib_loadDBGroup */
$dbAnalysisSwap = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysisSwap->setUpdateReferenceIndex(FALSE);
$dbAnalysisSwap->start('', $conf['foreign_table'], '', $swapVersion['uid'], $table, $conf);
// Update relations for both (workspace/versioning) sites:
$dbAnalysisCur->writeForeignField($conf,$curVersion['uid'],$swapVersion['uid']);
$dbAnalysisSwap->writeForeignField($conf,$swapVersion['uid'],$curVersion['uid']);
$items = array_merge($dbAnalysisCur->itemArray, $dbAnalysisSwap->itemArray);
foreach ($items as $item) {
$this->addRemapStackRefIndex($item['table'], $item['id']);
}
// Swap field values (CSV):
// BUT: These values will be swapped back in the next steps, when the *CHILD RECORD ITSELF* is swapped!
} elseif ($inlineType == 'list') {
......
/*********************************************
*
* Cmd: Helper functions
......
$this->remapListedDBRecords_procDBRefs($conf, $value, $theUidToUpdate, $table);
} elseif ($inlineType !== false) {
/** @var $dbAnalysis t3lib_loadDBGroup */
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->start($value, $conf['foreign_table'], '', 0, $table, $conf);
// Update child records if using pointer fields ('foreign_field'):
if ($inlineType == 'field') {
$dbAnalysis->writeForeignField($conf, $uid, $theUidToUpdate);
}
// If the current field is set on a page record, update the pid of related child records:
if ($table == 'pages') {
$thePidToUpdate = $theUidToUpdate;
......
$thePidToUpdate = $this->copyMappingArray_merged['pages'][$thePidToUpdate];
}
// Update child records if using pointer fields ('foreign_field'):
if ($inlineType == 'field') {
$dbAnalysis->writeForeignField($conf, $uid, $theUidToUpdate);
}
// Update child records if change to pid is required:
// Update child records if change to pid is required (only if the current record is not on a workspace):
if ($thePidToUpdate) {
$updateValues = array('pid' => $thePidToUpdate);
foreach ($dbAnalysis->itemArray as $v) {
if ($v['id'] && $v['table']) {
if ($v['id'] && $v['table'] && is_null(t3lib_BEfunc::getLiveVersionIdOfRecord($v['table'], $v['id']))) {
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($v['table'], 'uid='.intval($v['id']), $updateValues);
}
}
......
* @return void
*/
function processRemapStack() {
// Processes the remap stack:
if(is_array($this->remapStack)) {
foreach($this->remapStack as $remapAction) {
// If no position index for the arguments was set, skip this remap action:
......
}
}
}
// Processes the remap stack actions:
if ($this->remapStackActions) {
foreach ($this->remapStackActions as $action) {
if (isset($action['callback']) && isset($action['arguments'])) {
call_user_func_array(
$action['callback'],
$action['arguments']
);
}
}
}
// Processes the reference index updates of the remap stack:
foreach ($this->remapStackRefIndex as $table => $idArray) {
foreach ($idArray as $id) {
$this->updateRefIndex($table, $id);
unset($this->remapStackRefIndex[$table][$id]);
}
}
// Reset:
$this->remapStack = array();
$this->remapStackRecords = array();
$this->remapStackActions = array();
$this->remapStackRefIndex = array();
}
/**
* Triggers a remap action for a specific record.
*
* Some records are post-processed by the processRemapStack() method (e.g. IRRE children).
* This method determines wether an action/modification is executed directly to a record
* or is postponed to happen after remapping data.
*
* @param string $table Name of the table
* @param string $id Id of the record (can also be a "NEW..." string)
* @param array $callback The method to be called
* @param array $arguments The arguments to be submitted to the callback method
* @param boolean $forceRemapStackActions Whether to force to use the stack
* @return void
*
* @see processRemapStack
*/
protected function triggerRemapAction($table, $id, array $callback, array $arguments, $forceRemapStackActions = FALSE) {
// Check whether the affected record is marked to be remapped:
if (!$forceRemapStackActions && !isset($this->remapStackRecords[$table][$id]) && !isset($this->remapStackChildIds[$id])) {
call_user_func_array($callback, $arguments);
} else {
$this->remapStackActions[] = array(
'affects' => array(
'table' => $table,
'id' => $id,
),
'callback' => $callback,
'arguments' => $arguments,
);
}
}
/**
* Adds a table-id-pair to the reference index remapping stack.
*
* @param string $table
* @param integer $id
* @return void
*/
protected function addRemapStackRefIndex($table, $id) {
$this->remapStackRefIndex[$table][$id] = $id;
}
/**
* If a parent record was versionized on a workspace in $this->process_datamap,
* it might be possible, that child records (e.g. on using IRRE) were affected.
* This function finds these relations and updates their uids in the $incomingFieldArray.
......
}
return $result;
}
/**
* Gets all possible child tables that are used on each parent table as field.
*
* @param string $parentTable
* @param array $possibleInlineChildren
* @return array
*/
protected function getPossibleInlineChildTablesOfParentTable($parentTable, array $possibleInlineChildren = array()) {
t3lib_div::loadTCA($parentTable);
foreach ($GLOBALS['TCA'][$parentTable]['columns'] as $parentField => $parentFieldDefinition) {
if (isset($parentFieldDefinition['config']['type'])) {
$parentFieldConfiguration = $parentFieldDefinition['config'];
if ($parentFieldConfiguration['type'] == 'inline' && isset($parentFieldConfiguration['foreign_table'])) {
if (!in_array($parentFieldConfiguration['foreign_table'], $possibleInlineChildren)) {
$possibleInlineChildren = $this->getPossibleInlineChildTablesOfParentTable(
$parentFieldConfiguration['foreign_table'],
array_merge($possibleInlineChildren, $parentFieldConfiguration['foreign_table'])
);
}
}
}
}
return $possibleInlineChildren;
}
/**
* Gets the automatically versionized id of a record.
*
* @param string $table Name of the table
* @param integer $id Uid of the record
* @return integer
*/
protected function getAutoVersionId($table, $id) {
$result = NULL;
if (isset($this->autoVersionIdMap[$table][$id])) {
$result = $this->autoVersionIdMap[$table][$id];
}
return $result;
}
/**
* Overlays the automatically versionized id of a record.
*
* @param string $table Name of the table
* @param integer $id Uid of the record
* @return integer
*/
protected function overlayAutoVersionId($table, $id) {
$autoVersionId = $this->getAutoVersionId($table, $id);
if (is_null($autoVersionId) === FALSE) {
$id = $autoVersionId;
}
return $id;
}
/**
* Adds new values to the remapStackChildIds array.
*
* @param array $idValues uid values
* @return void
*/
protected function addNewValuesToRemapStackChildIds(array $idValues) {
foreach ($idValues as $idValue) {
if (strpos($idValue, 'NEW') === 0) {
$this->remapStackChildIds[$idValue] = TRUE;
}
}
}
/**
* @return t3lib_TCEmain_CommandMap
*/
protected function getCommandMap(array $commandMap) {
return t3lib_div::makeInstance('t3lib_TCEmain_CommandMap', $this, $commandMap);
}
}
t3lib/class.t3lib_tcemain_commandmap.php (Revision 40148)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Oliver Hader <oliver@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Handles the t3lib_TCEmain command map and is only used in combination with t3lib_TCEmain.
*/
class t3lib_TCEmain_CommandMap {
const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage';
const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode';
const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
const KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback';
const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
/**
* @var t3lib_TCEmain
*/
protected $parent;
/**
* @var array
*/
protected $commandMap = array();
/**
* @var string
*/
protected $workspacesSwapMode;
/**
* @var string
*/
protected $workspacesChangeStageMode;
/**
* @var boolean
*/
protected $workspacesConsiderReferences;
/**
* @var array
*/
protected $scopes;
/**
* Creates this object.
*
* @param t3lib_TCEmain $parent
* @param array $commandMap
*/
public function __construct(t3lib_TCEmain $parent, array $commandMap) {
$this->setParent($parent);
$this->set($commandMap);
$this->setWorkspacesSwapMode($parent->BE_USER->getTSConfigVal('options.workspaces.swapMode'));
$this->setWorkspacesChangeStageMode($parent->BE_USER->getTSConfigVal('options.workspaces.changeStageMode'));
$this->setWorkspacesConsiderReferences($parent->BE_USER->getTSConfigVal('options.workspaces.considerReferences'));
$this->constructScopes();
}
/**
* Gets the command map.
*
* @return array
*/
public function get() {
return $this->commandMap;
}
/**
* Sets the command map.
*
* @param array $commandMap
* @return t3lib_TCEmain_CommandMap
*/
public function set(array $commandMap) {
$this->commandMap = $commandMap;
return $this;
}
/**
* Gets the parent object.
*
* @return t3lib_TCEmain
*/
public function getParent() {
return $this->parent;
}
/**
* Sets the parent object.
*
* @param t3lib_TCEmain $parent
* @return t3lib_TCEmain_CommandMap
*/
public function setParent(t3lib_TCEmain $parent) {
$this->parent = $parent;
return $this;
}
/**
* Sets the workspaces swap mode
* (see options.workspaces.swapMode).
*
* @param string $workspacesSwapMode
* @return t3lib_TCEmain_CommandMap
*/
public function setWorkspacesSwapMode($workspacesSwapMode) {
$this->workspacesSwapMode = (string)$workspacesSwapMode;
return $this;
}
/**
* Sets the workspaces change stage mode
* see options.workspaces.changeStageMode)
*
* @param string $workspacesChangeStageMode
* @return t3lib_TCEmain_CommandMap
*/
public function setWorkspacesChangeStageMode($workspacesChangeStageMode) {
$this->workspacesChangeStageMode = (string)$workspacesChangeStageMode;
return $this;
}
/**
* Sets the workspace behaviour to automatically consider references
* (see options.workspaces.considerReferences)
*
* @param boolean $workspacesConsiderReferences
* @return t3lib_TCEmain_CommandMap
*/
public function setWorkspacesConsiderReferences($workspacesConsiderReferences) {
$this->workspacesConsiderReferences = (bool)$workspacesConsiderReferences;
return $this;
}
/**
* Processes the command map.
*
* @return t3lib_TCEmain_CommandMap
*/
public function process() {
$this->resolveWorkspacesSwapDependencies();
$this->resolveWorkspacesSetStageDependencies();
return $this;
}
/**
* Resolves workspaces related dependencies for swapping/publishing of the command map.
* Workspaces records that have children or (relative) parents which are versionized
* but not published with this request, are removed from the command map. Otherwise
* this would produce hanging record sets and lost references.
*
* @return void
*/
protected function resolveWorkspacesSwapDependencies() {
$scope = self::SCOPE_WorkspacesSwap;
$dependency = $this->getDependencyUtility($scope);
foreach ($this->commandMap as $table => $liveIdCollection) {
foreach ($liveIdCollection as $liveId => $commandCollection) {
foreach ($commandCollection as $command => $properties) {
if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
if (isset($properties['swapWith']) && t3lib_div::testInt($properties['swapWith'])) {
$this->addWorkspacesSwapElements($dependency, $table, $liveId, $properties);
}
}
}
}
}
$this->applyWorkspacesDependencies($dependency, $scope);
}
/**
* Adds workspaces elements for swapping/publishing and takes care of the swapMode.
*
* @param t3lib_utility_Dependency $dependency
* @param string $table
* @param iteger $liveId
* @param array $properties
* @return void
*/
protected function addWorkspacesSwapElements(t3lib_utility_Dependency $dependency, $table, $liveId, array $properties) {
$elementList = array();
// Fetch accordant elements if the swapMode is 'any' or 'pages':
if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
$elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
}
foreach ($elementList as $elementTable => $elementIdArray) {
foreach ($elementIdArray as $elementIds) {
$dependency->addElement(
$elementTable, $elementIds[1],
array('liveId' => $elementIds[0], 'properties' => array_merge($properties, array('swapWith' => $elementIds[1])))
);
}
}
if (count($elementList) === 0) {
$dependency->addElement(
$table, $properties['swapWith'], array('liveId' => $liveId, 'properties' => $properties)
);
}
}
/**
* Resolves workspaces related dependencies for staging of the command map.
* Workspaces records that have children or (relative) parents which are versionized
* but not staged with this request, are removed from the command map.
*
* @return void
*/
protected function resolveWorkspacesSetStageDependencies() {
$scope = self::SCOPE_WorkspacesSetStage;
$dependency = $this->getDependencyUtility($scope);
foreach ($this->commandMap as $table => $liveIdCollection) {
foreach ($liveIdCollection as $liveIdList => $commandCollection) {
foreach ($commandCollection as $command => $properties) {
if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
if (isset($properties['stageId']) && t3lib_div::testInt($properties['stageId'])) {
$this->addWorkspacesSetStageElements($dependency, $table, $liveIdList, $properties);
$this->explodeSetStage($table, $liveIdList, $properties);
}
}
}
}
}
$this->applyWorkspacesDependencies($dependency, $scope);
}
/**
* Adds workspaces elements for staging and takes care of the changeStageMode.
*
* @param t3lib_utility_Dependency $dependency
* @param string $table
* @param string $liveIdList
* @param array $properties
* @return void
*/
protected function addWorkspacesSetStageElements(t3lib_utility_Dependency $dependency, $table, $liveIdList, array $properties) {
$liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
$elementList = array($table => $liveIds);
if (t3lib_div::inList('any,pages', $this->workspacesChangeStageMode)) {
if (count($liveIds) === 1) {
$workspaceRecord = t3lib_BEfunc::getRecord($table, $liveIds[0], 't3ver_wsid');
$workspaceId = $workspaceRecord['t3ver_wsid'];
} else {
$workspaceId = $this->getParent()->BE_USER->workspace;
}
if ($table === 'pages') {
// Find all elements from the same ws to change stage
$this->getParent()->findRealPageIds($liveIds);
$this->getParent()->findPageElementsForVersionStageChange($liveIds, $workspaceId, $elementList);
} elseif ($this->workspacesChangeStageMode === 'any') {
// Find page to change stage:
$pageIdList = array();
$this->getParent()->findPageIdsForVersionStateChange($table, $liveIds, $workspaceId, $pageIdList, $elementList);
// Find other elements from the same ws to change stage:
$this->getParent()->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
}
}
foreach ($elementList as $elementTable => $elementIds) {
foreach($elementIds as $elementId) {
$dependency->addElement(
$elementTable, $elementId,
array('properties' => $properties)
);
}
}
}
/**
* Explodes id-lists in the command map for staging actions.
*
* @throws RuntimeException
* @param string $table
* @param string $liveIdList
* @param array $properties
* @return void
*/
protected function explodeSetStage($table, $liveIdList, array $properties) {
$extractedCommandMap = array();
$liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
if (count($liveIds) > 1) {
foreach ($liveIds as $liveId) {
if (isset($this->commandMap[$table][$liveId]['version'])) {
throw new RuntimeException('Command map for [' . $table . '][' . $liveId . '][version] was already set.', 1289391048);
}
$extractedCommandMap[$table][$liveId]['version'] = $properties;
}
$this->remove($table, $liveIdList, 'version');
$this->mergeToBottom($extractedCommandMap);
}
}
/**
* Applies the workspaces dependencies and removes incomplete structures or automatically
* completes them, depending on the options.workspaces.considerReferences setting
*
* @param t3lib_utility_Dependency $dependency
* @param string $scope
* @return void
*/
protected function applyWorkspacesDependencies(t3lib_utility_Dependency $dependency, $scope) {
$transformDependentElementsToUseLiveId = $this->getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
$elementsToBeVersionized = $dependency->getElements();
if ($transformDependentElementsToUseLiveId) {
$elementsToBeVersionized = $this->transformDependentElementsToUseLiveId($elementsToBeVersionized);
}
$outerMostParents = $dependency->getOuterMostParents();
/** @var $outerMostParent t3lib_utility_Dependency_Element */
foreach ($outerMostParents as $outerMostParent) {
$dependentElements = $dependency->getNestedElements($outerMostParent);
if ($transformDependentElementsToUseLiveId) {
$dependentElements = $this->transformDependentElementsToUseLiveId($dependentElements);
}
$intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersionized);
if (count($intersectingElements) > 0) {
// If at least one element intersects but not all, throw away all elements of the depdendent structure:
if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === FALSE) {
$this->purgeWithErrorMessage($intersectingElements, $scope);
// If everything is fine or references shall be considered automatically:
} else {
$this->update(current($intersectingElements), $dependentElements, $scope);
}
}
}
}
/**
* Purges incomplete structures from the command map and triggers an error message.
*
* @param array $elements
* @param string $scope
* @return void
*/
protected function purgeWithErrorMessage(array $elements, $scope) {
/** @var $dependentElement t3lib_utility_Dependency_Element */
foreach ($elements as $element) {
$table = $element->getTable();
$id = $this->processCallback(
$this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback),
array($element)
);
$this->remove($table, $id, 'version');
$this->getParent()->log(
$table, $id,
5, 0, 1,
$this->getScopeData($scope, self::KEY_ScopeErrorMessage),
$this->getScopeData($scope, self::KEY_ScopeErrorCode),
array(
t3lib_BEfunc::getRecordTitle($table, t3lib_BEfunc::getRecord($table, $id)),
$table, $id
)
);
}
}
/**
* Updates the command map accordant to valid structures and takes care of the correct order.
*
* @param t3lib_utility_Dependency_Element $intersectingElement
* @param array $elements
* @param string $scope
* @return void
*/
protected function update(t3lib_utility_Dependency_Element $intersectingElement, array $elements, $scope) {
$orderedCommandMap = array();
$commonProperties = $this->processCallback(
$this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback),
array($intersectingElement)
);
/** @var $dependentElement t3lib_utility_Dependency_Element */
foreach ($elements as $element) {
$table = $element->getTable();
$id = $this->processCallback(
$this->getScopeData($scope, self::KEY_UpdateGetIdCallback),
array($element)
);
$this->remove($table, $id, 'version');
$orderedCommandMap[$table][$id]['version'] = array_merge(
$commonProperties,
$this->processCallback(
$this->getScopeData($scope, self::KEY_GetElementPropertiesCallback),
array($element)
)
);
}
// Ensure that ordered command map is on top of the command map:
$this->mergeToTop($orderedCommandMap);
}
/**
* Merges command map elements to the top of the current command map..
*
* @param array $commandMap
* @return void
*/
protected function mergeToTop(array $commandMap) {
$this->commandMap = t3lib_div::array_merge_recursive_overrule($commandMap, $this->commandMap);
}
/**
* Merges command map elements to the bottom of the current command map.
*
* @param array $commandMap
* @return void
*/
protected function mergeToBottom(array $commandMap) {
$this->commandMap = t3lib_div::array_merge_recursive_overrule($this->commandMap, $commandMap);
}
/**
* Removes an element from the command map.
*
* @param string $table
* @param string $id
* @param string $command (optional)
* @return void
*/
protected function remove($table, $id, $command = NULL) {
if (is_string($command)) {
unset($this->commandMap[$table][$id][$command]);
} else {
unset($this->commandMap[$table][$id]);
}
}
/**
* Callback to get the liveId of an dependent element.
*
* @param t3lib_utility_Dependency_Element $element
* @return integer
*/
protected function getElementLiveIdCallback(t3lib_utility_Dependency_Element $element) {
return $element->getDataValue('liveId');
}
/**
* Callback to get the real id of an dependent element.
*
* @param t3lib_utility_Dependency_Element $element
* @return integer
*/
protected function getElementIdCallback(t3lib_utility_Dependency_Element $element) {
return $element->getId();
}
/**
* Callback to get the specific properties of a dependent element for swapping/publishing.
*
* @param t3lib_utility_Dependency_Element $element
* @return array
*/
protected function getElementSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
return array(
'swapWith' => $element->getId(),
);
}
/**
* Callback to get common properties of dependent elements for swapping/publishing.
*
* @param t3lib_utility_Dependency_Element $element
* @return array
*/
protected function getCommonSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
$commonSwapProperties = array();
$elementProperties = $element->getDataValue('properties');
if (isset($elementProperties['action'])) {
$commonSwapProperties['action'] = $elementProperties['action'];
}
if (isset($elementProperties['swapIntoWS'])) {
$commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
}
return $commonSwapProperties;
}
/**
* Callback to get the specific properties of a dependent element for staging.
*
* @param t3lib_utility_Dependency_Element $element
* @return array
*/
protected function getElementSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
return $this->getCommonSetStagePropertiesCallback($element);
}
/**
* Callback to get common properties of dependent elements for staging.
*
* @param t3lib_utility_Dependency_Element $element
* @return array
*/
protected function getCommonSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
$commonSetStageProperties = array();
$elementProperties = $element->getDataValue('properties');
if (isset($elementProperties['stageId'])) {
$commonSetStageProperties['stageId'] = $elementProperties['stageId'];
}
if (isset($elementProperties['comment'])) {
$commonSetStageProperties['comment'] = $elementProperties['comment'];
}
return $commonSetStageProperties;
}
/**
* Gets an instance of the depency resolver utility.
*
* @return t3lib_utility_Dependency
*/
protected function getDependencyUtility($scope) {
/** @var $dependency t3lib_utility_Dependency */
$dependency = t3lib_div::makeInstance('t3lib_utility_Dependency');
$dependency->setOuterMostParentsRequireReferences(TRUE);
if ($this->getScopeData($scope, self::KEY_ElementConstructCallback)) {
$dependency->setEventCallback(
t3lib_utility_Dependency_Element::EVENT_Construct,
$this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementConstructCallback))
);
}
if ($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
$dependency->setEventCallback(
t3lib_utility_Dependency_Element::EVENT_CreateChildReference,
$this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback))
);
}
if ($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
$dependency->setEventCallback(
t3lib_utility_Dependency_Element::EVENT_CreateParentReference,
$this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback))
);
}
return $dependency;
}
/**
* Callback to determine whether a new child reference shall be considered in the dependency resolver utility.
*
* @param array $callerArguments
* @param array $targetArgument
* @param t3lib_utility_Dependency_Element $caller
* @param string $eventName
* @return string Skip response (if required)
*/
public function createNewDependentElementChildReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
/** @var $reference t3lib_utility_Dependency_Reference */
$reference = $callerArguments['reference'];
$fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($caller->getTable(), $reference->getField());
if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getParent()->getInlineFieldType($fieldCOnfiguration))) {
return t3lib_utility_Dependency_Element::RESPONSE_Skip;
}
}
/**
* Callback to determine whether a new parent reference shall be considered in the dependency resolver utility.
*
* @param array $callerArguments
* @param array $targetArgument
* @param t3lib_utility_Dependency_Element $caller
* @param string $eventName
* @return string Skip response (if required)
*/
public function createNewDependentElementParentReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
/** @var $reference t3lib_utility_Dependency_Reference */
$reference = $callerArguments['reference'];
$fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($reference->getElement()->getTable(), $reference->getField());
if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getParent()->getInlineFieldType($fieldCOnfiguration))) {
return t3lib_utility_Dependency_Element::RESPONSE_Skip;
}
}
/**
* Callback to add additional data to new elements created in the dependency resolver utility.
*
* @param t3lib_utility_Dependency_Element $caller
* @param array $callerArguments
* @param array $targetArgument
* @return void
*/
public function createNewDependentElementCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller) {
if ($caller->hasDataValue('liveId') === FALSE) {
$liveId = t3lib_BEfunc::getLiveVersionIdOfRecord($caller->getTable(), $caller->getId());
if (is_null($liveId) === FALSE) {
$caller->setDataValue('liveId', $liveId);
}
}
}
/**
* Transforms dependent elements to use the liveId as array key.
*
* @param array $elements Depedent elements, each of type t3lib_utility_Dependency_Element
* @return array
*/
protected function transformDependentElementsToUseLiveId(array $elements) {
$transformedElements = array();
/** @var $element t3lib_utility_Dependency_Element */
foreach ($elements as $element) {
$elementName = t3lib_utility_Dependency_Element::getIdentifier(
$element->getTable(), $element->getDataValue('liveId')
);
$transformedElements[$elementName] = $element;
}
return $transformedElements;
}
/**
* Constructs the scope settings.
* Currently the scopes for swapping/publishing and staging are available.
*
* @return void
*/
protected function constructScopes() {
$this->scopes = array(
self::SCOPE_WorkspacesSwap => array(
self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.',
self::KEY_ScopeErrorCode => 1288283630,
self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback',
self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
self::KEY_TransformDependentElementsToUseLiveId => TRUE,
),
self::SCOPE_WorkspacesSetStage => array(
self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.',
self::KEY_ScopeErrorCode => 1289342524,
self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
self::KEY_ElementConstructCallback => NULL,
self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
self::KEY_TransformDependentElementsToUseLiveId => FALSE,
),
);
}
/**
* Gets data for a particular scope.
*
* @throws RuntimeException
* @param string $scope
* @param string $key
* @return string
*/
protected function getScopeData($scope, $key) {
if (!isset($this->scopes[$scope])) {
throw new RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
}
return $this->scopes[$scope][$key];
}
/**
* Gets a new callback to be used in the dependency resolver utility.
*
* @param string $callbackMethod
* @param array $targetArguments
* @return t3lib_utility_Dependency_Callback
*/
protected function getDependencyCallback($method, array $targetArguments = array()) {
return t3lib_div::makeInstance('t3lib_utility_Dependency_Callback', $this, $method, $targetArguments);
}
/**
* Processes a local callback inside this object.
*
* @param string $method
* @param array $callbackArguments
* @return mixed
*/
protected function processCallback($method, array $callbackArguments) {
return call_user_func_array(array($this, $method), $callbackArguments);
}
}
t3lib/utility/class.t3lib_utility_dependency.php (Revision 40148)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Oliver Hader <oliver@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Object to handle and determine dependent references of elements.
*/
class t3lib_utility_Dependency {
/**
* @var t3lib_utility_Dependency_Factory
*/
protected $factory;
/**
* @var array
*/
protected $elements = array();
/**
* @var array
*/
protected $eventCallbacks = array();
/**
* @var boolean
*/
protected $outerMostParentsRequireReferences = FALSE;
/**
* @var array
*/
protected $outerMostParents;
/**
* Sets a callback for a particular event.
*
* @param string $eventName
* @param t3lib_utility_Dependency_Callback $callback
* @return t3lib_utility_Dependency
*/
public function setEventCallback($eventName, t3lib_utility_Dependency_Callback $callback) {
$this->eventCallbacks[$eventName] = $callback;
return $this;
}
/**
* Executes a registered callback (if any) for a particular event.
*
* @param string $eventName
* @param object $caller
* @param array $callerArguments
* @return mixed
*/
public function executeEventCallback($eventName, $caller, array $callerArguments = array()) {
if (isset($this->eventCallbacks[$eventName])) {
/** @var $callback t3lib_utility_Dependency_Callback */
$callback = $this->eventCallbacks[$eventName];
return $callback->execute($callerArguments, $caller, $eventName);
}
}
/**
* Sets the condition that outermost parents required at least one child or parent reference.
*
* @param boolean $outerMostParentsRequireReferences
* @return t3lib_utility_Dependency
*/
public function setOuterMostParentsRequireReferences($outerMostParentsRequireReferences) {
$this->outerMostParentsRequireReferences = (bool)$outerMostParentsRequireReferences;
return $this;
}
/**
* Adds an element to be checked for dependent references.
*
* @param string $table
* @param integer $id
* @param array $data
* @return t3lib_utility_Dependency_Element
*/
public function addElement($table, $id, array $data = array()) {
$element = $this->getFactory()->getElement($table, $id, $data, $this);
$elementName = $element->__toString();
$this->elements[$elementName] = $element;
return $element;
}
/**
* Gets the outermost parents that define complete dependent structure each.
*
* @return array
*/
public function getOuterMostParents() {
if (!isset($this->outerMostParents)) {
$this->outerMostParents = array();
/** @var $element t3lib_utility_Dependency_Element */
foreach ($this->elements as $element) {
$this->processOuterMostParent($element);
}
}
return $this->outerMostParents;
}
/**
* Processes and registers the outermost parents accordant to the registered elements.
*
* @param t3lib_utility_Dependency_Element $element
* @return void
*/
protected function processOuterMostParent(t3lib_utility_Dependency_Element $element) {
if ($this->outerMostParentsRequireReferences === FALSE || $element->hasReferences()) {
$outerMostParent = $element->getOuterMostParent();
if ($outerMostParent !== FALSE) {
$outerMostParentName = $outerMostParent->__toString();
if (!isset($this->outerMostParents[$outerMostParentName])) {
$this->outerMostParents[$outerMostParentName] = $outerMostParent;
}
}
}
}
/**
* Gets all nested elements (including the parent) of a particular outermost parent element.
*
* @throws RuntimeException
* @param t3lib_utility_Dependency_Element $outerMostParent
* @return array
*/
public function getNestedElements(t3lib_utility_Dependency_Element $outerMostParent) {
$outerMostParentName = $outerMostParent->__toString();
if (!isset($this->outerMostParents[$outerMostParentName])) {
throw new RuntimeException(
'Element "' . $outerMostParentName . '" was detected as outermost parent.',
1289318609
);
}
$nestedStructure = array_merge(
array($outerMostParentName => $outerMostParent),
$outerMostParent->getNestedChildren()
);
return $nestedStructure;
}
/**
* Gets the registered elements.
*
* @return array
*/
public function getElements() {
return $this->elements;
}
/**
* Gets an instance of the factory to keep track of element or reference entities.
*
* @return t3lib_utility_Dependency_Factory
*/
public function getFactory() {
if (!isset($this->factory)) {
$this->factory = t3lib_div::makeInstance('t3lib_utility_Dependency_Factory');
}
return $this->factory;
}
}
t3lib/utility/dependency/class.t3lib_utility_dependency_factory.php (Revision 40148)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Oliver Hader <oliver@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
... This diff was truncated because it exceeds the maximum size that can be displayed.
(2-2/2)