PageLayoutController.php 55.7 KB
Newer Older
1
2
3
<?php
namespace TYPO3\CMS\Backend\Controller;

4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
8
9
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
10
 *
11
12
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
15
 * The TYPO3 project - inspiring people to share!
 */
16

Nicole Cordes's avatar
Nicole Cordes committed
17
18
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
19
use TYPO3\CMS\Core\Type\Bitmask\Permission;
Nicole Cordes's avatar
Nicole Cordes committed
20
21
22
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
23
use TYPO3\CMS\Core\Utility\HttpUtility;
Nicole Cordes's avatar
Nicole Cordes committed
24
use TYPO3\CMS\Core\Utility\MathUtility;
25
use TYPO3\CMS\Fluid\View\StandaloneView;
26
use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
27
28
29
30
31
32
33
34
35
36
37
use TYPO3\CMS\Recordlist\RecordList;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Frontend\Page\PageRepository;
use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\View\BackendLayoutView;
use TYPO3\CMS\Backend\Form\DataPreprocessor;
use TYPO3\CMS\Backend\Form\FormEngine;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Backend\View\PageLayoutView;
use TYPO3\CMS\Backend\Tree\View\ContentLayoutPagePositionMap;
38
use TYPO3\CMS\Core\Versioning\VersionState;
Nicole Cordes's avatar
Nicole Cordes committed
39

40
41
42
43
44
/**
 * Script Class for Web > Layout module
 */
class PageLayoutController {

45
46
47
48
49
	/**
	 * Page Id for which to make the listing
	 *
	 * @var int
	 */
50
51
	public $id;

52
53
54
55
56
	/**
	 * Pointer - for browsing list of records.
	 *
	 * @var int
	 */
57
58
	public $pointer;

59
60
61
62
63
	/**
	 * Thumbnails or not
	 *
	 * @var string
	 */
64
65
	public $imagemode;

66
67
68
69
70
	/**
	 * Search-fields
	 *
	 * @var string
	 */
71
72
	public $search_field;

73
74
75
76
77
	/**
	 * Search-levels
	 *
	 * @var int
	 */
78
79
	public $search_levels;

80
81
82
83
84
	/**
	 * Show-limit
	 *
	 * @var int
	 */
85
86
	public $showLimit;

87
88
89
90
91
	/**
	 * Return URL
	 *
	 * @var string
	 */
92
93
	public $returnUrl;

94
95
96
97
98
	/**
	 * Clear-cache flag - if set, clears page cache for current id.
	 *
	 * @var bool
	 */
99
100
	public $clear_cache;

101
102
103
104
105
	/**
	 * PopView id - for opening a window with the page
	 *
	 * @var bool
	 */
106
107
	public $popView;

108
109
110
111
112
113
	/**
	 * QuickEdit: Variable, that tells quick edit what to show/edit etc.
	 * Format is [tablename]:[uid] with some exceptional values for both parameters (with special meanings).
	 *
	 * @var string
	 */
114
115
	public $edit_record;

116
117
118
119
120
121
122
123
	/**
	 * QuickEdit: If set, this variable tells quick edit that the last edited record had
	 * this value as UID and we should look up the new, real uid value in sys_log.
	 *
	 * @var string
	 */
	public $new_unique_uid;

124
125
126
127
128
	/**
	 * Page select perms clause
	 *
	 * @var string
	 */
129
130
	public $perms_clause;

131
132
133
134
135
	/**
	 * Module TSconfig
	 *
	 * @var array
	 */
136
137
	public $modTSconfig;

138
139
140
141
142
143
144
	/**
	 * Module shared TSconfig
	 *
	 * @var array
	 */
	public $modSharedTSconfig;

145
146
147
148
149
	/**
	 * Current ids page record
	 *
	 * @var array
	 */
150
151
152
153
154
	public $pageinfo;

	/**
	 * Document template object
	 *
155
	 * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
156
157
158
	 */
	public $doc;

159
160
161
162
163
	/**
	 * "Pseudo" Description -table name
	 *
	 * @var string
	 */
164
165
	public $descrTable;

166
167
168
169
170
	/**
	 * List of column-integers to edit. Is set from TSconfig, default is "1,0,2,3"
	 *
	 * @var string
	 */
171
172
	public $colPosList;

173
174
175
176
177
	/**
	 * Flag: If content can be edited or not.
	 *
	 * @var bool
	 */
178
179
	public $EDIT_CONTENT;

180
181
182
183
184
	/**
	 * Users permissions integer for this page.
	 *
	 * @var int
	 */
185
186
	public $CALC_PERMS;

187
188
189
190
191
	/**
	 * Currently selected language for editing content elements
	 *
	 * @var int
	 */
192
193
	public $current_sys_language;

194
195
196
197
198
	/**
	 * Module configuration
	 *
	 * @var array
	 */
199
200
	public $MCONF = array();

201
202
203
204
205
	/**
	 * Menu configuration
	 *
	 * @var array
	 */
206
207
	public $MOD_MENU = array();

208
209
210
211
212
	/**
	 * Module settings (session variable)
	 *
	 * @var array
	 */
213
214
	public $MOD_SETTINGS = array();

215
216
217
218
219
	/**
	 * Array of tables to be listed by the Web > Page module in addition to the default tables
	 *
	 * @var array
	 */
220
221
	public $externalTables = array();

222
223
224
225
226
	/**
	 * Module output accumulation
	 *
	 * @var string
	 */
227
228
	public $content;

229
230
231
232
233
	/**
	 * Function menu temporary storage
	 *
	 * @var string
	 */
234
235
	public $topFuncMenu;

236
237
238
239
240
241
242
243
	/**
	 * List of column-integers accessible to the current BE user.
	 * Is set from TSconfig, default is $colPosList
	 *
	 * @var string
	 */
	public $activeColPosList;

244
	/**
245
246
247
	 * Markers array
	 *
	 * @var array
248
249
250
	 */
	protected $markers = array();

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
	/**
	 * @var array
	 */
	protected $eRParts = array();

	/**
	 * @var string
	 */
	protected $editSelect;

	/**
	 * @var bool
	 */
	protected $deleteButton;

	/**
	 * @var bool
	 */
	protected $undoButton;

	/**
	 * @var array
	 */
	protected $undoButtonR;

	/**
	 * @var string
	 */
	protected $R_URI;

	/**
	 * @var string
	 */
	protected $closeUrl;

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
	/**
	 * Caches the available languages in a colPos
	 *
	 * @var array
	 */
	protected $languagesInColumnCache = array();

	/**
	 * Caches the amount of content elements as a matrix
	 *
	 * @var array
	 * @internal
	 */
	public $contentElementCache = array();

301
302
303
304
305
306
	/**
	 * Initializing the module
	 *
	 * @return void
	 */
	public function init() {
Wouter Wolters's avatar
Wouter Wolters committed
307
		$this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
308

309
310
		// Setting module configuration / page select clause
		$this->MCONF = $GLOBALS['MCONF'];
311
		$this->perms_clause = $this->getBackendUser()->getPagePermsClause(1);
312
		// Get session data
313
		$sessionData = $this->getBackendUser()->getSessionData(RecordList::class);
314
		$this->search_field = !empty($sessionData['search_field']) ? $sessionData['search_field'] : '';
315
		// GPvars:
316
		$this->id = (int)GeneralUtility::_GP('id');
Nicole Cordes's avatar
Nicole Cordes committed
317
318
319
320
321
		$this->pointer = GeneralUtility::_GP('pointer');
		$this->imagemode = GeneralUtility::_GP('imagemode');
		$this->clear_cache = GeneralUtility::_GP('clear_cache');
		$this->popView = GeneralUtility::_GP('popView');
		$this->edit_record = GeneralUtility::_GP('edit_record');
322
		$this->new_unique_uid = GeneralUtility::_GP('new_unique_uid');
323
		$this->search_field = GeneralUtility::_GP('search_field');
Nicole Cordes's avatar
Nicole Cordes committed
324
325
326
		$this->search_levels = GeneralUtility::_GP('search_levels');
		$this->showLimit = GeneralUtility::_GP('showLimit');
		$this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
327
		$this->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables'];
328
		$sessionData['search_field'] = $this->search_field;
329
		// Store session data
330
		$this->getBackendUser()->setAndSaveSessionData(RecordList::class, $sessionData);
331
		// Load page info array:
Nicole Cordes's avatar
Nicole Cordes committed
332
		$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
333
334
335
		// Initialize menu
		$this->menuConfig();
		// Setting sys language from session var:
336
		$this->current_sys_language = (int)$this->MOD_SETTINGS['language'];
337
338
		// CSH / Descriptions:
		$this->descrTable = '_MOD_' . $this->MCONF['name'];
339
340
341

		$this->markers['SEARCHBOX'] = '';
		$this->markers['BUTTONLIST_ADDITIONAL'] = '';
342
343
344
345
346
347
348
349
	}

	/**
	 * Initialize menu array
	 *
	 * @return void
	 */
	public function menuConfig() {
350
		$lang = $this->getLanguageService();
351
352
353
354
		// MENU-ITEMS:
		$this->MOD_MENU = array(
			'tt_content_showHidden' => '',
			'function' => array(
355
356
357
				0 => $lang->getLL('m_function_0'),
				1 => $lang->getLL('m_function_1'),
				2 => $lang->getLL('m_function_2')
358
359
			),
			'language' => array(
360
				0 => $lang->getLL('m_default')
361
362
363
364
365
			)
		);
		// example settings:
		// 	$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
		//		array ('default' => array(
366
		//				'MENU' => 'LLL:EXT:tx_myext/locallang_db.xlf:menuDefault',
367
368
369
370
371
372
373
374
375
376
		//				'fList' =>  'title,description,image',
		//				'icon' => TRUE));
		if (is_array($this->externalTables)) {
			foreach ($this->externalTables as $table => $tableSettings) {
				// delete the default settings from above
				if (is_array($this->MOD_MENU[$table])) {
					unset($this->MOD_MENU[$table]);
				}
				if (is_array($tableSettings) && count($tableSettings) > 1) {
					foreach ($tableSettings as $key => $settings) {
377
						$this->MOD_MENU[$table][$key] = $lang->sL($settings['MENU']);
378
379
380
381
382
383
					}
				}
			}
		}
		// First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page. Add these to language selector.
		$res = $this->exec_languageQuery($this->id);
384
385
386
		while ($lRow = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
			if ($this->getBackendUser()->checkLanguageAccess($lRow['uid'])) {
				$this->MOD_MENU['language'][$lRow['uid']] = $lRow['hidden'] ? '(' . $lRow['title'] . ')' : $lRow['title'];
387
388
389
			}
		}
		// Find if there are ANY languages at all (and if not, remove the language option from function menu).
390
		$count = $this->getDatabaseConnection()->exec_SELECTcountRows('uid', 'sys_language', $this->getBackendUser()->isAdmin() ? '' : 'hidden=0');
391
392
393
394
		if (!$count) {
			unset($this->MOD_MENU['function']['2']);
		}
		// page/be_user TSconfig settings and blinding of menu-items
Nicole Cordes's avatar
Nicole Cordes committed
395
396
		$this->modSharedTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
		$this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.' . $this->MCONF['name']);
397
398
399
		if ($this->modTSconfig['properties']['QEisDefault']) {
			ksort($this->MOD_MENU['function']);
		}
Nicole Cordes's avatar
Nicole Cordes committed
400
		$this->MOD_MENU['function'] = BackendUtility::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function');
401
		// Remove QuickEdit as option if page type is not...
402
		if (!GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'] . ',6', $this->pageinfo['doktype'])) {
403
404
405
406
407
408
409
			unset($this->MOD_MENU['function'][0]);
		}
		// Setting alternative default label:
		if (($this->modSharedTSconfig['properties']['defaultLanguageLabel'] || $this->modTSconfig['properties']['defaultLanguageLabel']) && isset($this->MOD_MENU['language'][0])) {
			$this->MOD_MENU['language'][0] = $this->modTSconfig['properties']['defaultLanguageLabel'] ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $this->modSharedTSconfig['properties']['defaultLanguageLabel'];
		}
		// Clean up settings
410
		$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), 'web_layout');
411
		// For all elements to be shown in draft workspaces & to also show hidden elements by default if user hasn't disabled the option
412
		if ($this->getBackendUser()->workspace != 0 || $this->MOD_SETTINGS['tt_content_showHidden'] !== '0') {
413
414
415
416
417
418
419
420
421
422
423
			$this->MOD_SETTINGS['tt_content_showHidden'] = 1;
		}
	}

	/**
	 * Clears page cache for the current id, $this->id
	 *
	 * @return void
	 */
	public function clearCache() {
		if ($this->clear_cache) {
424
425
			$tce = GeneralUtility::makeInstance(DataHandler::class);
			$tce->stripslashes_values = FALSE;
426
427
428
429
430
431
432
433
434
435
436
437
			$tce->start(array(), array());
			$tce->clear_cacheCmd($this->id);
		}
	}

	/**
	 * Generate the flashmessages for current pid
	 *
	 * @return string HTML content with flashmessages
	 */
	protected function getHeaderFlashMessagesForCurrentPid() {
		$content = '';
438
		$lang = $this->getLanguageService();
439
		// If page is a folder
440
		if ($this->pageinfo['doktype'] == PageRepository::DOKTYPE_SYSFOLDER) {
441
			// Access to list module
442
			$moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
443
444
445
			$moduleLoader->load($GLOBALS['TBE_MODULES']);
			$modules = $moduleLoader->modules;
			if (is_array($modules['web']['sub']['list'])) {
446
447
448
				$title = $lang->getLL('goToListModule');
				$message = '<p>' . $lang->getLL('goToListModuleMessage') . '</p>';
				$message .= '<a class="btn btn-info" href="javascript:top.goToModule(\'web_list\',1);">' . $lang->getLL('goToListModule') . '</a>';
449
450
451
452

				$view = GeneralUtility::makeInstance(StandaloneView::class);
				$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));
				$view->assignMultiple(array(
453
454
					'title' => $title,
					'message' => $message,
455
456
457
					'state' => InfoboxViewHelper::STATE_INFO
				));
				$content .= $view->render();
458
459
460
461
			}
		}
		// If content from different pid is displayed
		if ($this->pageinfo['content_from_pid']) {
462
			$contentPage = BackendUtility::getRecord('pages', (int)$this->pageinfo['content_from_pid']);
Nicole Cordes's avatar
Nicole Cordes committed
463
			$title = BackendUtility::getRecordTitle('pages', $contentPage);
464
			$linkToPid = $this->local_linkThisScript(array('id' => $this->pageinfo['content_from_pid']));
465
			$link = '<a href="' . $linkToPid . '">' . htmlspecialchars($title) . ' (PID ' . (int)$this->pageinfo['content_from_pid'] . ')</a>';
466
			$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, sprintf($lang->getLL('content_from_pid_title'), $link), '', FlashMessage::INFO);
467
468
469
470
471
			$content .= $flashMessage->render();
		}
		return $content;
	}

472
473
474
475
476
477
	/**
	 *
	 * @return string $title
	 */
	protected function getLocalizedPageTitle() {
		if ($this->current_sys_language > 0) {
478
			$overlayRecord = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(
479
480
				'title',
				'pages_language_overlay',
481
482
				'pid = ' . (int)$this->id .
						' AND sys_language_uid = ' . (int)$this->current_sys_language .
Nicole Cordes's avatar
Nicole Cordes committed
483
484
						BackendUtility::deleteClause('pages_language_overlay') .
						BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
485
486
487
488
489
490
491
492
493
494
495
				'',
				'',
				'',
				'sys_language_uid'
			);
			return $overlayRecord['title'];
		} else {
			return $this->pageinfo['title'];
		}
	}

496
497
498
499
500
501
502
	/**
	 * Main function.
	 * Creates some general objects and calls other functions for the main rendering of module content.
	 *
	 * @return void
	 */
	public function main() {
503
		$lang = $this->getLanguageService();
504
505
506
507
508
		// Access check...
		// The page will show only if there is a valid page and if this page may be viewed by the user
		$access = is_array($this->pageinfo) ? 1 : 0;
		if ($this->id && $access) {
			// Initialize permission settings:
509
			$this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);
510
511
			$this->EDIT_CONTENT = $this->pageIsNotLockedForEditors();

512
			// Start document template object:
513
			$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
514
			$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
515
516
517
518

			// override the default jumpToUrl
			$this->doc->JScodeArray['jumpToUrl'] = '
				function jumpToUrl(URL,formEl) {
519
					if (document.editform && TBE_EDITOR.isFormChanged)	{	// Check if the function exists... (works in all browsers?)
520
						if (!TBE_EDITOR.isFormChanged()) {
521
522
523
524
							window.location.href = URL;
						} else if (formEl) {
							if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
						}
525
526
527
					} else {
						window.location.href = URL;
					}
528
				}
529
530
531
532
533
';

			$this->doc->JScode .= $this->doc->wrapScriptTags('
				if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
				if (top.fsMod) top.fsMod.navFrameHighlightedID["web"] = "pages' . (int)$this->id . '_"+top.fsMod.currentBank; ' . (int)$this->id . ';
Nicole Cordes's avatar
Nicole Cordes committed
534
			' . ($this->popView ? BackendUtility::viewOnClick($this->id, $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->id)) : '') . '
535
536

				function deleteRecord(table,id,url) {	//
537
538
					if (confirm(' . GeneralUtility::quoteJSvalue($lang->getLL('deleteWarning')) . ')) {
						window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $this->getBackendUser()->veriCode() . BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1";
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
					}
					return false;
				}
			');
			$this->doc->JScode .= $this->doc->wrapScriptTags('
				var DTM_array = new Array();
				var DTM_origClass = new String();

					// if tabs are used in a popup window the array might not exists
				if(!top.DTM_currentTabs) {
					top.DTM_currentTabs = new Array();
				}

				function DTM_activate(idBase,index,doToogle) {	//
						// Hiding all:
					if (DTM_array[idBase]) {
						for(cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {
							if (DTM_array[idBase][cnt] != idBase+"-"+index) {
Benjamin Kott's avatar
Benjamin Kott committed
557
558
								document.getElementById(DTM_array[idBase][cnt]+"-DIV").className = "tab-pane";
								document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").value = "tab";
559
560
561
562
563
564
							}
						}
					}

						// Showing one:
					if (document.getElementById(idBase+"-"+index+"-DIV")) {
Benjamin Kott's avatar
Benjamin Kott committed
565
566
						if (doToogle && document.getElementById(idBase+"-"+index+"-DIV").className === "tab-pane active") {
							document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane";
567
							if(DTM_origClass=="") {
Benjamin Kott's avatar
Benjamin Kott committed
568
								document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "tab";
569
570
571
572
573
							} else {
								DTM_origClass = "tab";
							}
							top.DTM_currentTabs[idBase] = -1;
						} else {
Benjamin Kott's avatar
Benjamin Kott committed
574
							document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane active";
575
							if(DTM_origClass=="") {
Benjamin Kott's avatar
Benjamin Kott committed
576
								document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "active";
577
							} else {
578
								DTM_origClass = "active";
579
580
581
582
583
584
585
586
587
							}
							top.DTM_currentTabs[idBase] = index;
						}
					}
				}
				function DTM_toggle(idBase,index,isInit) {	//
						// Showing one:
					if (document.getElementById(idBase+"-"+index+"-DIV")) {
						if (document.getElementById(idBase+"-"+index+"-DIV").style.display == "block") {
Benjamin Kott's avatar
Benjamin Kott committed
588
							document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane";
589
							if(isInit) {
Benjamin Kott's avatar
Benjamin Kott committed
590
								document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "tab";
591
592
593
594
595
							} else {
								DTM_origClass = "tab";
							}
							top.DTM_currentTabs[idBase+"-"+index] = 0;
						} else {
Benjamin Kott's avatar
Benjamin Kott committed
596
							document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane active";
597
							if(isInit) {
Benjamin Kott's avatar
Benjamin Kott committed
598
								document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "active";
599
							} else {
600
								DTM_origClass = "active";
601
602
603
604
605
606
607
							}
							top.DTM_currentTabs[idBase+"-"+index] = 1;
						}
					}
				}
			');
			// Setting doc-header
608
609
610
611
			$this->doc->form = '<form action="' . htmlspecialchars(
				BackendUtility::getModuleUrl(
					'web_layout', array('id' => $this->id, 'imagemode' =>  $this->imagemode)
				)) . '" method="post">';
612
			// Creating the top function menu:
613
			$this->topFuncMenu = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'], '', '');
614
			$languageMenu = count($this->MOD_MENU['language']) > 1 ? $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', TRUE) . BackendUtility::getFuncMenu($this->id, 'SET[language]', $this->current_sys_language, $this->MOD_MENU['language'], '', '') : '';
615
			// Find backend layout / coumns
616
			$backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);
617
			if (!empty($backendLayout['__colPosList'])) {
618
619
620
				$this->colPosList = implode(',', $backendLayout['__colPosList']);
			}
			// Removing duplicates, if any
621
622
			$this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));
			// Accessible columns
623
			if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {
624
625
				$this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));
				// Match with the list which is present in the colPosList for the current page
626
627
				if (!empty($this->colPosList) && !empty($this->activeColPosList)) {
					$this->activeColPosList = array_unique(array_intersect(
628
629
						$this->activeColPosList,
						$this->colPosList
630
					));
631
				}
632
633
			} else {
				$this->activeColPosList = $this->colPosList;
634
			}
635
			$this->activeColPosList = implode(',', $this->activeColPosList);
636
637
			$this->colPosList = implode(',', $this->colPosList);

638
			$body = '';
639
640
641
642
643
644
			$body .= $this->getHeaderFlashMessagesForCurrentPid();
			// Render the primary module content:
			if ($this->MOD_SETTINGS['function'] == 0) {
				// QuickEdit
				$body .= $this->renderQuickEdit();
			} else {
645
646
				// Page title
				$body .= $this->doc->header($this->getLocalizedPageTitle());
647
648
649
650
651
				// All other listings
				$body .= $this->renderListContent();
			}
			// Setting up the buttons and markers for docheader
			$docHeaderButtons = $this->getButtons($this->MOD_SETTINGS['function'] == 0 ? 'quickEdit' : '');
652
653
			$this->markers['CSH'] = $docHeaderButtons['csh'];
			$this->markers['TOP_FUNCTION_MENU'] = $this->topFuncMenu . $this->editSelect;
654
			$this->markers['LANGSELECTOR'] = $languageMenu;
655
			$this->markers['CONTENT'] = $body;
656
			// Build the <body> for the module
657
			$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $this->markers);
658
			// Renders the module page
659
			$this->content = $this->doc->render($lang->getLL('title'), $this->content);
660
661
		} else {
			// If no access or id value, create empty document:
662
			$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
663
			$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
664
			$this->doc->JScode = $this->doc->wrapScriptTags('
665
				if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
666
			');
667
668

			$body = $this->doc->header($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
669

670
671
			$title = $lang->getLL('clickAPage_header');
			$message = $lang->getLL('clickAPage_content');
672
673
674
675

			$view = GeneralUtility::makeInstance(StandaloneView::class);
			$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));
			$view->assignMultiple(array(
676
677
				'title' => $title,
				'message' => $message,
678
679
680
				'state' => InfoboxViewHelper::STATE_INFO
			));
			$body .= $view->render();
681

682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
			// Setting up the buttons and markers for docheader
			$docHeaderButtons = array(
				'view' => '',
				'history_page' => '',
				'new_content' => '',
				'move_page' => '',
				'move_record' => '',
				'new_page' => '',
				'edit_page' => '',
				'csh' => '',
				'shortcut' => '',
				'cache' => '',
				'savedok' => '',
				'savedokshow' => '',
				'closedok' => '',
				'deletedok' => '',
				'undo' => '',
699
700
				'history_record' => '',
				'edit_language' => ''
701
			);
Benni Mack's avatar
Benni Mack committed
702
			$this->markers['CSH'] = '';
703
704
705
706
			$this->markers['TOP_FUNCTION_MENU'] = '';
			$this->markers['LANGSELECTOR'] = '';
			$this->markers['CONTENT'] = $body;
			$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $this->markers);
707
			// Renders the module page
708
			$this->content = $this->doc->render($lang->getLL('title'), $this->content);
709
710
711
712
713
714
		}
	}

	/**
	 * Rendering the quick-edit view.
	 *
715
	 * @return string
716
717
	 */
	public function renderQuickEdit() {
718
719
720
		$databaseConnection = $this->getDatabaseConnection();
		$beUser = $this->getBackendUser();
		$lang = $this->getLanguageService();
721
		// Alternative template
722
		$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout_quickedit.html');
723
		// Alternative form tag; Quick Edit submits its content to tce_db.php.
724
		$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', ['prErr' => 1, 'uPT' => 1])) . '" method="post" enctype="multipart/form-data" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
725
726
727
728
		// Setting up the context sensitive menu:
		$this->doc->getContextMenuCode();
		// Set the edit_record value for internal use in this function:
		$edit_record = $this->edit_record;
729
		// If a command to edit all records in a column is issue, then select all those elements, and redirect to FormEngine
730
		if (substr($edit_record, 0, 9) == '_EDIT_COL') {
731
			$res = $databaseConnection->exec_SELECTquery('*', 'tt_content', 'pid=' . (int)$this->id . ' AND colPos=' . (int)substr($edit_record, 10) . ' AND sys_language_uid=' . (int)$this->current_sys_language . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'sorting');
732
			$idListA = array();
733
			while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
734
735
				$idListA[] = $cRow['uid'];
			}
736
737
			$url = BackendUtility::getModuleUrl('record_edit', array(
				'edit[tt_content][' . implode(',', $idListA) . ']' => 'edit',
738
				'returnUrl' => $this->local_linkThisScript(array('edit_record' => ''))
739
			));
740
			HttpUtility::redirect($url);
741
		}
742
743
		// If the former record edited was the creation of a NEW record, this will look up the created records uid:
		if ($this->new_unique_uid) {
744
745
			$res = $databaseConnection->exec_SELECTquery('*', 'sys_log', 'userid=' . (int)$beUser->user['uid'] . ' AND NEWid=' . $databaseConnection->fullQuoteStr($this->new_unique_uid, 'sys_log'));
			$sys_log_row = $databaseConnection->sql_fetch_assoc($res);
746
747
748
749
			if (is_array($sys_log_row)) {
				$edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid'];
			}
		}
750
751
752
753
754
		// Creating the selector box, allowing the user to select which element to edit:
		$opt = array();
		$is_selected = 0;
		$languageOverlayRecord = '';
		if ($this->current_sys_language) {
755
			list($languageOverlayRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . (int)$this->current_sys_language);
756
757
758
		}
		if (is_array($languageOverlayRecord)) {
			$inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
759
			$is_selected += (int)$edit_record == $inValue;
760
			$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editLanguageHeader', TRUE) . ' ]</option>';
761
762
		} else {
			$inValue = 'pages:' . $this->id;
763
			$is_selected += (int)$edit_record == $inValue;
764
			$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editPageProperties', TRUE) . ' ]</option>';
765
766
		}
		// Selecting all content elements from this language and allowed colPos:
767
768
769
770
771
		$whereClause = 'pid=' . (int)$this->id . ' AND sys_language_uid=' . (int)$this->current_sys_language . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content');
		if (!$this->getBackendUser()->user['admin']) {
			$whereClause .= ' AND editlock = 0';
		}
		$res = $databaseConnection->exec_SELECTquery('*', 'tt_content', $whereClause, '', 'colPos,sorting');
772
		$colPos = NULL;
773
774
775
		$first = 1;
		// Page is the pid if no record to put this after.
		$prev = $this->id;
776
		while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
Nicole Cordes's avatar
Nicole Cordes committed
777
			BackendUtility::workspaceOL('tt_content', $cRow);
778
779
780
781
782
783
784
			if (is_array($cRow)) {
				if ($first) {
					if (!$edit_record) {
						$edit_record = 'tt_content:' . $cRow['uid'];
					}
					$first = 0;
				}
785
				if (!isset($colPos) || $cRow['colPos'] !== $colPos) {
786
787
					$colPos = $cRow['colPos'];
					$opt[] = '<option value=""></option>';
788
					$opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $lang->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos), TRUE) . ':__</option>';
789
790
				}
				$inValue = 'tt_content:' . $cRow['uid'];
791
				$is_selected += (int)$edit_record == $inValue;
792
				$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(($cRow['header'] ? $cRow['header'] : '[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title') . '] ' . strip_tags($cRow['bodytext'])), $beUser->uc['titleLen'])) . '</option>';
793
794
795
796
797
				$prev = -$cRow['uid'];
			}
		}
		// If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
		if (!$edit_record) {
798
799
			$edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
			$inValue = 'tt_content:new/' . $prev . '/' . $colPos;
800
			$is_selected += (int)$edit_record == $inValue;
801
			$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('newLabel', 1) . ' ]</option>';
802
803
804
805
		}
		// If none is yet selected...
		if (!$is_selected) {
			$opt[] = '<option value=""></option>';
806
			$opt[] = '<option value="' . $edit_record . '"  selected="selected">[ ' . $lang->getLL('newLabel', TRUE) . ' ]</option>';
807
808
809
810
		}
		// Splitting the edit-record cmd value into table/uid:
		$this->eRParts = explode(':', $edit_record);
		// Delete-button flag?
811
		$this->deleteButton = MathUtility::canBeInterpretedAsInteger($this->eRParts[1]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & Permission::PAGE_DELETE);
812
		// If undo-button should be rendered (depends on available items in sys_history)
813
814
815
816
		$this->undoButton = FALSE;
		$undoRes = $databaseConnection->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $databaseConnection->fullQuoteStr($this->eRParts[0], 'sys_history') . ' AND recuid=' . (int)$this->eRParts[1], '', 'tstamp DESC', '1');
		if ($this->undoButtonR = $databaseConnection->sql_fetch_assoc($undoRes)) {
			$this->undoButton = TRUE;
817
818
		}
		// Setting up the Return URL for coming back to THIS script (if links take the user to another script)
Nicole Cordes's avatar
Nicole Cordes committed
819
820
		$R_URL_parts = parse_url(GeneralUtility::getIndpEnv('REQUEST_URI'));
		$R_URL_getvars = GeneralUtility::_GET();
821
		unset($R_URL_getvars['popView']);
822
		unset($R_URL_getvars['new_unique_uid']);
823
		$R_URL_getvars['edit_record'] = $edit_record;
Nicole Cordes's avatar
Nicole Cordes committed
824
		$this->R_URI = $R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $R_URL_getvars);
825
826
827
828
829
830
831
		// Setting close url/return url for exiting this script:
		// Goes to 'Columns' view if close is pressed (default)
		$this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
		if ($this->returnUrl) {
			$this->closeUrl = $this->returnUrl;
		}
		// Return-url for JavaScript:
832
		$retUrlStr = $this->returnUrl ? '+\'&returnUrl=\'+' . GeneralUtility::quoteJSvalue(rawurlencode($this->returnUrl)) : '';
833
		// Drawing the edit record selectbox
834
835
836
		$this->editSelect = '<select name="edit_record" onchange="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue(
			BackendUtility::getModuleUrl('web_layout') . '&id=' . $this->id . '&edit_record='
		) . '+escape(this.options[this.selectedIndex].value)' . $retUrlStr . ',this);') . '">' . implode('', $opt) . '</select>';
837
		$content = '';
838
		// Creating editing form:
839
		if ($beUser->check('tables_modify', $this->eRParts[0]) && $edit_record && ($this->eRParts[0] !== 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] === 'pages' && $this->CALC_PERMS & Permission::PAGE_SHOW)) {
840
841
842
843
			// Splitting uid parts for special features, if new:
			list($uidVal, $ex_pid, $ex_colPos) = explode('/', $this->eRParts[1]);
			// Convert $uidVal to workspace version if any:
			if ($uidVal != 'new') {
844
				if ($draftRecord = BackendUtility::getWorkspaceVersionOfRecord($beUser->workspace, $this->eRParts[0], $uidVal, 'uid')) {
845
846
847
848
					$uidVal = $draftRecord['uid'];
				}
			}
			// Initializing transfer-data object:
849
			$trData = GeneralUtility::makeInstance(DataPreprocessor::class);
850
851
			$trData->addRawData = TRUE;
			$trData->defVals[$this->eRParts[0]] = array(
852
853
				'colPos' => (int)$ex_colPos,
				'sys_language_uid' => (int)$this->current_sys_language
854
855
856
857
			);
			$trData->lockRecords = 1;
			// 'new'
			$trData->fetchRecord($this->eRParts[0], $uidVal == 'new' ? $this->id : $uidVal, $uidVal);
858
			$new_unique_uid = '';
859
860
861
862
			// Getting/Making the record:
			reset($trData->regTableItems_data);
			$rec = current($trData->regTableItems_data);
			if ($uidVal == 'new') {
863
				$new_unique_uid = uniqid('NEW', TRUE);
864
				$rec['uid'] = $new_unique_uid;
865
				$rec['pid'] = (int)$ex_pid ?: $this->id;
866
867
868
869
				$recordAccess = TRUE;
			} else {
				$rec['uid'] = $uidVal;
				// Checking internals access:
870
				$recordAccess = $beUser->recordEditAccessInternals($this->eRParts[0], $uidVal);
871
872
873
			}
			if (!$recordAccess) {
				// If no edit access, print error message:
874
				$content = $this->doc->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg') . '<br /><br />' . ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : ''), 0, 1);
875
876
877
			} elseif (is_array($rec)) {
				// If the record is an array (which it will always be... :-)
				// Create instance of TCEforms, setting defaults:
878
				$tceForms = GeneralUtility::makeInstance(FormEngine::class);
879
880
				// Render form, wrap it:
				$panel = '';
881
882
				$panel .= $tceForms->getMainFields($this->eRParts[0], $rec);
				$panel = $tceForms->wrapTotal($panel, $rec, $this->eRParts[0]);
883
884
885
				// Add hidden fields:
				$theCode = $panel;
				if ($uidVal == 'new') {
886
					$theCode .= '<input type="hidden" name="data[' . $this->eRParts[0] . '][' . $rec['uid'] . '][pid]" value="' . $rec['pid'] . '" />';
887
				}
888
889
890
				$theCode .= '
					<input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
					<input type="hidden" name="edit_record" value="' . $edit_record . '" />
891
892
893
894
895
896
897
898
					<input type="hidden" name="redirect" value="' . htmlspecialchars(($uidVal == 'new' ? BackendUtility::getModuleUrl(
						'web_layout',
						array(
							'id' => $this->id,
							'new_unique_uid' => $new_unique_uid,
							'returnUrl' => $this->returnUrl
						)
					) : $this->R_URI)) . '" />
899
					' . FormEngine::getHiddenTokenField('tceAction');
900
				// Add JavaScript as needed around the form:
901
				$theCode = $tceForms->printNeededJSFunctions_top() . $theCode . $tceForms->printNeededJSFunctions();
902
				// Add warning sign if record was "locked":
Nicole Cordes's avatar
Nicole Cordes committed
903
				if ($lockInfo = BackendUtility::isRecordLocked($this->eRParts[0], $rec['uid'])) {
904
905
					/** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
					$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($lockInfo['msg']), '', FlashMessage::WARNING);
906
					/** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
907
					$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
908
909
910
					/** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
					$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
					$defaultFlashMessageQueue->enqueue($flashMessage);
911
912
				}
				// Add whole form as a document section:
913
				$content = $this->doc->section('', $theCode);
914
915
916
			}
		} else {
			// If no edit access, print error message:
917
			$content = $this->doc->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg') . '<br /><br />', 0, 1);
918
919
920
		}
		// Bottom controls (function menus):
		$q_count = $this->getNumberOfHiddenElements();
921
922
923
924
925
926
927
928
929
930
931
		if ($q_count) {
			$h_func_b = '<div class="checkbox">' .
				'<label for="checkTt_content_showHidden">' .
				BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"') .
				(!$q_count ? ('<span class="text-muted">' . $lang->getLL('hiddenCE', TRUE) . '</span>') : $lang->getLL('hiddenCE', TRUE) . ' (' . $q_count . ')') .
				'</label>' .
				'</div>';

			$content .= $this->doc->section('', $h_func_b, 0, 0);
			$content .= $this->doc->spacer(10);
		}
932

933
		// Select element matrix:
Nicole Cordes's avatar
Nicole Cordes committed
934
		if ($this->eRParts[0] == 'tt_content' && MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) {
935
			$posMap = GeneralUtility::makeInstance(ContentLayoutPagePositionMap::class);
936
937
938
			$posMap->cur_sys_language = $this->current_sys_language;
			$HTMLcode = '';
			// CSH:
Benni Mack's avatar
Benni Mack committed
939
			$HTMLcode .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement', NULL, '|<br />');
940
941
			$HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI);
			$content .= $this->doc->spacer(20);
942
			$content .= $this->doc->section($lang->getLL('CEonThisPage'), $HTMLcode, 0, 1);
943
944
945
946
947
948
949
950
			$content .= $this->doc->spacer(20);
		}
		return $content;
	}

	/**
	 * Rendering all other listings than QuickEdit
	 *
951
	 * @return string
952
953
	 */
	public function renderListContent() {
954
955
956
957
958
		/** @var $dbList \TYPO3\CMS\Backend\View\PageLayoutView */
		$dbList = GeneralUtility::makeInstance(PageLayoutView::class);
		$dbList->thumbs = $this->imagemode;
		$dbList->no_noWrap = 1;
		$dbList->descrTable = $this->descrTable;
Nicole Cordes's avatar
Nicole Cordes committed
959
		$this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
960
961
962
963
964
965
966
967
968
969
970
971
		$dbList->script = BackendUtility::getModuleUrl('web_layout');
		$dbList->showIcon = 0;
		$dbList->setLMargin = 0;
		$dbList->doEdit = $this->EDIT_CONTENT;
		$dbList->ext_CALC_PERMS = $this->CALC_PERMS;
		$dbList->agePrefixes = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
		$dbList->id = $this->id;
		$dbList->nextThree = MathUtility::forceIntegerInRange($this->modTSconfig['properties']['editFieldsAtATime'], 0, 10);
		$dbList->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
		$dbList->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0;
		if (!$dbList->nextThree) {
			$dbList->nextThree = 1;
972
		}
973
		$dbList->externalTables = $this->externalTables;
974
		// Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!)
975
976
		// also fills $dbList->activeTables
		$dbList->getTableMenu($this->id);
977
978
979
980
981
982
983
		// Initialize other variables:
		$h_func = '';
		$tableOutput = array();
		$tableJSOutput = array();
		$CMcounter = 0;
		// Traverse the list of table names which has records on this page (that array is populated
		// by the $dblist object during the function getTableMenu()):
984
985
986
		foreach ($dbList->activeTables as $table => $value) {
			$h_func_b = '';
			if (!isset($dbList->externalTables[$table])) {
987
				$q_count = $this->getNumberOfHiddenElements();
988

989
990
991
				if ($q_count > 0) {
					$h_func_b =
						'<div class="checkbox">'
992
						. '<label for="checkTt_content_showHidden">'
993
994
						. '<input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' />'
						. $this->getLanguageService()->getLL('hiddenCE', TRUE) . ' (<span class="t3js-hidden-counter">' . $q_count . '</span>)'
995
						. '</label>'
996
997
						. '</div>';
				}
998
				// Boolean: Display up/down arrows and edit icons for tt_content records
999
				$dbList->tt_contentConfig['showCommands'] = 1;
1000
				// Boolean: Display info-marks or not