Commit 4405c888 authored by Manuel Selbach's avatar Manuel Selbach Committed by Anja Leichsenring
Browse files

[TASK] Cleanup code of LocalizationController::process

Change-Id: I6db726bfff61c092309a971eb71e074c30cad046
Releases: master, 7.6
Resolves: #79378
Reviewed-on: https://review.typo3.org/51349

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Manuel Selbach's avatarManuel Selbach <manuel_selbach@yahoo.de>
Reviewed-by: Mona Muzaffar's avatarMona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent d20cd6cd
......@@ -209,8 +209,6 @@ class LocalizationController
*/
protected function process($params)
{
$pageId = (int)$params['pageId'];
$srcLanguageId = (int)$params['srcLanguageId'];
$destLanguageId = (int)$params['destLanguageId'];
// Build command map
......@@ -218,21 +216,20 @@ class LocalizationController
'tt_content' => []
];
for ($i = 0, $count = count($params['uidList']); $i < $count; ++$i) {
$currentUid = $params['uidList'][$i];
if ($params['action'] === static::ACTION_LOCALIZE) {
$cmd['tt_content'][$currentUid] = [
'localize' => $destLanguageId
];
} else {
$cmd['tt_content'][$currentUid] = [
'copyToLanguage' => $destLanguageId,
];
if (isset($params['uidList']) && is_array($params['uidList'])) {
foreach ($params['uidList'] as $currentUid) {
if ($params['action'] === static::ACTION_LOCALIZE) {
$cmd['tt_content'][$currentUid] = [
'localize' => $destLanguageId
];
} else {
$cmd['tt_content'][$currentUid] = [
'copyToLanguage' => $destLanguageId,
];
}
}
}
/** @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler->start([], $cmd);
$dataHandler->process_cmdmap();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment