[TASK] Cleanup filelist 05/18005/2
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 4 Feb 2013 17:44:54 +0000 (18:44 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 11 Mar 2013 21:07:50 +0000 (22:07 +0100)
Change-Id: If107bd20db15d1881c12097adecd342b8e1979aa
Resolves: #45143
Releases: 6.1
Reviewed-on: https://review.typo3.org/18005
Reviewed-by: Stefan Neufeind
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Klee
Reviewed-by: Felix Kopp
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/class.file_list.inc
typo3/class.filelistfoldertree.php
typo3/interfaces/interface.filelist_editiconshook.php
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/filelist/Classes/FileListEditIconHookInterface.php
typo3/sysext/filelist/Classes/FileListFolderTree.php

index 9a3fa91..33b61e5 100644 (file)
@@ -4,5 +4,5 @@
  * and will be removed with 6.2. The class was renamed and is now located at:
  * typo3/sysext/file_list/Classes/FileList.php
  */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('file_list') . 'Classes/FileList.php';
+require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('filelist') . 'Classes/FileList.php';
 ?>
\ No newline at end of file
index 3f4a70c..5bfdfc0 100644 (file)
@@ -4,5 +4,5 @@
  * and will be removed with 6.2. The class was renamed and is now located at:
  * typo3/sysext/file_list/Classes/FileListFolderTree.php
  */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('file_list') . 'Classes/FileListFolderTree.php';
+require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('filelist') . 'Classes/FileListFolderTree.php';
 ?>
\ No newline at end of file
index fa13222..7d1fdba 100644 (file)
@@ -4,5 +4,5 @@
  * and will be removed with 6.2. The class was renamed and is now located at:
  * typo3/sysext/file_list/Classes/FileListEditIconHookInterface.php
  */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('file_list') . 'Classes/FileListEditIconHookInterface.php';
+require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('filelist') . 'Classes/FileListEditIconHookInterface.php';
 ?>
\ No newline at end of file
index 28784a9..4c6b55d 100644 (file)
@@ -1,6 +1,32 @@
 <?php
 namespace TYPO3\CMS\Filelist\Controller;
 
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
 /**
  * Script Class for creating the list of files in the File > Filelist module
  *
@@ -8,8 +34,9 @@ namespace TYPO3\CMS\Filelist\Controller;
  */
 class FileListController {
 
-       // Module configuration
        /**
+        * Module configuration
+        *
         * @todo Define visibility
         */
        public $MCONF = array();
@@ -24,9 +51,9 @@ class FileListController {
         */
        public $MOD_SETTINGS = array();
 
-       // Internal:
-       // Accumulated HTML output
        /**
+        * Accumulated HTML output
+        *
         * @todo Define visibility
         */
        public $content;
@@ -39,33 +66,40 @@ class FileListController {
         */
        public $doc;
 
-       // Internal, static: GPvars:
-       // "id" -> the path to list.
        /**
+        * "id" -> the path to list.
+        *
         * @todo Define visibility
         */
        public $id;
 
-       /* @var \TYPO3\CMS\Core\Resource\Folder $folderObject */
+       /**
+        * @var \TYPO3\CMS\Core\Resource\Folder
+        */
        protected $folderObject;
 
-       /* @var \TYPO3\CMS\Core\Messaging\FlashMessage $errorMessage */
+       /**
+        * @var \TYPO3\CMS\Core\Messaging\FlashMessage
+        */
        protected $errorMessage;
 
-       // Pointer to listing
        /**
+        * Pointer to listing
+        *
         * @todo Define visibility
         */
        public $pointer;
 
-       // "Table"
        /**
+        * "Table"
+        *
         * @todo Define visibility
         */
        public $table;
 
-       // Thumbnail mode.
        /**
+        * Thumbnail mode.
+        *
         * @todo Define visibility
         */
        public $imagemode;
@@ -154,7 +188,11 @@ class FileListController {
                        'bigControlPanel' => ''
                );
                // CLEANSE SETTINGS
-               $this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']);
+               $this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData(
+                       $this->MOD_MENU,
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'),
+                       $this->MCONF['name']
+               );
        }
 
        /**
@@ -417,5 +455,4 @@ class FileListController {
 
 }
 
-
 ?>
\ No newline at end of file
index 7163d80..2f0963f 100644 (file)
@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Filelist;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Class for rendering of File>Filelist
  *
@@ -33,14 +34,16 @@ namespace TYPO3\CMS\Filelist;
  */
 class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
 
-       // default Max items shown
        /**
+        * Default Max items shown
+        *
         * @todo Define visibility
         */
        public $iLimit = 40;
 
-       // Boolean. Thumbnails on records containing files (pictures)
        /**
+        * Boolean. Thumbnails on records containing files (pictures)
+        *
         * @todo Define visibility
         */
        public $thumbs = 0;
@@ -50,8 +53,9 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
         */
        public $widthGif = '<img src="clear.gif" width="1" height="1" hspace="165" alt="" />';
 
-       // Max length of strings
        /**
+        * Max length of strings
+        *
         * @todo Define visibility
         */
        public $fixedL = 30;
@@ -61,20 +65,23 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
         */
        public $script = '';
 
-       // If TRUE click menus are generated on files and folders
        /**
+        * If TRUE click menus are generated on files and folders
+        *
         * @todo Define visibility
         */
        public $clickMenus = 1;
 
-       // The field to sort by...
        /**
+        * The field to sort by
+        *
         * @todo Define visibility
         */
        public $sort = '';
 
-       // Reverse sorting flag
        /**
+        * Reverse sorting flag
+        *
         * @todo Define visibility
         */
        public $sortRev = 1;
@@ -94,7 +101,6 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
         */
        public $bigControlPanel = 0;
 
-       // internal
        /**
         * @todo Define visibility
         */
@@ -130,8 +136,9 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
         */
        protected $folderObject;
 
-       // Counting the elements no matter what...
        /**
+        * Counting the elements no matter what
+        *
         * @todo Define visibility
         */
        public $eCounter = 0;
@@ -272,24 +279,24 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                                foreach ($files as $file) {
                                        $fileObject = $storage->getFile($file['identifier']);
                                        switch ($this->sort) {
-                                       case 'size':
-                                               $sortingKey = $fileObject->getSize();
-                                               break;
-                                       case 'rw':
-                                               $sortingKey = ($fileObject->checkActionPermission('read') ? 'R' : '' . $fileObject->checkActionPermission('write')) ? 'W' : '';
-                                               break;
-                                       case 'fileext':
-                                               $sortingKey = $fileObject->getExtension();
-                                               break;
-                                       case 'tstamp':
-                                               $sortingKey = $fileObject->getModificationTime();
-                                               break;
-                                       default:
-                                               if ($fileObject->hasProperty($this->sort)) {
-                                                       $sortingKey = $fileObject->getProperty($this->sort);
-                                               } else {
-                                                       $sortingKey = $fileObject->getName();
-                                               }
+                                               case 'size':
+                                                       $sortingKey = $fileObject->getSize();
+                                                       break;
+                                               case 'rw':
+                                                       $sortingKey = ($fileObject->checkActionPermission('read') ? 'R' : '' . $fileObject->checkActionPermission('write')) ? 'W' : '';
+                                                       break;
+                                               case 'fileext':
+                                                       $sortingKey = $fileObject->getExtension();
+                                                       break;
+                                               case 'tstamp':
+                                                       $sortingKey = $fileObject->getModificationTime();
+                                                       break;
+                                               default:
+                                                       if ($fileObject->hasProperty($this->sort)) {
+                                                               $sortingKey = $fileObject->getProperty($this->sort);
+                                                       } else {
+                                                               $sortingKey = $fileObject->getName();
+                                                       }
                                        }
                                        $i = 0;
                                        while (isset($filesToSort[$sortingKey . $i])) {
@@ -418,37 +425,37 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                                $theData = array();
                                foreach ($this->fieldArray as $field) {
                                        switch ($field) {
-                                       case 'size':
-                                               $numFiles = $folderObject->getFileCount();
-                                               $theData[$field] = $numFiles . ' ' . $GLOBALS['LANG']->getLL(($numFiles === 1 ? 'file' : 'files'), TRUE);
-                                               break;
-                                       case 'rw':
-                                               $theData[$field] = (!$folderObject->checkActionPermission('read') ? ' ' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', TRUE) . '</strong></span>') . (!$folderObject->checkActionPermission('write') ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', TRUE) . '</strong></span>');
-                                               break;
-                                       case 'fileext':
-                                               $theData[$field] = $GLOBALS['LANG']->getLL('folder', TRUE);
-                                               break;
-                                       case 'tstamp':
-                                               // @todo: FAL: how to get the mtime info -- $theData[$field] = \TYPO3\CMS\Backend\Utility\BackendUtility::date($theFile['tstamp']);
-                                               $theData[$field] = '-';
-                                               break;
-                                       case 'file':
-                                               $theData[$field] = $this->linkWrapDir($title, $folderObject);
-                                               break;
-                                       case '_CLIPBOARD_':
-                                               $temp = '';
-                                               if ($this->bigControlPanel) {
-                                                       $temp .= $this->makeEdit($folderObject);
-                                               }
-                                               $temp .= $this->makeClip($folderObject);
-                                               $theData[$field] = $temp;
-                                               break;
-                                       case '_REF_':
-                                               $theData[$field] = $this->makeRef($folderObject);
-                                               break;
-                                       default:
-                                               $theData[$field] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($theFile[$field], $this->fixedL);
-                                               break;
+                                               case 'size':
+                                                       $numFiles = $folderObject->getFileCount();
+                                                       $theData[$field] = $numFiles . ' ' . $GLOBALS['LANG']->getLL(($numFiles === 1 ? 'file' : 'files'), TRUE);
+                                                       break;
+                                               case 'rw':
+                                                       $theData[$field] = (!$folderObject->checkActionPermission('read') ? ' ' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', TRUE) . '</strong></span>') . (!$folderObject->checkActionPermission('write') ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', TRUE) . '</strong></span>');
+                                                       break;
+                                               case 'fileext':
+                                                       $theData[$field] = $GLOBALS['LANG']->getLL('folder', TRUE);
+                                                       break;
+                                               case 'tstamp':
+                                                       // @todo: FAL: how to get the mtime info -- $theData[$field] = \TYPO3\CMS\Backend\Utility\BackendUtility::date($theFile['tstamp']);
+                                                       $theData[$field] = '-';
+                                                       break;
+                                               case 'file':
+                                                       $theData[$field] = $this->linkWrapDir($title, $folderObject);
+                                                       break;
+                                               case '_CLIPBOARD_':
+                                                       $temp = '';
+                                                       if ($this->bigControlPanel) {
+                                                               $temp .= $this->makeEdit($folderObject);
+                                                       }
+                                                       $temp .= $this->makeClip($folderObject);
+                                                       $theData[$field] = $temp;
+                                                       break;
+                                               case '_REF_':
+                                                       $theData[$field] = $this->makeRef($folderObject);
+                                                       break;
+                                               default:
+                                                       $theData[$field] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($theFile[$field], $this->fixedL);
+                                                       break;
                                        }
                                }
                                $out .= $this->addelement(1, $theIcon, $theData, ' class="file_list_normal"');
@@ -563,44 +570,44 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                                $theData = array();
                                foreach ($this->fieldArray as $field) {
                                        switch ($field) {
-                                       case 'size':
-                                               $theData[$field] = \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($fileObject->getSize(), $GLOBALS['LANG']->getLL('byteSizeUnits', TRUE));
-                                               break;
-                                       case 'rw':
-                                               $theData[$field] = '' . (!$fileObject->checkActionPermission('read') ? ' ' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', TRUE) . '</strong></span>') . (!$fileObject->checkActionPermission('write') ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', TRUE) . '</strong></span>');
-                                               break;
-                                       case 'fileext':
-                                               $theData[$field] = strtoupper($ext);
-                                               break;
-                                       case 'tstamp':
-                                               $theData[$field] = \TYPO3\CMS\Backend\Utility\BackendUtility::date($fileInfo['mtime']);
-                                               break;
-                                       case '_CLIPBOARD_':
-                                               $temp = '';
-                                               if ($this->bigControlPanel) {
-                                                       $temp .= $this->makeEdit($fileObject);
-                                               }
-                                               $temp .= $this->makeClip($fileObject);
-                                               $theData[$field] = $temp;
-                                               break;
-                                       case '_REF_':
-                                               $theData[$field] = $this->makeRef($fileObject);
-                                               break;
-                                       case 'file':
-                                               $theData[$field] = $this->linkWrapFile(htmlspecialchars($fileName), $fileObject);
-                                               // Thumbnails?
-                                               if ($this->thumbs && $this->isImage($ext)) {
-                                                       $processedFile = $fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array());
-                                                       if ($processedFile) {
-                                                               $thumbUrl = $processedFile->getPublicUrl(TRUE);
-                                                               $theData[$field] .= '<br /><img src="' . $thumbUrl . '" hspace="2" title="' . htmlspecialchars($fileName) . '" alt="" />';
+                                               case 'size':
+                                                       $theData[$field] = \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($fileObject->getSize(), $GLOBALS['LANG']->getLL('byteSizeUnits', TRUE));
+                                                       break;
+                                               case 'rw':
+                                                       $theData[$field] = '' . (!$fileObject->checkActionPermission('read') ? ' ' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('read', TRUE) . '</strong></span>') . (!$fileObject->checkActionPermission('write') ? '' : '<span class="typo3-red"><strong>' . $GLOBALS['LANG']->getLL('write', TRUE) . '</strong></span>');
+                                                       break;
+                                               case 'fileext':
+                                                       $theData[$field] = strtoupper($ext);
+                                                       break;
+                                               case 'tstamp':
+                                                       $theData[$field] = \TYPO3\CMS\Backend\Utility\BackendUtility::date($fileInfo['mtime']);
+                                                       break;
+                                               case '_CLIPBOARD_':
+                                                       $temp = '';
+                                                       if ($this->bigControlPanel) {
+                                                               $temp .= $this->makeEdit($fileObject);
+                                                       }
+                                                       $temp .= $this->makeClip($fileObject);
+                                                       $theData[$field] = $temp;
+                                                       break;
+                                               case '_REF_':
+                                                       $theData[$field] = $this->makeRef($fileObject);
+                                                       break;
+                                               case 'file':
+                                                       $theData[$field] = $this->linkWrapFile(htmlspecialchars($fileName), $fileObject);
+                                                       // Thumbnails?
+                                                       if ($this->thumbs && $this->isImage($ext)) {
+                                                               $processedFile = $fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array());
+                                                               if ($processedFile) {
+                                                                       $thumbUrl = $processedFile->getPublicUrl(TRUE);
+                                                                       $theData[$field] .= '<br /><img src="' . $thumbUrl . '" hspace="2" title="' . htmlspecialchars($fileName) . '" alt="" />';
+                                                               }
                                                        }
-                                               }
-                                               break;
-                                       default:
-                                               // @todo: fix the access on the array
-                                               $theData[$field] = htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($theFile[$field], $this->fixedL));
-                                               break;
+                                                       break;
+                                               default:
+                                                       // @todo: fix the access on the array
+                                                       $theData[$field] = htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($theFile[$field], $this->fixedL));
+                                                       break;
                                        }
                                }
                                $out .= $this->addelement(1, $theIcon, $theData, ' class="file_list_normal"');
@@ -759,5 +766,4 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
 
 }
 
-
-?>
\ No newline at end of file
+?>
index d1db915..2bc1a0f 100644 (file)
@@ -26,13 +26,14 @@ namespace TYPO3\CMS\Filelist;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Interface for classes which hook into file list module and manipulateds edit icon array
  *
  * @author Steffen Kamper <info@sk-typo3.de>
  */
-interface FileListEditIconHookInterface
-{
+interface FileListEditIconHookInterface {
+
        /**
         * Modifies edit icon array
         *
index cd9910c..8411fda 100644 (file)
@@ -26,11 +26,12 @@ namespace TYPO3\CMS\Filelist;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Extension class for the t3lib_filetree class, needed for drag and drop and ajax functionality
  *
  * @author Sebastian Kurfürst <sebastian@garbage-group.de>
- * @author Benjamin Mack   <bmack@xnos.org>
+ * @author Benjamin Mack <bmack@xnos.org>
  * @see class t3lib_browseTree
  */
 class FileListFolderTree extends \TYPO3\CMS\Backend\Tree\View\FolderTreeView {
@@ -72,5 +73,4 @@ class FileListFolderTree extends \TYPO3\CMS\Backend\Tree\View\FolderTreeView {
 
 }
 
-
 ?>
\ No newline at end of file