[CLEANUP] Replace count with empty in EXT:filelist 90/40690/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 27 Jun 2015 14:59:29 +0000 (16:59 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 27 Jun 2015 16:15:38 +0000 (18:15 +0200)
Resolves: #67783
Releases: master
Change-Id: If374d781e4e808291dd99b92dfaffd8653862ec3
Reviewed-on: http://review.typo3.org/40690
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/filelist/Classes/FileList.php

index d0c61a4..fb6a79b 100644 (file)
@@ -319,7 +319,7 @@ class FileListController {
                        // If the "cmd" was to delete files from the list (clipboard thing), do that:
                        if ($this->cmd == 'delete') {
                                $items = $this->filelist->clipObj->cleanUpCBC(GeneralUtility::_POST('CBC'), '_FILE', 1);
-                               if (count($items)) {
+                               if (!empty($items)) {
                                        // Make command array:
                                        $FILE = array();
                                        foreach ($items as $v) {
index 3953923..66a2ca0 100644 (file)
@@ -254,7 +254,7 @@ class FileList extends AbstractRecordList {
                        // Add paste button if clipboard is initialized
                        if ($this->clipObj instanceof Clipboard && $folderObject->checkActionPermission('write')) {
                                $elFromTable = $this->clipObj->elFromTable('_FILE');
-                               if (count($elFromTable)) {
+                               if (!empty($elFromTable)) {
                                        $addPasteButton = TRUE;
                                        $elToConfirm = array();
                                        foreach ($elFromTable as $key => $element) {
@@ -394,7 +394,7 @@ class FileList extends AbstractRecordList {
                                        $cells = array();
                                        $table = '_FILE';
                                        $elFromTable = $this->clipObj->elFromTable($table);
-                                       if (count($elFromTable) && $this->folderObject->checkActionPermission('write')) {
+                                       if (!empty($elFromTable) && $this->folderObject->checkActionPermission('write')) {
                                                $addPasteButton = TRUE;
                                                $elToConfirm = array();
                                                foreach ($elFromTable as $key => $element) {
@@ -838,7 +838,7 @@ class FileList extends AbstractRecordList {
                }
                // Display PASTE button, if directory:
                $elFromTable = $this->clipObj->elFromTable('_FILE');
-               if ($fileOrFolderObject instanceof Folder && count($elFromTable) && $fileOrFolderObject->checkActionPermission('write')) {
+               if ($fileOrFolderObject instanceof Folder && !empty($elFromTable) && $fileOrFolderObject->checkActionPermission('write')) {
                        $addPasteButton = TRUE;
                        $elToConfirm = array();
                        foreach ($elFromTable as $key => $element) {