public function moveRecord(array &$row, &$relativeTo, $parameters, DataHandler $tceMain)
{
// Note: this condition is here in order to NOT perform any actions if
// the $relativeTo variable was passed by EXT:gridelements in which case
// it is invalid (not a negative/positive integer but a string).
if (FALSE === strpos($relativeTo, 'x')) {
if (0 - MiscellaneousUtility::UNIQUE_INTEGER_OVERHEAD > $relativeTo) {
// Fake relative to value - we can get the target from a session variable
list($parent, $column) = $this->getTargetAreaStoredInSession($relativeTo);
$row['tx_flux_parent'] = $parent;
$row['tx_flux_column'] = $column;
$row['sorting'] = $tceMain->getSortNumber('tt_content', 0, $row['pid']);
} elseif (0 <= (int) $relativeTo && FALSE === empty($parameters[1])) {
list($prefix, $column, $prefix2, , , $relativePosition, $relativeUid, $area) = GeneralUtility::trimExplode('-', $parameters[1]);
$relativeUid = (int) $relativeUid;
if ('colpos' === $prefix && 'page' === $prefix2) {
$row['colPos'] = $column;
$row['tx_flux_parent'] = $relativeUid;
$row['tx_flux_column'] = $area;
}
} elseif (0 > (int) $relativeTo) {
// inserting a new element after another element. Check column position of that element.
$relativeToRecord = $this->loadRecordFromDatabase(abs($relativeTo));
$row['tx_flux_parent'] = $relativeToRecord['tx_flux_parent'];
$row['tx_flux_column'] = $relativeToRecord['tx_flux_column'];
$row['colPos'] = $relativeToRecord['colPos'];
$row['sorting'] = $tceMain->resorting('tt_content', $relativeToRecord['pid'], 'sorting', abs($relativeTo));
} elseif (0 < (int) $relativeTo) {
// moving to first position in colPos, means that $relativeTo is the pid of the containing page
$row['sorting'] = $tceMain->getSortNumber('tt_content', 0, $relativeTo);
$row['tx_flux_parent'] = NULL;
$row['tx_flux_column'] = NULL;
} else {
$row['tx_flux_parent'] = NULL;
$row['tx_flux_column'] = NULL;
}
} else {
// $relativeTo variable was passed by EXT:gridelements
$row['tx_flux_parent'] = NULL;
$row['tx_flux_column'] = NULL;
}
if (0 < $row['tx_flux_parent']) {
$row['colPos'] = self::COLPOS_FLUXCONTENT;
}
$this->updateRecordInDatabase($row);
$this->updateMovePlaceholder($row);
}