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 { ...@@ -46,7 +46,6 @@ class ControlViewHelper extends AbstractViewHelper {
$this->registerArgument('row', 'array', 'The row of the record', TRUE); $this->registerArgument('row', 'array', 'The row of the record', TRUE);
$this->registerArgument('allItems', 'array', 'allRows', FALSE); $this->registerArgument('allItems', 'array', 'allRows', FALSE);
$this->registerArgument('iter', 'array', 'current Iterator', FALSE); $this->registerArgument('iter', 'array', 'current Iterator', FALSE);
$this->registerArgument('isManualSortingAllowed', 'bool', 'global flag', FALSE);
} }
/** /**
...@@ -78,52 +77,45 @@ class ControlViewHelper extends AbstractViewHelper { ...@@ -78,52 +77,45 @@ class ControlViewHelper extends AbstractViewHelper {
$languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class); $languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
$languageService->includeLLFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf'); $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 // DatabaseRecordList has a $prevPrevUid, which might track back a page. We wont do that, 1st+last record are always
if (array_key_exists('isManualSortingAllowed', $this->arguments) // not sortable in one direction
&& array_key_exists('allItems', $this->arguments) $uidPrev = FALSE;
&& array_key_exists('iter', $this->arguments) $uidNext = FALSE;
&& $this->arguments['isManualSortingAllowed'] $iterator = $this->arguments['iter'];
) { if (!$iterator['isFirst'] && $iterator['index'] !== 1) {
// DatabaseRecordList has a $prevPrevUid, which might track back a page. We wont do that, 1st+last record are always $uidPrev = '-' . $this->arguments['allItems'][$iterator['index'] - 2]['uid'];
// not sortable in one direction }
$uidPrev = FALSE; if ($iterator['index'] === 1) {
$uidNext = FALSE; $uidPrev = $row['pid'];
$iterator = $this->arguments['iter']; }
if (!$iterator['isFirst'] && $iterator['index'] !== 1) { if (!$iterator['isLast']) {
$uidPrev = '-' . $this->arguments['allItems'][$iterator['index'] - 2]['uid']; $uidNext = '-' . $this->arguments['allItems'][$iterator['index'] + 1]['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 = [ $newCurrentTableArr = [
'prev' => [
$row['uid'] => $uidPrev
],
'next' => [ 'next' => [
$row['uid'] => $uidNext $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); return $databaseRecordList->makeControl($table, $row);
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</be:link.editRecord> </be:link.editRecord>
</td> </td>
<td nowrap="nowrap" class="col-control"> <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> </td>
</tr> </tr>
</f:for> </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