2 namespace TYPO3\CMS\Recycler\Controller;
67 $view->setPartialRootPaths(array(
'default' => $extPath .
'Resources/Private/Partials'));
71 switch ($this->conf[
'action']) {
77 $content = $model->getTables($this->conf[
'startUid'], $this->conf[
'depth']);
79 case 'getDeletedRecords':
86 $model->loadData($this->conf[
'startUid'], $this->conf[
'table'], $this->conf[
'depth'], $this->conf[
'start'] .
',' . $this->conf[
'limit'], $this->conf[
'filterTxt']);
87 $deletedRowsArray = $model->getDeletedRows();
90 $totalDeleted = $model->getTotalCount($this->conf[
'startUid'], $this->conf[
'table'], $this->conf[
'depth'], $this->conf[
'filterTxt']);
94 $recordsArray = $controller->transform($deletedRowsArray, $totalDeleted);
97 $allowDelete = (bool)$this->
getBackendUser()->user[
'admin'] ?
true : (bool)$modTS[
'properties'][
'allowDelete'];
99 $view->setTemplatePathAndFilename($extPath .
'Resources/Private/Templates/Ajax/RecordsTable.html');
100 $view->assign(
'records', $recordsArray[
'rows']);
101 $view->assign(
'allowDelete', $allowDelete);
102 $view->assign(
'total', $recordsArray[
'total']);
104 'rows' => $view->render(),
105 'totalItems' => $recordsArray[
'total']
109 if (empty($this->conf[
'records']) || !is_array($this->conf[
'records'])) {
119 $success = $model->undeleteData($this->conf[
'records'], $this->conf[
'recursive']);
120 $affectedRecords = count($this->conf[
'records']);
121 $messageKey =
'flashmessage.undo.' . ($success ?
'success' :
'failure') .
'.' . ($affectedRecords === 1 ?
'singular' :
'plural');
127 case 'deleteRecords':
128 if (empty($this->conf[
'records']) || !is_array($this->conf[
'records'])) {
138 $success = $model->deleteData($this->conf[
'records']);
139 $affectedRecords = count($this->conf[
'records']);
140 $messageKey =
'flashmessage.delete.' . ($success ?
'success' :
'failure') .
'.' . ($affectedRecords === 1 ?
'singular' :
'plural');
147 $response->
getBody()->write(json_encode($content));
161 $beUser->uc[
'tx_recycler'][$identifier] = $data;