358 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_alt_doc.xml');
367 if (!isset($this->signalSlotDispatcher)) {
404 if (!is_array($this->defVals) && is_array($this->overrideVals)) {
408 $this->retUrl = $this->returnUrl ?:
'dummy.php';
418 $this->dontStoreDocumentRef = 0;
419 $this->storeTitle =
'';
421 $this->docDat =
$GLOBALS[
'BE_USER']->getModuleData(
'alt_doc.php',
'ses');
422 $this->docHandler = $this->docDat[0];
424 if ($this->closeDoc > 0) {
430 if (is_array($this->R_URL_getvars) && count($this->R_URL_getvars) < 2 && !is_array($this->editconf)) {
435 if ($this->workspace !== NULL) {
448 $out = $this->doSave || isset($_POST[
'_savedok_x']) || isset($_POST[
'_saveandclosedok_x']) || isset($_POST[
'_savedokview_x']) || isset($_POST[
'_savedoknew_x']) || isset($_POST[
'_translation_savedok_x']) || isset($_POST[
'_translation_savedokclear_x']);
457 public function processData() {
471 $tce->stripslashes_values = 0;
473 if (!empty($control)) {
474 $tce->setControl($control);
476 if (isset($_POST[
'_translation_savedok_x'])) {
477 $tce->updateModeL10NdiffData =
'FORCE_FFUPD';
479 if (isset($_POST[
'_translation_savedokclear_x'])) {
480 $tce->updateModeL10NdiffData =
'FORCE_FFUPD';
481 $tce->updateModeL10NdiffDataClear = TRUE;
484 $TCAdefaultOverride =
$GLOBALS[
'BE_USER']->getTSConfigProp(
'TCAdefaults');
485 if (is_array($TCAdefaultOverride)) {
486 $tce->setDefaultsFromUserTS($TCAdefaultOverride);
489 if (
$GLOBALS[
'BE_USER']->uc[
'neverHideAtCopy']) {
490 $tce->neverHideAtCopy = 1;
493 $tce->disableRTE = !
$GLOBALS[
'BE_USER']->isRTE();
495 $tce->start($this->data, $this->cmd);
496 if (is_array($this->mirror)) {
497 $tce->setMirror($this->mirror);
500 if (isset($this->data[
'pages']) ||
$GLOBALS[
'BE_USER']->workspace != 0 && count($this->data)) {
506 if ($httpHost != $refInfo[
'host'] && $this->vC !=
$GLOBALS[
'BE_USER']->veriCode() && !
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'doNotCheckReferer']) {
507 $tce->log(
'', 0, 0, 0, 1,
'Referer host \'%s\' and server host \'%s\' did not match and veriCode was not valid either!', 1, array($refInfo[
'host'], $httpHost));
508 debug(
'Error: Referer host did not match with server host.');
511 $tce->process_uploads($_FILES);
512 $tce->process_datamap();
513 $tce->process_cmdmap();
515 if (count($tce->substNEWwithIDs_table)) {
518 $newEditConf = array();
519 foreach ($this->editconf as $tableName => $tableCmds) {
520 $keys = array_keys($tce->substNEWwithIDs_table, $tableName);
521 if (count($keys) > 0) {
522 foreach ($keys as $key) {
523 $editId = $tce->substNEWwithIDs[$key];
525 if (!(is_array($tce->newRelatedIDs[$tableName]) && in_array($editId, $tce->newRelatedIDs[$tableName]))) {
528 $editId = $versionRec[
'uid'];
530 $newEditConf[$tableName][$editId] =
'edit';
533 if ($tableName ==
'pages' && $this->retUrl !=
'dummy.php' && $this->returnNewPageId) {
534 $this->retUrl .=
'&id=' . $tce->substNEWwithIDs[$key];
538 $newEditConf[$tableName] = $tableCmds;
542 if (count($newEditConf)) {
543 $this->editconf = $newEditConf;
548 unset($this->R_URL_getvars[
'defVals']);
553 if (count($tce->autoVersionIdMap)) {
557 if (isset($_POST[
'_savedoknew_x']) && is_array($this->editconf)) {
559 reset($this->editconf);
560 $nTable = key($this->editconf);
562 reset($this->editconf[$nTable]);
563 $nUid = key($this->editconf[$nTable]);
564 $nRec = BackendUtility::getRecord($nTable, $nUid,
'pid,uid');
566 $this->editconf = array();
568 $this->editconf[$nTable][$nRec[
'pid']] =
'new';
570 $this->editconf[$nTable][-$nRec[
'uid']] =
'new';
577 $tce->printLogErrorMessages(isset($_POST[
'_saveandclosedok_x']) || isset($_POST[
'_translation_savedok_x']) ? $this->retUrl : $this->R_URL_parts[
'path'] .
'?' .
GeneralUtility::implodeArrayForUrl(
'', $this->R_URL_getvars));
581 if (isset($_POST[
'_saveandclosedok_x']) || isset($_POST[
'_translation_savedok_x']) || $this->closeDoc < 0) {
600 $this->perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
608 $this->MOD_MENU = array(
612 $this->MCONF[
'name'] =
'xMOD_alt_doc.php';
616 $this->doc =
$GLOBALS[
'TBE_TEMPLATE'];
617 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
618 $this->doc->setModuleTemplate(
'EXT:backend/Resources/Private/Templates/alt_doc.html');
619 $this->doc->form =
'<form action="' . htmlspecialchars($this->R_URI) .
'" method="post" enctype="' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'form_enctype'] .
'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
620 $this->doc->getPageRenderer()->loadPrototype();
622 $this->doc->JScodeArray[
'jumpToUrl'] =
' 623 function jumpToUrl(URL,formEl) { 624 if (!TBE_EDITOR.isFormChanged()) { 625 window.location.href = URL; 626 } else if (formEl && formEl.type=="checkbox") { 627 formEl.checked = formEl.checked ? 0 : 1; 631 $this->doc->JScode = $this->doc->wrapScriptTags(
' 633 // passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as 634 // TS object overwrites the object declared in tbe_editor.js 635 function typoSetup() { // 637 this.passwordDummy = "********"; 638 this.PATH_typo3 = " "; 639 this.decimalSign = "."; 641 var TS = new typoSetup(); 644 function launchView(table,uid,bP) { // 645 var backPath= bP ? bP : ""; 646 var thePreviewWindow=""; 647 thePreviewWindow = window.open(backPath+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"); 648 if (thePreviewWindow && thePreviewWindow.focus) { 649 thePreviewWindow.focus(); 652 function deleteRecord(table,id,url) { // 656 window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1' .
BackendUtility::getUrlToken(
'tceAction') .
'&redirect="+escape(url)+"&vC=' .
$GLOBALS[
'BE_USER']->veriCode() .
'&prErr=1&uPT=1"; 660 ' . (isset($_POST[
'_savedokview_x']) && $this->popViewId ?
'if (window.opener) { ' .
BackendUtility::viewOnClick($this->popViewId,
'',
BackendUtility::BEgetRootLine($this->popViewId),
'', $this->viewUrl, $this->popViewId_addParams, FALSE) .
' } else { ' .
BackendUtility::viewOnClick($this->popViewId,
'',
BackendUtility::BEgetRootLine($this->popViewId),
'', $this->viewUrl, $this->popViewId_addParams) .
' } ' :
''));
662 $this->doc->getContextMenuCode();
675 if (is_array($this->editconf)) {
678 $this->tceforms->initDefaultBEMode();
679 $this->tceforms->doSaveFieldName =
'doSave';
680 $this->tceforms->localizationMode =
GeneralUtility::inList(
'text,media', $this->localizationMode) ? $this->localizationMode :
'';
683 $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS[
'showPalettes'];
684 $this->tceforms->disableRTE = !
$GLOBALS[
'BE_USER']->isRTE();
685 $this->tceforms->enableClickMenu = TRUE;
686 $this->tceforms->enableTabMenu = TRUE;
691 $this->tceforms->clipObj->initializeClipboard();
693 $this->tceforms->edit_showFieldHelp =
$GLOBALS[
'BE_USER']->uc[
'edit_showFieldHelp'];
698 $editForm = $this->makeEditForm();
700 $this->firstEl = reset($this->elementsData);
702 if (($this->docDat[1] !== $this->storeUrlMd5 || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) {
703 $this->docHandler[
$this->storeUrlMd5] = array($this->storeTitle, $this->storeArray, $this->storeUrl, $this->firstEl);
704 $GLOBALS[
'BE_USER']->pushModuleData(
'alt_doc.php', array($this->docHandler, $this->storeUrlMd5));
709 $body = $this->tceforms->printNeededJSFunctions_top();
711 $body .= $this->tceforms->printNeededJSFunctions();
724 'CSH' => $docHeaderButtons[
'csh'],
728 $this->content = $this->doc->startPage(
'TYPO3 Edit Document');
729 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
730 $this->content .= $this->doc->endPage();
731 $this->content = $this->doc->insertStylesAndJS($this->content);
754 public function makeEditForm() {
756 $this->elementsData = array();
764 foreach ($this->editconf as $table => $conf) {
765 if (is_array($conf) &&
$GLOBALS[
'TCA'][$table] &&
$GLOBALS[
'BE_USER']->check(
'tables_modify', $table)) {
767 foreach ($conf as $cKey => $cmd) {
768 if ($cmd ==
'edit' || $cmd ==
'new') {
772 foreach ($ids as $theUid) {
778 $deniedAccessReason =
'';
790 $calcPRec = BackendUtility::getRecord($table, abs($theUid));
791 $calcPRec = BackendUtility::getRecord(
'pages', $calcPRec[
'pid']);
794 $calcPRec = BackendUtility::getRecord(
'pages', abs($theUid));
797 if (is_array($calcPRec)) {
799 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms($calcPRec);
800 if ($table ==
'pages') {
802 $hasAccess = $CALC_PERMS & 8 ? 1 : 0;
805 $hasAccess = $CALC_PERMS & 16 ? 1 : 0;
806 $this->viewId = $calcPRec[
'uid'];
811 $this->dontStoreDocumentRef = 1;
814 $calcPRec = BackendUtility::getRecord($table, $theUid);
816 if (is_array($calcPRec)) {
817 if ($table ==
'pages') {
818 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms($calcPRec);
819 $hasAccess = $CALC_PERMS & 2 ? 1 : 0;
820 $deleteAccess = $CALC_PERMS & 4 ? 1 : 0;
821 $this->viewId = $calcPRec[
'uid'];
824 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms(BackendUtility::getRecord(
'pages', $calcPRec[
'pid']));
825 $hasAccess = $CALC_PERMS & 16 ? 1 : 0;
826 $deleteAccess = $CALC_PERMS & 16 ? 1 : 0;
827 $this->viewId = $calcPRec[
'pid'];
829 if (
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] && $calcPRec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] > 0) {
830 $this->viewId_addParams =
'&L=' . $calcPRec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']];
835 if ($hasAccess || (
int)$calcPRec[
'pid'] === 0 && $isRootLevelRestrictionIgnored) {
836 $hasAccess =
$GLOBALS[
'BE_USER']->recordEditAccessInternals($table, $calcPRec);
837 $deniedAccessReason =
$GLOBALS[
'BE_USER']->errorMsg;
843 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/alt_doc.php'][
'makeEditForm_accessCheck'])) {
844 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/alt_doc.php'][
'makeEditForm_accessCheck'] as $_funcRef) {
849 'hasAccess' => $hasAccess
857 $prevPageID = is_object($trData) ? $trData->prevPageID :
'';
859 $trData->addRawData = TRUE;
861 $trData->lockRecords = 1;
862 $trData->disableRTE = !
$GLOBALS[
'BE_USER']->isRTE();
863 $trData->prevPageID = $prevPageID;
865 $trData->fetchRecord($table, $theUid, $cmd ==
'new' ?
'new' :
'');
866 $rec = reset($trData->regTableItems_data);
867 $rec[
'uid'] = $cmd ==
'new' ? uniqid(
'NEW', TRUE) : $theUid;
869 $rec[
'pid'] = $theUid ==
'prev' ? (int)$thePrevUid : (
int)$theUid;
871 $this->elementsData[] = array(
873 'uid' => $rec[
'uid'],
874 'pid' => $rec[
'pid'],
876 'deleteAccess' => $deleteAccess
879 if (is_array($rec)) {
881 $this->generalPathOfForm = $this->tceforms->getRecordPath($table, $rec);
882 if (!$this->storeTitle) {
886 $this->tceforms->hiddenFieldList =
'';
888 if (is_array($this->overrideVals) && is_array($this->overrideVals[$table])) {
889 $this->tceforms->hiddenFieldListArr = array_keys($this->overrideVals[$table]);
892 $this->tceforms->registerDefaultLanguageData($table, $rec);
895 if ($this->columnsOnly) {
896 if (is_array($this->columnsOnly)) {
897 $panel .= $this->tceforms->getListedFields($table, $rec, $this->columnsOnly[$table]);
899 $panel .= $this->tceforms->getListedFields($table, $rec, $this->columnsOnly);
902 $panel .= $this->tceforms->getMainFields($table, $rec);
904 $panel = $this->tceforms->wrapTotal($panel, $rec, $table);
907 $panel .=
'<input type="hidden" name="data[' . htmlspecialchars($table) .
'][' . htmlspecialchars($rec[
'uid']) .
'][pid]" value="' . (int)$rec[
'pid'] .
'" />';
916 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
917 $defaultFlashMessageQueue->enqueue($flashMessage);
922 $thePrevUid = $rec[
'uid'];
925 $editForm .=
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.noEditPermission', TRUE) .
'<br /><br />' . ($deniedAccessReason ?
'Reason: ' . htmlspecialchars($deniedAccessReason) .
'<br /><br />' :
'');
950 'columns_only' =>
'',
952 'translation_save' =>
'',
953 'translation_saveclear' =>
'' 957 if (!$this->errorC && !
$GLOBALS[
'TCA'][$this->firstEl[
'table']][
'ctrl'][
'readOnly']) {
959 $buttons[
'save'] =
IconUtility::getSpriteIcon(
'actions-document-save', array(
'html' =>
'<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) .
'" />'));
961 if ($this->viewId && !$this->noView && $this->
getNewIconMode($this->firstEl[
'table'],
'saveDocView')) {
962 $buttons[
'save_view'] =
IconUtility::getSpriteIcon(
'actions-document-save-view', array(
'html' =>
'<input onclick="window.open(\'\', \'newTYPO3frontendWindow\');" type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) .
'" />'));
965 if (count($this->elementsData) == 1 && $this->
getNewIconMode($this->firstEl[
'table'])) {
966 $buttons[
'save_new'] =
IconUtility::getSpriteIcon(
'actions-document-save-new', array(
'html' =>
'<input type="image" class="c-inputButton" name="_savedoknew" src="clear.gif" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveNewDoc', TRUE) .
'" />'));
969 $buttons[
'save_close'] =
IconUtility::getSpriteIcon(
'actions-document-save-close', array(
'html' =>
'<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) .
'" />'));
971 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'explicitConfirmationOfTranslation']) {
972 $buttons[
'translation_save'] =
'<input type="image" class="c-inputButton" name="_translation_savedok" src="' .
IconUtility::skinImg($this->doc->backPath,
'sysext/t3skin/images/icons/actions/document-save-translation.png',
'', 1) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.translationSaveDoc', TRUE) .
'" /> ';
973 $buttons[
'translation_saveclear'] =
'<input type="image" class="c-inputButton" name="_translation_savedokclear" src="' .
IconUtility::skinImg($this->doc->backPath,
'sysext/t3skin/images/icons/actions/document-save-cleartranslationcache.png',
'', 1) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.translationSaveDocClear', TRUE) .
'" />';
977 $buttons[
'close'] =
'<a href="#" onclick="document.editform.closeDoc.value=1; document.editform.submit(); return false;" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-document-close') .
'</a>';
979 if (!$this->errorC && !
$GLOBALS[
'TCA'][$this->firstEl[
'table']][
'ctrl'][
'readOnly'] && count($this->elementsData) == 1) {
982 if ($this->firstEl[
'deleteAccess'] && !
$GLOBALS[
'TCA'][$this->firstEl[
'table']][
'ctrl'][
'readOnly'] && !$this->
getNewIconMode($this->firstEl[
'table'],
'disableDelete')) {
983 $aOnClick =
'return deleteRecord(\'' . $this->firstEl[
'table'] .
'\',\
'' . $this->firstEl[
'uid'] .
'\', unescape(\
'' . rawurlencode($this->retUrl) .
'\'));
'; 984 $buttons['delete'] = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '" title=
"' . $GLOBALS['LANG']->getLL('deleteItem', TRUE) . '">
' . IconUtility::getSpriteIcon('actions-edit-
delete') . '</a>
'; 987 $undoRes = $GLOBALS['TYPO3_DB
']->exec_SELECTquery('tstamp
', 'sys_history
', 'tablename=
' . $GLOBALS['TYPO3_DB
']->fullQuoteStr($this->firstEl['table
'], 'sys_history
') . ' AND recuid=
' . (int)$this->firstEl['uid
'], '', 'tstamp DESC
', '1
'); 988 if ($undoButtonR = $GLOBALS['TYPO3_DB
']->sql_fetch_assoc($undoRes)) { 989 $aOnClick = 'window.location.href=
' . 990 GeneralUtility::quoteJSvalue( 991 BackendUtility::getModuleUrl( 994 'element
' => $this->firstEl['table
'] . ':
' . $this->firstEl['uid
'], 995 'revert
' => 'ALL_FIELDS
', 997 'returnUrl
' => $this->R_URI, 1000 ) . ';
return false;
'; 1001 $buttons['undo
'] = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '"' . ' title=
"' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('undoLastChange'), BackendUtility::calcAge(($GLOBALS['EXEC_TIME'] - $undoButtonR['tstamp']), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))) . '">
' . IconUtility::getSpriteIcon('actions-edit-undo
') . '</a>
'; 1003 if ($this->getNewIconMode($this->firstEl['table
'], 'showHistory
')) { 1004 $aOnClick = 'window.location.href=
' . 1005 GeneralUtility::quoteJSvalue( 1006 BackendUtility::getModuleUrl( 1009 'element
' => $this->firstEl['table
'] . ':
' . $this->firstEl['uid
'], 1010 'returnUrl
' => $this->R_URI, 1013 ) . ';
return false;
'; 1014 $buttons['history
'] = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
' . IconUtility::getSpriteIcon('actions-document-history-open
') . '</a>
'; 1016 // If only SOME fields are shown in the form, this will link the user to the FULL form: 1017 if ($this->columnsOnly) { 1018 $buttons['columns_only
'] = '<a href=
"' . htmlspecialchars(($this->R_URI . '&columnsOnly=')) . '" title=
"' . $GLOBALS['LANG']->getLL('editWholeRecord', TRUE) . '">
' . IconUtility::getSpriteIcon('actions-document-open
') . '</a>
'; 1023 $buttons['csh
'] = BackendUtility::cshItem('xMOD_csh_corebe
', 'TCEforms
', $GLOBALS['BACK_PATH
'], '', TRUE); 1024 $buttons['shortcut
'] = $this->shortCutLink(); 1025 $buttons['open_in_new_window
'] = $this->openInNewWindowLink(); 1037 public function langSelector() { 1039 if (count($this->elementsData) == 1) { 1040 $langSelector = $this->languageSwitch($this->firstEl['table
'], $this->firstEl['uid
'], $this->firstEl['pid
']); 1042 return $langSelector; 1051 public function extraFormHeaders() { 1052 $extraTemplate = ''; 1053 if (is_array($this->tceforms->extraFormHeaders)) { 1054 $extraTemplate = HtmlParser::getSubpart($this->doc->moduleTemplate, '###DOCHEADER_EXTRAHEADER###
'); 1055 $extraTemplate = HtmlParser::substituteMarker($extraTemplate, '###EXTRAHEADER###
', implode(LF, $this->tceforms->extraFormHeaders)); 1057 return $extraTemplate; 1067 public function compileForm($editForm) { 1069 <!-- EDITING FORM -->
1072 <input type=
"hidden" name=
"returnUrl" value=
"' . htmlspecialchars($this->retUrl) . '" />
1073 <input type=
"hidden" name=
"viewUrl" value=
"' . htmlspecialchars($this->viewUrl) . '" />
'; 1074 if ($this->returnNewPageId) { 1075 $formContent .= '<input type=
"hidden" name=
"returnNewPageId" value=
"1" />
'; 1077 $formContent .= '<input type=
"hidden" name=
"popViewId" value=
"' . htmlspecialchars($this->viewId) . '" />
'; 1078 if ($this->viewId_addParams) { 1079 $formContent .= '<input type=
"hidden" name=
"popViewId_addParams" value=
"' . htmlspecialchars($this->viewId_addParams) . '" />
'; 1082 <input type=
"hidden" name=
"closeDoc" value=
"0" />
1083 <input type=
"hidden" name=
"doSave" value=
"0" />
1084 <input type=
"hidden" name=
"_serialNumber" value=
"' . md5(microtime()) . '" />
1085 <input type=
"hidden" name=
"_scrollPosition" value=
"" />
' . FormEngine::getHiddenTokenField('editRecord
'); 1086 return $formContent; 1095 public function functionMenus() { 1096 if ($GLOBALS['BE_USER
']->getTSConfigVal('options.enableShowPalettes
')) { 1099 <!-- Function menu (checkbox
for showing all palettes): -->
1100 <br />
' . BackendUtility::getFuncCheck('', 'SET[showPalettes]
', $this->MOD_SETTINGS['showPalettes
'], 'alt_doc.php
', (GeneralUtility::implodeArrayForUrl('', array_merge($this->R_URL_getvars, array('SET
' => ''))) . BackendUtility::getUrlToken('editRecord
')), 'id=
"checkShowPalettes"') . '<label for=
"checkShowPalettes">
' . $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPalettes
', TRUE) . '</label>
'; 1112 public function shortCutLink() { 1113 if ($this->returnUrl == 'close.html
' || !$GLOBALS['BE_USER
']->mayMakeShortcut()) { 1116 return $this->doc->makeShortcutIcon('returnUrl,edit,defVals,overrideVals,columnsOnly,returnNewPageId,
editRegularContentFromId,disHelp,noView
', implode(',
', array_keys($this->MOD_MENU)), $this->MCONF['name
'], 1); 1125 public function openInNewWindowLink() { 1126 if ($this->returnUrl == 'close.html
') { 1129 $aOnClick = 'vHWin=window.open(
' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(array('returnUrl
' => 'close.html
'))) . ',\
'' . md5($this->R_URI) .
'\',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
1130 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-window-open') .
'</a>';
1140 if (count($this->tceforms->commentMessages)) {
1141 $tceformMessages =
' 1142 <!-- TCEFORM messages 1143 ' . htmlspecialchars(implode(LF, $this->tceforms->commentMessages)) .
' 1147 return $tceformMessages;
1167 $languageField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'];
1168 $transOrigPointerField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField'];
1170 if (
$GLOBALS[
'BE_USER']->check(
'tables_modify', $table) && $languageField && $transOrigPointerField && !
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerTable']) {
1171 if (is_null($pid)) {
1172 $row = BackendUtility::getRecord($table,
$uid,
'pid');
1178 if (is_array($langRows) && count($langRows) > 1) {
1179 $rowsByLang = array();
1180 $fetchFields =
'uid,' . $languageField .
',' . $transOrigPointerField;
1183 if (!is_array($rowCurrent)) {
1184 $rowCurrent = BackendUtility::getRecord($table,
$uid, $fetchFields);
1186 $currentLanguage = $rowCurrent[$languageField];
1188 if ($currentLanguage > -1) {
1190 if ($currentLanguage && $rowCurrent[$transOrigPointerField]) {
1192 if (!is_array($rowsByLang[0])) {
1193 $rowsByLang[0] = BackendUtility::getRecord($table, $rowCurrent[$transOrigPointerField], $fetchFields);
1196 $rowsByLang[$rowCurrent[$languageField]] = $rowCurrent;
1198 if ($rowCurrent[$transOrigPointerField] || $currentLanguage ===
'0') {
1201 foreach ($translations as $row) {
1202 $rowsByLang[$row[$languageField]] = $row;
1205 $langSelItems = array();
1206 foreach ($langRows as $lang) {
1207 if (
$GLOBALS[
'BE_USER']->checkLanguageAccess($lang[
'uid'])) {
1208 $newTranslation = isset($rowsByLang[$lang[
'uid']]) ?
'' :
' [' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.new', TRUE) .
']';
1210 if ($newTranslation) {
1211 $href = $this->doc->issueCommand(
'&cmd[' . $table .
'][' . $rowsByLang[0][
'uid'] .
'][localize]=' . $lang[
'uid'], $this->backPath .
'alt_doc.php?justLocalized=' . rawurlencode(($table .
':' . $rowsByLang[0][
'uid'] .
':' . $lang[
'uid'])) .
'&returnUrl=' . rawurlencode($this->retUrl) .
BackendUtility::getUrlToken(
'editRecord'));
1213 $href = $this->backPath .
'alt_doc.php?';
1214 $href .=
'&edit[' . $table .
'][' . $rowsByLang[$lang[
'uid']][
'uid'] .
']=edit';
1217 $langSelItems[$lang[
'uid']] =
' 1218 <option value="' . htmlspecialchars($href) .
'"' . ($currentLanguage == $lang[
'uid'] ?
' selected="selected"' :
'') .
'>' . htmlspecialchars(($lang[
'title'] . $newTranslation)) .
'</option>';
1222 if (count($langSelItems) > 1) {
1223 $onChange =
'if(this.options[this.selectedIndex].value){window.location.href=(this.options[this.selectedIndex].value);}';
1224 $content =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.language', TRUE) .
' <select name="_langSelector" onchange="' . htmlspecialchars($onChange) .
'"> 1225 ' . implode(
'', $langSelItems) .
' 1242 list($table, $orig_uid, $language) = explode(
':', $justLocalized);
1243 if (
$GLOBALS[
'TCA'][$table] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']) {
1245 if (is_array($localizedRecord)) {
1247 $params =
'&edit[' . $table .
'][' . $localizedRecord[
'uid'] .
']=edit';
1265 if (preg_match(
'/\\.gif$/', $modSharedTSconfig[
'properties'][
'defaultLanguageFlag'])) {
1266 $modSharedTSconfig[
'properties'][
'defaultLanguageFlag'] = str_replace(
'.gif',
'', $modSharedTSconfig[
'properties'][
'defaultLanguageFlag']);
1273 'title' => strlen($modSharedTSconfig[
'properties'][
'defaultLanguageLabel']) ? $modSharedTSconfig[
'properties'][
'defaultLanguageLabel'] .
' (' .
$GLOBALS[
'LANG']->sl(
'LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage') .
')' :
$GLOBALS[
'LANG']->sl(
'LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage'),
1274 'flag' => $modSharedTSconfig[
'properties'][
'defaultLanguageFlag']
1277 $exQ =
$GLOBALS[
'BE_USER']->isAdmin() ?
'' :
' AND sys_language.hidden=0';
1279 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'sys_language.*',
'pages_language_overlay,sys_language',
'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . (
int)$id .
BackendUtility::deleteClause(
'pages_language_overlay') . $exQ,
'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag',
'sys_language.title');
1281 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'sys_language.*',
'sys_language',
'sys_language.hidden=0',
'',
'sys_language.title');
1284 foreach ($rows as $row) {
1285 $languages[$row[
'uid']] = $row;
1305 if (is_array($this->editconf)) {
1307 foreach ($this->editconf as $table => $conf) {
1308 if (is_array($conf) &&
$GLOBALS[
'TCA'][$table]) {
1311 foreach ($conf as $cKey => $cmd) {
1312 if ($cmd ==
'edit') {
1315 foreach ($ids as $idKey => $theUid) {
1316 if (is_array($mapArray)) {
1317 if ($mapArray[$table][$theUid]) {
1318 $ids[$idKey] = $mapArray[$table][$theUid];
1323 if (is_array($calcPRec)) {
1325 $ids[$idKey] = $calcPRec[
'uid'];
1330 $newConf[implode(
',', $ids)] = $cmd;
1332 $newConf[$cKey] = $cmd;
1336 $this->editconf[$table] = $newConf;
1352 $reqRecord = BackendUtility::getRecord($table, $theUid,
'uid,pid');
1353 if (is_array($reqRecord)) {
1355 if (
$GLOBALS[
'BE_USER']->workspace != 0) {
1357 if (
$GLOBALS[
'TCA'][$table] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'versioningWS']) {
1359 if ($reqRecord[
'pid'] == -1) {
1366 return is_array($versionRec) ? $versionRec : $reqRecord;
1390 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res)) {
1392 while ($ecRec =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
1393 $ecUids[] = $ecRec[
'uid'];
1395 $this->editconf[
'tt_content'][implode(
',', $ecUids)] =
'edit';
1397 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
1410 $this->storeUrlMd5 = md5($this->storeUrl);
1422 $TSconfig =
$GLOBALS[
'BE_USER']->getTSConfig(
'options.' . $key);
1423 $output = trim(isset($TSconfig[
'properties'][$table]) ? $TSconfig[
'properties'][$table] : $TSconfig[
'value']);
1437 if (isset($this->docHandler[$this->storeUrlMd5])) {
1439 $recentDocs =
$GLOBALS[
'BE_USER']->getModuleData(
'opendocs::recent');
1440 if (!is_array($recentDocs)) {
1441 $recentDocs = array();
1444 $recentDocs = array_merge(array($this->storeUrlMd5 => $closedDoc), $recentDocs);
1445 if (count($recentDocs) > 8) {
1446 $recentDocs = array_slice($recentDocs, 0, 8);
1449 unset($this->docHandler[$this->storeUrlMd5]);
1451 $recentDocs = array_merge($this->docHandler, $recentDocs);
1452 $this->docHandler = array();
1454 $GLOBALS[
'BE_USER']->pushModuleData(
'opendocs::recent', $recentDocs);
1455 $GLOBALS[
'BE_USER']->pushModuleData(
'alt_doc.php', array($this->docHandler, $this->docDat[1]));
1459 if ($this->returnEditConf && $this->retUrl !=
'dummy.php') {
1460 $this->retUrl .=
'&returnEditConf=' . rawurlencode(json_encode($this->editconf));
1463 if (!$code || $code == 1) {
1480 if (
$retUrl ===
'alt_doc_nodoc.php') {
1483 if (!$this->modTSconfig[
'properties'][
'disableDocSelector'] && is_array($this->docHandler) && count($this->docHandler)) {
1484 if (isset($this->docHandler[$currentDocFromHandlerMD5])) {
1485 $setupArr = $this->docHandler[$currentDocFromHandlerMD5];
1487 $setupArr = reset($this->docHandler);
1491 $retUrl = $sParts[
'path'] .
'?' . $setupArr[2] .
'&returnUrl=' . rawurlencode(
$retUrl);
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static readPageAccess($id, $perms_clause)
static getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *')
static getModTSconfig($id, $TSref)
setDocument($currentDocFromHandlerMD5='', $retUrl='alt_doc_nodoc.php')
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
editRegularContentFromId()
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static quoteJSvalue($value)
static canBeInterpretedAsInteger($var)
static getIndpEnv($getEnvName)
languageSwitch($table, $uid, $pid=NULL)
static getUrlToken($formName='securityToken', $tokenName='formToken')
static makeInstance($className)
$editRegularContentFromId
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static isRootLevelRestrictionIgnored($table)
static compileSelectedGetVarsFromArray($varList, array $getArray, $GPvarAlt=TRUE)
getNewIconMode($table, $key='saveDocNew')
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
static versioningPlaceholderClause($table)
getRecordForEdit($table, $theUid)
static isRecordLocked($table, $uid)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static setUpdateSignal($set='', $params='')
fixWSversioningInEditConf($mapArray=FALSE)
emitFunctionAfterSignal($signalName)
getSignalSlotDispatcher()
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
static fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch=FALSE)
static sanitizeLocalUrl($url='')
static getLiveVersionOfRecord($table, $uid, $fields=' *')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)
localizationRedirect($justLocalized)
static deleteClause($table, $tableAlias='')