2 namespace TYPO3\CMS\Backend\Controller;
19 use TYPO3\CMS\Backend\Form\Exception\AccessDeniedException;
324 $this->iconFactory = $this->moduleTemplate->getIconFactory();
325 $this->buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
326 $this->
getLanguageService()->includeLLFile(
'EXT:backend/Resources/Private/Language/locallang_layout.xlf');
329 $this->perms_clause = $this->
getBackendUser()->getPagePermsClause(1);
331 $sessionData = $this->
getBackendUser()->getSessionData(RecordList::class);
332 $this->search_field = !empty($sessionData[
'search_field']) ? $sessionData[
'search_field'] :
'';
345 $this->externalTables =
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'cms'][
'db_layout'][
'addTables'];
348 $this->
getBackendUser()->setAndSaveSessionData(RecordList::class, $sessionData);
354 $this->current_sys_language = (int)$this->MOD_SETTINGS[
'language'];
368 $this->MOD_MENU = array(
369 'tt_content_showHidden' =>
'',
371 0 =>
$lang->getLL(
'm_function_0'),
372 1 =>
$lang->getLL(
'm_function_1'),
373 2 =>
$lang->getLL(
'm_function_2')
376 0 =>
$lang->getLL(
'm_default')
385 if (is_array($this->externalTables)) {
386 foreach ($this->externalTables as $table => $tableSettings) {
388 if (is_array($this->MOD_MENU[$table])) {
389 unset($this->MOD_MENU[$table]);
391 if (is_array($tableSettings) && count($tableSettings) > 1) {
392 foreach ($tableSettings as $key => $settings) {
393 $this->MOD_MENU[$table][$key] =
$lang->sL($settings[
'MENU']);
402 $this->MOD_MENU[
'language'][$lRow[
'uid']] = $lRow[
'hidden'] ?
'(' . $lRow[
'title'] .
')' : $lRow[
'title'];
406 if (($this->modSharedTSconfig[
'properties'][
'defaultLanguageLabel'] || $this->modTSconfig[
'properties'][
'defaultLanguageLabel']) && isset($this->MOD_MENU[
'language'][0])) {
407 $this->MOD_MENU[
'language'][0] = $this->modTSconfig[
'properties'][
'defaultLanguageLabel'] ? $this->modSharedTSconfig[
'properties'][
'defaultLanguageLabel'] : $this->modSharedTSconfig[
'properties'][
'defaultLanguageLabel'];
412 if ($this->
getBackendUser()->workspace != 0 || $this->MOD_SETTINGS[
'tt_content_showHidden'] !==
'0') {
413 $this->MOD_SETTINGS[
'tt_content_showHidden'] = 1;
426 $availableActionArray = array(
434 unset($availableActionArray[
'2']);
439 if ($this->modTSconfig[
'properties'][
'QEisDefault']) {
440 ksort($availableActionArray);
445 unset($availableActionArray[0]);
447 $actionMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
448 $actionMenu->setIdentifier(
'actionMenu');
449 $actionMenu->setLabel(
'');
452 $foundDefaultKey =
false;
453 foreach ($availableActionArray as $key => $action) {
454 $menuItem = $actionMenu
457 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&SET[function]=' . $key);
459 if (!$foundDefaultKey) {
461 $foundDefaultKey =
true;
463 if ((
int)$this->MOD_SETTINGS[
'function'] === $key) {
464 $menuItem->setActive(
true);
467 $actionMenu->addMenuItem($menuItem);
469 if (isset($defaultKey)) {
470 $this->MOD_SETTINGS[
'function'] = $defaultKey;
472 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($actionMenu);
482 if ($this->clear_cache) {
484 $tce->stripslashes_values =
false;
485 $tce->start(array(), array());
486 $tce->clear_cacheCmd($this->
id);
503 $moduleLoader->load(
$GLOBALS[
'TBE_MODULES']);
504 $modules = $moduleLoader->modules;
505 if (is_array($modules[
'web'][
'sub'][
'list'])) {
506 $title =
$lang->getLL(
'goToListModule');
507 $message =
'<p>' .
$lang->getLL(
'goToListModuleMessage') .
'</p>';
508 $message .=
'<a class="btn btn-info" href="javascript:top.goToModule(\'web_list\',1);">' .
$lang->getLL(
'goToListModule') .
'</a>';
511 $view->assignMultiple(array(
513 'message' => $message,
520 if ($this->pageinfo[
'content_from_pid']) {
524 $link =
'<a href="' . $linkToPid .
'">' . htmlspecialchars($title) .
' (PID ' . (int)$this->pageinfo[
'content_from_pid'] .
')</a>';
525 $message = sprintf(
$lang->getLL(
'content_from_pid_title'), $link);
528 $view->assignMultiple(array(
530 'message' => $message,
544 if ($this->current_sys_language > 0) {
547 'pages_language_overlay',
548 'pid = ' . (
int)$this->
id .
549 ' AND sys_language_uid = ' . (
int)$this->current_sys_language .
556 return $overlayRecord[
'title'];
558 return $this->pageinfo[
'title'];
576 $response->
getBody()->write($this->moduleTemplate->renderContent());
591 $access = is_array($this->pageinfo) ? 1 : 0;
594 if ($this->
id && $access) {
596 $this->CALC_PERMS = $this->
getBackendUser()->calcPerms($this->pageinfo);
599 $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
602 $this->moduleTemplate->addJavaScriptCode(
'jumpToUrl',
'
603 function jumpToUrl(URL,formEl) {
604 if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)
605 if (!TBE_EDITOR.isFormChanged()) {
606 window.location.href = URL;
608 if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
611 window.location.href = URL;
615 $this->moduleTemplate->addJavaScriptCode(
'mainJsFunctions',
'
617 top.fsMod.recentIds["web"] = ' . (
int)$this->
id .
';
618 top.fsMod.navFrameHighlightedID["web"] = "pages' . (
int)$this->
id .
'_"+top.fsMod.currentBank; ' . (
int)$this->
id .
';
621 function deleteRecord(table,id,url) { //
623 window.location.href = ' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl(
'tce_db') .
'&cmd[') .
'+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $this->
getBackendUser()->veriCode() .
'&prErr=1&uPT=1";
631 if (!empty($backendLayout[
'__colPosList'])) {
632 $this->colPosList = implode(
',', $backendLayout[
'__colPosList']);
637 if (isset($this->modSharedTSconfig[
'properties'][
'colPos_list']) && trim($this->modSharedTSconfig[
'properties'][
'colPos_list']) !==
'') {
638 $this->activeColPosList = array_unique(
GeneralUtility::intExplode(
',', trim($this->modSharedTSconfig[
'properties'][
'colPos_list'])));
640 if (!empty($this->colPosList) && !empty($this->activeColPosList)) {
641 $this->activeColPosList = array_unique(array_intersect(
642 $this->activeColPosList,
649 $this->activeColPosList = implode(
',', $this->activeColPosList);
650 $this->colPosList = implode(
',', $this->colPosList);
656 if ($this->MOD_SETTINGS[
'function'] == 0) {
658 $content .=
'<form action="' . htmlspecialchars(BackendUtility::getModuleUrl(
'tce_db', [
'prErr' => 1,
'uPT' => 1])) .
'" method="post" enctype="multipart/form-data" name="editform" id="PageLayoutController" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
659 $content .= $this->renderQuickEdit();
661 $content .=
'<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, array(
'id' => $this->
id,
'imagemode' => $this->imagemode))) .
'" id="PageLayoutController" method="post">';
665 $content .= $this->renderListContent();
670 $this->
makeButtons($this->MOD_SETTINGS[
'function'] == 0 ?
'quickEdit' :
'');
675 $this->moduleTemplate->addJavaScriptCode(
677 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (
int)$this->
id .
';'
679 $content .=
'<h1>' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'] .
'</h1>';
682 $view->assignMultiple(array(
683 'title' =>
$lang->getLL(
'clickAPage_header'),
684 'message' =>
$lang->getLL(
'clickAPage_content'),
690 $this->moduleTemplate->setContent(
$content);
698 public function renderQuickEdit()
709 while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
710 $idListA[] = $cRow[
'uid'];
712 $url = BackendUtility::getModuleUrl(
'record_edit', array(
713 'edit[tt_content][' . implode(
',', $idListA) .
']' =>
'edit',
719 if ($this->new_unique_uid) {
720 $res = $databaseConnection->exec_SELECTquery(
'*',
'sys_log',
'userid=' . (
int)$beUser->user[
'uid'] .
' AND NEWid=' . $databaseConnection->fullQuoteStr($this->new_unique_uid,
'sys_log'));
721 $sys_log_row = $databaseConnection->sql_fetch_assoc($res);
722 if (is_array($sys_log_row)) {
723 $edit_record = $sys_log_row[
'tablename'] .
':' . $sys_log_row[
'recuid'];
729 $tableName = $this->eRParts[0];
733 $this->undoButton =
false;
734 $undoRes = $databaseConnection->exec_SELECTquery(
'tstamp',
'sys_history',
'tablename=' . $databaseConnection->fullQuoteStr($tableName,
'sys_history') .
' AND recuid=' . (int)$this->eRParts[1],
'',
'tstamp DESC',
'1');
735 if ($this->undoButtonR = $databaseConnection->sql_fetch_assoc($undoRes)) {
736 $this->undoButton =
true;
741 unset($R_URL_getvars[
'popView']);
742 unset($R_URL_getvars[
'new_unique_uid']);
749 list($uidVal, $neighborRecordUid, $ex_colPos) = explode(
'/', $this->eRParts[1]);
751 if ($uidVal ===
'new') {
755 if ($neighborRecordUid) {
756 $theUid = $neighborRecordUid;
764 $theUid = $draftRecord[
'uid'];
769 $GLOBALS[
'_GET'][
'defVals'][$tableName] = array(
770 'colPos' => (
int)$ex_colPos,
771 'sys_language_uid' => (
int)$this->current_sys_language
782 $formDataCompilerInput = [
783 'tableName' => $tableName,
784 'vanillaUid' => (int)$theUid,
785 'command' => $command,
787 $formData = $formDataCompiler->compile($formDataCompilerInput);
789 if ($command !==
'new') {
790 BackendUtility::lockRecords($tableName, $formData[
'databaseRow'][
'uid'], $tableName ===
'tt_content' ? $formData[
'databaseRow'][
'pid'] : 0);
793 $formData[
'renderType'] =
'outerWrapContainer';
794 $formResult = $nodeFactory->create($formData)->render();
796 $panel = $formResult[
'html'];
797 $formResult[
'html'] =
'';
801 $formResultCompiler->mergeResult($formResult);
803 $row = $formData[
'databaseRow'];
805 if ($command ===
'new') {
810 if ($uidVal ==
'new') {
811 $panel .=
'<input type="hidden" name="data[' . $tableName .
'][' . $row[
'uid'] .
'][pid]" value="' . $row[
'pid'] .
'" />';
813 $redirect = ($uidVal ==
'new' ? BackendUtility::getModuleUrl(
815 [
'id' => $this->
id,
'new_unique_uid' =>
$new_unique_uid,
'returnUrl' => $this->returnUrl]
818 <input type="hidden" name="_serialNumber" value="' . md5(microtime()) .
'" />
819 <input type="hidden" name="edit_record" value="' .
$edit_record .
'" />
820 <input type="hidden" name="redirect" value="' . htmlspecialchars($redirect) .
'" />
823 $content = $formResultCompiler->JStop() . $panel . $formResultCompiler->printNeededJSFunctions();
826 if ($command ===
'edit') {
834 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
835 $defaultFlashMessageQueue->enqueue($flashMessage);
838 }
catch (AccessDeniedException $e) {
840 $content =
'<h2>' .
$lang->getLL(
'noAccess',
true) .
'</h2>';
841 $conten .=
'<div>' .
$lang->getLL(
'noAccess_msg') .
'<br /><br />' . ($beUser->errorMsg ?
'Reason: ' . $beUser->errorMsg .
'<br /><br />' :
'') .
'</div>';
846 $content .=
'<div>' .
$lang->getLL(
'noAccess_msg') .
'</div>';
855 $content .= $posMap->printContentElementColumns(
859 $this->MOD_SETTINGS[
'tt_content_showHidden'],
864 if ($numberOfHiddenElements) {
865 $content .=
'<div class="checkbox">';
866 $content .=
'<label for="checkTt_content_showHidden">';
868 $content .= (!$numberOfHiddenElements ? (
'<span class="text-muted">' .
$lang->getLL(
'hiddenCE',
true) .
'</span>') :
$lang->getLL(
'hiddenCE',
true) .
' (' . $numberOfHiddenElements .
')');
884 public function renderListContent()
886 $this->moduleTemplate->getPageRenderer()->loadJquery();
887 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ClickMenu');
891 $dbList->no_noWrap = 1;
894 $dbList->script = BackendUtility::getModuleUrl($this->moduleName);
895 $dbList->showIcon = 0;
896 $dbList->setLMargin = 0;
899 $dbList->agePrefixes = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
902 $dbList->option_newWizard = $this->modTSconfig[
'properties'][
'disableNewContentElementWizard'] ? 0 : 1;
903 $dbList->defLangBinding = $this->modTSconfig[
'properties'][
'defLangBinding'] ? 1 : 0;
904 if (!$dbList->nextThree) {
905 $dbList->nextThree = 1;
910 $dbList->getTableMenu($this->
id);
912 $tableOutput = array();
913 $tableJSOutput = array();
917 foreach ($dbList->activeTables as $table => $value) {
920 if (!isset($dbList->externalTables[$table])) {
923 if ($numberOfHiddenElements > 0) {
925 <div class="checkbox">
926 <label for="checkTt_content_showHidden">
927 <input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS[
'tt_content_showHidden'] ?
'checked="checked"' :
'') .
' />
928 ' . $this->
getLanguageService()->getLL(
'hiddenCE',
true) .
' (<span class="t3js-hidden-counter">' . $numberOfHiddenElements .
'</span>)
934 $dbList->tt_contentConfig[
'showCommands'] = 1;
936 $dbList->tt_contentConfig[
'showInfo'] = 1;
938 if (is_array(
$GLOBALS[
'TCA'][
'tt_content'][
'columns'][
'colPos'][
'config'][
'items'])) {
941 foreach ($tcaItems as $temp) {
942 $colList[] = $temp[1];
946 $colList = array(
'1',
'0',
'2',
'3');
948 if ($this->colPosList !==
'') {
952 $dbList->tt_contentConfig[
'cols'] = implode(
',', $colList);
954 $dbList->tt_contentConfig[
'showHidden'] = $this->MOD_SETTINGS[
'tt_content_showHidden'];
955 $dbList->tt_contentConfig[
'sys_language_uid'] = (int)$this->current_sys_language;
957 if ($this->MOD_SETTINGS[
'function'] == 2) {
958 $dbList->tt_contentConfig[
'languageMode'] = 1;
959 $dbList->tt_contentConfig[
'languageCols'] = $this->MOD_MENU[
'language'];
963 if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) {
964 $h_func =
BackendUtility::getFuncMenu($this->
id,
'SET[' . $table .
']', $this->MOD_SETTINGS[$table], $this->MOD_MENU[$table],
'',
'');
968 $dbList->itemsLimitSingleTable = 1000;
969 $dbList->start($this->
id, $table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit);
970 $dbList->counter = $CMcounter;
971 $dbList->ext_function = $this->MOD_SETTINGS[
'function'];
973 $dbList->HTMLcode .= $this->moduleTemplate->getVersionSelector($this->
id);
975 $dbList->generateList();
977 $tableOutput[$table] = $h_func . $dbList->HTMLcode . $h_func_b;
979 $tableJSOutput[$table] = $dbList->JScode;
981 $CMcounter += $dbList->counter;
983 $dbList->HTMLcode =
'';
984 $dbList->JScode =
'';
991 $headerContentHook =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms/layout/db_layout.php'][
'drawHeaderHook'];
992 if (is_array($headerContentHook)) {
993 foreach ($headerContentHook as $hook) {
999 foreach ($tableOutput as $table => $output) {
1003 if (!$this->modTSconfig[
'properties'][
'disableSearchBox'] && !empty($tableOutput)) {
1004 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/ToggleSearchToolbox');
1005 $toggleSearchFormButton = $this->buttonBar->makeLinkButton()
1006 ->setClasses(
't3js-toggle-search-toolbox')
1007 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.title.searchIcon',
true))
1011 $this->searchContent = $dbList->getSearchBox();
1014 $footerContentHook =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms/layout/db_layout.php'][
'drawFooterHook'];
1015 if (is_array($footerContentHook)) {
1016 foreach ($footerContentHook as $hook) {
1039 echo $this->moduleTemplate->renderContent();
1058 $viewButton = $this->buttonBar->makeLinkButton()
1060 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.showPage',
true))
1061 ->setIcon($this->iconFactory->getIcon(
'actions-document-view',
Icon::SIZE_SMALL))
1067 $shortcutButton = $this->buttonBar->makeShortcutButton()
1068 ->setModuleName($this->moduleName)
1079 ->setSetVariables(array_keys($this->MOD_MENU));
1080 $this->buttonBar->addButton($shortcutButton);
1083 if (!$this->modTSconfig[
'properties'][
'disableAdvanced']) {
1084 $clearCacheButton = $this->buttonBar->makeLinkButton()
1085 ->setHref(BackendUtility::getModuleUrl($this->moduleName, [
'id' => $this->pageinfo[
'uid'],
'clear_cache' =>
'1']))
1086 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.clear_cache',
true))
1087 ->setIcon($this->iconFactory->getIcon(
'actions-system-cache-clear',
Icon::SIZE_SMALL));
1090 if (!$this->modTSconfig[
'properties'][
'disableIconToolbar']) {
1094 'table' => $this->eRParts[0],
1095 'uid' => $this->eRParts[1],
1098 $moveButton = $this->buttonBar->makeLinkButton()
1099 ->setHref(BackendUtility::getModuleUrl(
'move_element', $urlParameters))
1100 ->setTitle(
$lang->getLL(
'move_' . ($this->eRParts[0] ==
'tt_content' ?
'record' :
'page'),
true))
1101 ->setIcon($this->iconFactory->getIcon(
'actions-' . ($this->eRParts[0] ==
'tt_content' ?
'document' :
'page') .
'-move',
Icon::SIZE_SMALL));
1108 if ($this->MOD_SETTINGS[
'function'] == 1 && $this->current_sys_language > 0) {
1111 'pages_language_overlay',
1112 'pid = ' . (
int)$this->
id .
' ' .
1113 'AND sys_language_uid = ' . (
int)$this->current_sys_language .
1120 $editLanguageButton = $this->buttonBar->makeLinkButton()
1122 ->setTitle(
$lang->getLL(
'editPageLanguageOverlayProperties',
true))
1124 ->setIcon($this->iconFactory->getIcon(
'mimetypes-x-content-page-language-overlay',
Icon::SIZE_SMALL));
1127 $editPageButton = $this->buttonBar->makeLinkButton()
1129 ->setTitle(
$lang->getLL(
'editPageProperties',
true))
1131 ->setIcon($this->iconFactory->getIcon(
'actions-page-open',
Icon::SIZE_SMALL));
1136 $contextSensitiveHelpButton = $this->buttonBar->makeHelpButton()
1137 ->setModuleName($this->descrTable)
1138 ->setFieldName(($function ===
'quickEdit' ?
'quickEdit' :
'columns_' . $this->MOD_SETTINGS[
'function']));
1139 $this->buttonBar->addButton($contextSensitiveHelpButton);
1142 if ($function ==
'quickEdit') {
1144 $closeButton = $this->buttonBar->makeLinkButton()
1147 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.closeDoc',
true))
1148 ->setIcon($this->iconFactory->getIcon(
'actions-document-close',
Icon::SIZE_SMALL));
1152 $saveButtonDropdown = $this->buttonBar->makeSplitButton();
1153 $saveButton = $this->buttonBar->makeInputButton()
1154 ->setName(
'_savedok')
1156 ->setForm(
'PageLayoutController')
1157 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc',
true))
1158 ->setIcon($this->iconFactory->getIcon(
'actions-document-save',
Icon::SIZE_SMALL));
1159 $saveButtonDropdown->addItem($saveButton);
1160 $saveAndCloseButton = $this->buttonBar->makeInputButton()
1161 ->setName(
'_saveandclosedok')
1163 ->setForm(
'PageLayoutController')
1164 ->setOnClick(
'document.editform.redirect.value=\'' . $this->closeUrl .
'\';
')
1165 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc
', true))
1166 ->setIcon($this->iconFactory->getIcon('actions-document-save-close
', Icon::SIZE_SMALL));
1167 $saveButtonDropdown->addItem($saveAndCloseButton);
1168 $saveAndShowPageButton = $this->buttonBar->makeInputButton()
1169 ->setName('_savedokview
')
1172 ->setOnClick('document.editform.redirect.value+=\
'&popView=1\';')
1173 ->setTitle(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow',
true))
1174 ->setIcon($this->iconFactory->getIcon(
'actions-document-save-view',
Icon::SIZE_SMALL));
1175 $saveButtonDropdown->addItem($saveAndShowPageButton);
1179 if ($this->deleteButton) {
1183 ->setTitle(
$lang->getLL(
'deleteItem',
true))
1184 ->setIcon($this->iconFactory->getIcon(
'actions-edit-delete',
Icon::SIZE_SMALL));
1189 if ($this->undoButton) {
1192 ->setOnClick(htmlspecialchars(
'window.location.href=' .
1194 BackendUtility::getModuleUrl(
1197 'element' => $this->eRParts[0] .
':' . $this->eRParts[1],
1198 'revert' =>
'ALL_FIELDS',
1200 'returnUrl' => $this->R_URI,
1203 ) .
'; return false;'))
1204 ->setTitle(htmlspecialchars(sprintf(
$lang->getLL(
'undoLastChange'),
BackendUtility::calcAge(
$GLOBALS[
'EXEC_TIME'] - $this->undoButtonR[
'tstamp'],
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))))
1205 ->setIcon($this->iconFactory->getIcon(
'actions-edit-undo',
Icon::SIZE_SMALL));
1207 $historyButton = $this->buttonBar->makeLinkButton()
1209 ->setOnClick(htmlspecialchars(
'jumpToUrl(' .
1211 BackendUtility::getModuleUrl(
1214 'element' => $this->eRParts[0] .
':' . $this->eRParts[1],
1215 'returnUrl' => $this->R_URI,
1218 ) .
');return false;'))
1219 ->setTitle(
$lang->getLL(
'recordHistory',
true))
1220 ->setIcon($this->iconFactory->getIcon(
'actions-document-history-open',
Icon::SIZE_SMALL));
1257 $params[
'popView'] =
'';
1258 $params[
'new_unique_uid'] =
'';
1272 ($this->
getBackendUser()->isAdmin() ?
'' :
' AND sys_language.hidden=0');
1275 'pages_language_overlay,sys_language',
1276 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . (
int)
$id . $exQ .
1278 'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.language_isocode,sys_language.static_lang_isocode,sys_language.flag',
1279 'sys_language.title'
1285 'sys_language.hidden=0',
1287 'sys_language.title'
1301 foreach ($this->contentElementCache[$languageId][$colPos] as $uid => $row) {
1302 if ((
int)$row[
'l18n_parent'] === 0) {
1319 if (!isset($this->contentElementCache[$languageId][$colPos])) {
1320 $languageId = (int)$languageId;
1321 $whereClause =
'tt_content.pid=' . (int)$pageId .
' AND tt_content.colPos=' . (
int)$colPos .
' AND tt_content.sys_language_uid=' . $languageId .
BackendUtility::deleteClause(
'tt_content');
1322 if ($languageId > 0) {
1323 $whereClause .=
' AND tt_content.l18n_parent=0 AND sys_language.uid=' . $languageId . ($this->
getBackendUser()->isAdmin() ?
'' :
' AND sys_language.hidden=0');
1327 $res = $databaseConnection->exec_SELECTquery(
1329 'tt_content,sys_language',
1332 while ($row = $databaseConnection->sql_fetch_assoc($res)) {
1333 $this->contentElementCache[$languageId][$colPos][$row[
'uid']] = $row;
1335 $databaseConnection->sql_free_result($res);
1337 if (is_array($this->contentElementCache[$languageId][$colPos])) {
1338 return array_keys($this->contentElementCache[$languageId][$colPos]);
1404 $quickEditMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
1405 $quickEditMenu->setIdentifier(
'quickEditMenu');
1406 $quickEditMenu->setLabel(
'');
1411 if ($this->returnUrl) {
1414 $retUrlStr = $this->returnUrl ?
'&returnUrl=' . rawurlencode($this->returnUrl) :
'';
1418 $languageOverlayRecord =
'';
1419 if ($this->current_sys_language) {
1421 'pages_language_overlay',
1424 'AND sys_language_uid=' . (
int)$this->current_sys_language
1427 if (is_array($languageOverlayRecord)) {
1428 $inValue =
'pages_language_overlay:' . $languageOverlayRecord[
'uid'];
1430 $menuItem = $quickEditMenu->makeMenuItem()
1431 ->setTitle(
'[ ' .
$lang->getLL(
'editLanguageHeader',
true) .
' ]')
1432 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=' . $inValue . $retUrlStr)
1434 $quickEditMenu->addMenuItem($menuItem);
1438 $menuItem = $quickEditMenu->makeMenuItem()
1439 ->setTitle(
'[ ' .
$lang->getLL(
'editPageProperties',
true) .
' ]')
1440 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=' . $inValue . $retUrlStr)
1442 $quickEditMenu->addMenuItem($menuItem);
1447 $whereClause .=
' AND editlock = 0';
1449 $res = $databaseConnection->exec_SELECTquery(
'*',
'tt_content', $whereClause,
'',
'colPos,sorting');
1454 while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
1456 if (is_array($cRow)) {
1463 if (!isset($colPos) || $cRow[
'colPos'] !== $colPos) {
1464 $colPos = $cRow[
'colPos'];
1465 $menuItem = $quickEditMenu->makeMenuItem()
1468 $quickEditMenu->addMenuItem($menuItem);
1469 $menuItem = $quickEditMenu->makeMenuItem()
1471 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=_EDIT_COL:' . $colPos . $retUrlStr);
1472 $quickEditMenu->addMenuItem($menuItem);
1474 $inValue =
'tt_content:' . $cRow[
'uid'];
1476 $menuItem = $quickEditMenu->makeMenuItem()
1477 ->setTitle(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'])))
1478 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=' . $inValue . $retUrlStr)
1480 $quickEditMenu->addMenuItem($menuItem);
1481 $prev = -$cRow[
'uid'];
1486 $edit_record =
'tt_content:new/' . $prev .
'/' . $colPos;
1487 $inValue =
'tt_content:new/' . $prev .
'/' . $colPos;
1489 $menuItem = $quickEditMenu->makeMenuItem()
1490 ->setTitle(
'[ ' .
$lang->getLL(
'newLabel', 1) .
' ]')
1491 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=' . $inValue . $retUrlStr)
1493 $quickEditMenu->addMenuItem($menuItem);
1497 $menuItem = $quickEditMenu->makeMenuItem()
1498 ->setTitle(
'__________')
1500 $quickEditMenu->addMenuItem($menuItem);
1501 $menuItem = $quickEditMenu->makeMenuItem()
1502 ->setTitle(
'[ ' .
$lang->getLL(
'newLabel',
true) .
' ]')
1503 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&edit_record=' .
$edit_record . $retUrlStr)
1505 $quickEditMenu->addMenuItem($menuItem);
1507 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($quickEditMenu);
1518 if (count($this->MOD_MENU[
'language']) > 1) {
1520 $languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
1521 $languageMenu->setIdentifier(
'languageMenu');
1522 $languageMenu->setLabel(
$lang->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.language',
true));
1523 foreach ($this->MOD_MENU[
'language'] as $key => $language) {
1524 $menuItem = $languageMenu
1526 ->setTitle($language)
1527 ->setHref(BackendUtility::getModuleUrl($this->moduleName) .
'&id=' . $this->
id .
'&SET[language]=' . $key);
1528 if ((
int)$this->current_sys_language === $key) {
1529 $menuItem->setActive(
true);
1531 $languageMenu->addMenuItem($menuItem);
1533 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($languageMenu);