Skip to content
Snippets Groups Projects
Commit 501b5687 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Remove old sorting option for BE-Control

parent 728248ee
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,6 @@ class ControlViewHelper extends AbstractViewHelper {
$this->registerArgument('row', 'array', 'The row of the record', TRUE);
$this->registerArgument('allItems', 'array', 'allRows', FALSE);
$this->registerArgument('iter', 'array', 'current Iterator', FALSE);
$this->registerArgument('isManualSortingAllowed', 'bool', 'global flag', FALSE);
}
/**
......@@ -78,52 +77,45 @@ class ControlViewHelper extends AbstractViewHelper {
$languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
$languageService->includeLLFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
// manual sorting only makes sence if it is allowed, we got allItems + current Iterator
if (array_key_exists('isManualSortingAllowed', $this->arguments)
&& array_key_exists('allItems', $this->arguments)
&& array_key_exists('iter', $this->arguments)
&& $this->arguments['isManualSortingAllowed']
) {
// DatabaseRecordList has a $prevPrevUid, which might track back a page. We wont do that, 1st+last record are always
// not sortable in one direction
$uidPrev = FALSE;
$uidNext = FALSE;
$iterator = $this->arguments['iter'];
if (!$iterator['isFirst'] && $iterator['index'] !== 1) {
$uidPrev = '-' . $this->arguments['allItems'][$iterator['index'] - 2]['uid'];
}
if ($iterator['index'] === 1) {
$uidPrev = $row['pid'];
}
if (!$iterator['isLast']) {
$uidNext = '-' . $this->arguments['allItems'][$iterator['index'] + 1]['uid'];
}
// DatabaseRecordList has a $prevPrevUid, which might track back a page. We wont do that, 1st+last record are always
// not sortable in one direction
$uidPrev = FALSE;
$uidNext = FALSE;
$iterator = $this->arguments['iter'];
if (!$iterator['isFirst'] && $iterator['index'] !== 1) {
$uidPrev = '-' . $this->arguments['allItems'][$iterator['index'] - 2]['uid'];
}
if ($iterator['index'] === 1) {
$uidPrev = $row['pid'];
}
if (!$iterator['isLast']) {
$uidNext = '-' . $this->arguments['allItems'][$iterator['index'] + 1]['uid'];
}
$newCurrentTableArr = [
'prev' => [
$row['uid'] => $uidPrev
],
'next' => [
$row['uid'] => $uidNext
]
];
if (!$uidPrev) {
$newCurrentTableArr = [
'prev' => [
$row['uid'] => $uidPrev
],
'next' => [
$row['uid'] => $uidNext
]
];
if (!$uidPrev) {
$newCurrentTableArr = [
'next' => [
$row['uid'] => $uidNext
]
];
}
if (!$uidNext) {
$newCurrentTableArr = [
'prev' => [
$row['uid'] => $uidPrev
]
];
}
$databaseRecordList->id = $row['pid'];
$databaseRecordList->currentTable = $newCurrentTableArr;
}
if (!$uidNext) {
$newCurrentTableArr = [
'prev' => [
$row['uid'] => $uidPrev
]
];
}
$databaseRecordList->id = $row['pid'];
$databaseRecordList->currentTable = $newCurrentTableArr;
return $databaseRecordList->makeControl($table, $row);
}
......
......@@ -50,7 +50,7 @@
</be:link.editRecord>
</td>
<td nowrap="nowrap" class="col-control">
<f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" allItems="{paginator.paginatedItems}" iter="{iter}" isManualSortingAllowed="{isManualSortingAllowed}" /></f:format.raw>
<f:format.raw><sg:backend.control table="tx_sgjobs_domain_model_job" row="{job}" allItems="{paginator.paginatedItems}" iter="{iter}" /></f:format.raw>
</td>
</tr>
</f:for>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment