[FEATURE] Number of files per page in file list configurable 61/47761/6
authorStephan Großberndt <stephan@grossberndt.de>
Mon, 18 Apr 2016 18:02:16 +0000 (20:02 +0200)
committerNicole Cordes <typo3@cordes.co>
Tue, 19 Apr 2016 09:44:24 +0000 (11:44 +0200)
It is now possible to configure the maximum number of files shown per
page in the file list module using User TSconfig.

Releases: master
Resolves: #72923
Change-Id: Ifb4e55f320c0188c69f3dac10d6b5f3cbed12da4
Reviewed-on: https://review.typo3.org/47761
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/core/Documentation/Changelog/master/Feature-72923-ConfigurableFileListSize.rst [new file with mode: 0644]
typo3/sysext/filelist/Classes/FileList.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-72923-ConfigurableFileListSize.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-72923-ConfigurableFileListSize.rst
new file mode 100644 (file)
index 0000000..0e92f4f
--- /dev/null
@@ -0,0 +1,15 @@
+==================================================================================
+Feature: #72923 - Configure the number of files shown per page in file list module
+==================================================================================
+
+Description
+===========
+
+It is now possible to configure the maximum number of files shown per page in the file list module using User TSconfig.
+
+.. code-block:: typoscript
+
+   mod.file_list {
+      filesPerPage = 40
+   }
+
index df84970..45b85a2 100644 (file)
@@ -33,6 +33,7 @@ use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\Utility\ListUtility;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Filelist\Controller\FileListController;
 
 /**
@@ -194,6 +195,11 @@ class FileList extends AbstractRecordList
         parent::__construct();
         $this->fileListController = $fileListController;
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
+        $modTSconfig = BackendUtility::getModTSconfig(0, 'mod.file_list');
+        if (!empty($modTSconfig['properties']['filesPerPage'])) {
+            $this->iLimit = MathUtility::forceIntegerInRange($modTSconfig['properties']['filesPerPage'], 1);
+        }
     }
 
     /**