TYPO3 CMS  TYPO3_7-6
TableListViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * *
12  * This script is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
14  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
15  * General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with the script. *
19  * If not, see http://www.gnu.org/licenses/lgpl.html *
20  * *
21  * The TYPO3 project - inspiring people to share! *
22  * */
48 {
53 
57  public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
58  {
59  $this->configurationManager = $configurationManager;
60  }
61 
81  public function render($tableName, array $fieldList = [], $storagePid = null, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = false, $readOnly = false, $enableClickMenu = true, $clickTitleMode = null, $alternateBackgroundColors = false)
82  {
83  if ($alternateBackgroundColors) {
85  'The option alternateBackgroundColors has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.'
86  );
87  }
88 
89  $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
91  $dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
92  $dblist->pageRow = $pageinfo;
93  if ($readOnly === false) {
94  $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
95  }
96  $dblist->showClipboard = false;
97  $dblist->disableSingleTableView = true;
98  $dblist->clickTitleMode = $clickTitleMode;
99  $dblist->clickMenuEnabled = $enableClickMenu;
100  if ($storagePid === null) {
101  $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
102  $storagePid = $frameworkConfiguration['persistence']['storagePid'];
103  }
104  $dblist->start($storagePid, $tableName, (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
105  $dblist->allFields = true;
106  $dblist->dontShowClipControlPanels = true;
107  $dblist->displayFields = false;
108  $dblist->setFields = [$tableName => $fieldList];
109  $dblist->noControlPanels = true;
110  $dblist->sortField = $sortField;
111  $dblist->sortRev = $sortDescending;
112  $dblist->script = $_SERVER['REQUEST_URI'];
113  $dblist->generateList();
114  return $dblist->HTMLcode;
115  }
116 }
static readPageAccess($id, $perms_clause)
injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']