2 namespace TYPO3\CMS\Recordlist;
204 parent::__construct();
206 $this->moduleTemplate->getPageRenderer()->loadJquery();
207 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Recordlist/FieldSelectBox');
208 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Recordlist/Recordlist');
220 $this->perms_clause = $backendUser->getPagePermsClause(1);
222 $sessionData = $backendUser->getSessionData(__CLASS__);
223 $this->search_field = !empty($sessionData[
'search_field']) ? $sessionData[
'search_field'] :
'';
240 $backendUser->setAndSaveSessionData(RecordList::class, $sessionData);
241 $this->
getPageRenderer()->addInlineLanguageLabelFile(
'EXT:lang/locallang_mod_web_list.xlf');
252 $this->MOD_MENU = array(
253 'bigControlPanel' =>
'',
270 if ($this->clear_cache) {
272 $tce->stripslashes_values = 0;
273 $tce->start(array(), array());
274 $tce->clear_cacheCmd($this->
id);
283 public function main()
289 $access = is_array($this->pageinfo) ? 1 : 0;
294 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/AjaxDataHandler');
295 $calcPerms = $backendUser->calcPerms($this->pageinfo);
296 $userCanEditPage = $calcPerms &
Permission::PAGE_EDIT && !empty($this->
id) && ($backendUser->isAdmin() || (int)$this->pageinfo[
'editlock'] === 0);
297 if ($userCanEditPage) {
298 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/PageActions',
'function(PageActions) {
299 PageActions.setPageId(' . (
int)$this->
id .
');
300 PageActions.initializePageTitleRenaming();
303 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Recordlist/Tooltip');
306 if ($this->modTSconfig[
'properties'][
'enableDisplayBigControlPanel'] ===
'activated') {
307 $this->MOD_SETTINGS[
'bigControlPanel'] =
true;
308 }
elseif ($this->modTSconfig[
'properties'][
'enableDisplayBigControlPanel'] ===
'deactivated') {
309 $this->MOD_SETTINGS[
'bigControlPanel'] =
false;
312 if ($this->modTSconfig[
'properties'][
'enableClipBoard'] ===
'activated') {
313 $this->MOD_SETTINGS[
'clipBoard'] =
true;
314 }
elseif ($this->modTSconfig[
'properties'][
'enableClipBoard'] ===
'deactivated') {
315 $this->MOD_SETTINGS[
'clipBoard'] =
false;
317 if ($this->MOD_SETTINGS[
'clipBoard'] === null) {
318 $this->MOD_SETTINGS[
'clipBoard'] =
true;
322 if ($this->modTSconfig[
'properties'][
'enableLocalizationView'] ===
'activated') {
323 $this->MOD_SETTINGS[
'localization'] =
true;
324 }
elseif ($this->modTSconfig[
'properties'][
'enableLocalizationView'] ===
'deactivated') {
325 $this->MOD_SETTINGS[
'localization'] =
false;
331 $dblist->script = BackendUtility::getModuleUrl(
'web_list');
332 $dblist->calcPerms = $calcPerms;
333 $dblist->thumbs = $backendUser->uc[
'thumbnailsByDefault'];
335 $dblist->allFields = $this->MOD_SETTINGS[
'bigControlPanel'] || $this->table ? 1 : 0;
336 $dblist->localizationView = $this->MOD_SETTINGS[
'localization'];
337 $dblist->showClipboard = 1;
338 $dblist->disableSingleTableView = $this->modTSconfig[
'properties'][
'disableSingleTableView'];
339 $dblist->listOnlyInSingleTableMode = $this->modTSconfig[
'properties'][
'listOnlyInSingleTableView'];
340 $dblist->hideTables = $this->modTSconfig[
'properties'][
'hideTables'];
341 $dblist->hideTranslations = $this->modTSconfig[
'properties'][
'hideTranslations'];
342 $dblist->tableTSconfigOverTCA = $this->modTSconfig[
'properties'][
'table.'];
345 $dblist->newWizards = $this->modTSconfig[
'properties'][
'newWizards'] ? 1 : 0;
348 $dblist->MOD_MENU = array(
'bigControlPanel' =>
'',
'clipBoard' =>
'',
'localization' =>
'');
350 $clickTitleMode = trim($this->modTSconfig[
'properties'][
'clickTitleMode']);
351 $dblist->clickTitleMode = $clickTitleMode ===
'' ?
'edit' : $clickTitleMode;
352 if (isset($this->modTSconfig[
'properties'][
'tableDisplayOrder.'])) {
354 $dblist->setTableDisplayOrder($typoScriptService->convertTypoScriptArrayToPlainArray($this->modTSconfig[
'properties'][
'tableDisplayOrder.']));
360 $dblist->clipObj->initializeClipboard();
364 if ($this->cmd ==
'setCB') {
370 if (!$this->MOD_SETTINGS[
'clipBoard']) {
372 $CB[
'setP'] =
'normal';
375 $dblist->clipObj->setCmd($CB);
377 $dblist->clipObj->cleanCurrent();
379 $dblist->clipObj->endClipboard();
382 $dblist->dontShowClipControlPanels = ($dblist->clipObj->current ==
'normal' && !$this->modTSconfig[
'properties'][
'showClipControlPanelsDespiteOfCMlayers']);
384 if ($access || ($this->
id === 0 && $this->search_levels > 0 && $this->search_field !==
'')) {
387 if ($this->cmd ==
'delete') {
389 if (!empty($items)) {
391 foreach ($items as $iK => $value) {
392 $iKParts = explode(
'|', $iK);
393 $cmd[$iKParts[0]][$iKParts[1]][
'delete'] = 1;
396 $tce->stripslashes_values = 0;
397 $tce->start(array(),
$cmd);
398 $tce->process_cmdmap();
399 if (isset(
$cmd[
'pages'])) {
407 $dblist->start($this->
id, $this->table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit);
408 $dblist->setDispFields();
411 $dblist->HTMLcode .= $this->moduleTemplate->getVersionSelector($this->
id);
414 $dblist->generateList();
415 $listUrl = $dblist->listURL();
418 $this->moduleTemplate->addJavaScriptCode(
419 'RecordListInlineJS',
421 function jumpExt(URL,anchor) { //
422 var anc = anchor?anchor:"";
423 window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
426 function jumpSelf(URL) { //
427 window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
430 function jumpToUrl(URL) {
431 window.location.href = URL;
435 function setHighlight(id) { //
436 top.fsMod.recentIds["web"]=id;
437 top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank; // For highlighting
439 if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
440 top.content.nav_frame.refresh_nav();
443 ' . $this->moduleTemplate->redirectUrls($listUrl) .
'
444 ' . $dblist->CBfunctions() .
'
445 function editRecords(table,idList,addParams,CBflag) { //
446 window.location.href="' . BackendUtility::getModuleUrl(
'record_edit', array(
'returnUrl' =>
GeneralUtility::getIndpEnv(
'REQUEST_URI'))) .
'&edit["+table+"]["+idList+"]=edit"+addParams;
448 function editList(table,idList) { //
451 // Checking how many is checked, how many is not
453 var pos = idList.indexOf(",");
455 if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
456 list+=idList.substr(pointer,pos-pointer)+",";
459 pos = idList.indexOf(",",pointer);
461 if (cbValue(table+"|"+idList.substr(pointer))) {
462 list+=idList.substr(pointer)+",";
465 return list ? list : idList;
468 if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->
id .
';
473 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ClickMenu');
478 $this->body = $this->moduleTemplate->header(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename']);
480 $this->body = $this->moduleTemplate->header($this->pageinfo[
'title']);
483 if (!empty($dblist->HTMLcode)) {
484 $output = $dblist->HTMLcode;
488 $lang->getLL(
'noRecordsOnThisPage'),
494 $this->body .=
'<form action="' . htmlspecialchars($dblist->listURL()) .
'" method="post" name="dblistForm">';
495 $this->body .= $output;
496 $this->body .=
'<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
498 if ($dblist->HTMLcode) {
500 if ($dblist->table) {
501 $this->body .= $dblist->fieldSelectBox($dblist->table);
507 Listing options for extended view, clipboard and localization view
509 <div class="typo3-listOptions">
510 <form action="" method="post">';
513 if ($this->modTSconfig[
'properties'][
'enableDisplayBigControlPanel'] ===
'selectable') {
514 $this->body .=
'<div class="checkbox">' .
515 '<label for="checkLargeControl">' .
516 BackendUtility::getFuncCheck($this->
id,
'SET[bigControlPanel]', $this->MOD_SETTINGS[
'bigControlPanel'],
'', $this->table ?
'&table=' . $this->table :
'',
'id="checkLargeControl"') .
517 BackendUtility::wrapInHelp(
'xMOD_csh_corebe',
'list_options',
$lang->getLL(
'largeControl',
true)) .
523 if ($this->modTSconfig[
'properties'][
'enableClipBoard'] ===
'selectable') {
524 if ($dblist->showClipboard) {
525 $this->body .=
'<div class="checkbox">' .
526 '<label for="checkShowClipBoard">' .
527 BackendUtility::getFuncCheck($this->
id,
'SET[clipBoard]', $this->MOD_SETTINGS[
'clipBoard'],
'', $this->table ?
'&table=' . $this->table :
'',
'id="checkShowClipBoard"') .
528 BackendUtility::wrapInHelp(
'xMOD_csh_corebe',
'list_options',
$lang->getLL(
'showClipBoard',
true)) .
535 if ($this->modTSconfig[
'properties'][
'enableLocalizationView'] ===
'selectable') {
536 $this->body .=
'<div class="checkbox">' .
537 '<label for="checkLocalization">' .
538 BackendUtility::getFuncCheck($this->
id,
'SET[localization]', $this->MOD_SETTINGS[
'localization'],
'', $this->table ?
'&table=' . $this->table :
'',
'id="checkLocalization"') .
539 BackendUtility::wrapInHelp(
'xMOD_csh_corebe',
'list_options',
$lang->getLL(
'localization',
true)) .
549 if ($this->MOD_SETTINGS[
'clipBoard'] && $dblist->showClipboard && ($dblist->HTMLcode || $dblist->clipObj->hasElements())) {
550 $this->body .=
'<div class="db_list-dashboard">' . $dblist->clipObj->printClipboard() .
'</div>';
553 $footerContentHook =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'recordlist/Modules/Recordlist/index.php'][
'drawFooterHook'];
554 if (is_array($footerContentHook)) {
555 foreach ($footerContentHook as $hook) {
561 $dblist->getDocHeaderButtons($this->moduleTemplate);
563 if (!$this->modTSconfig[
'properties'][
'disableSearchBox'] && ($dblist->HTMLcode || !empty($dblist->searchString))) {
564 $this->content = $dblist->getSearchBox();
565 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ToggleSearchToolbox');
567 $searchButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeLinkButton();
570 ->setClasses(
't3js-toggle-search-toolbox')
571 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.title.searchIcon',
true))
575 if ($this->pageinfo) {
576 $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
598 $this->moduleTemplate->setContent($this->content);
599 $response->
getBody()->write($this->moduleTemplate->renderContent());
644 if ($this->pageRenderer === null) {