66 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_wizards.xlf');
77 protected function init() {
83 $this->MCONF[
'name'] =
'wizard_rte';
86 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
87 $this->doc->setModuleTemplate(
'EXT:backend/Resources/Private/Templates/wizard_rte.html');
90 $this->doc->divClass =
'';
91 $this->doc->form =
'<form action="tce_db.php" method="post" enctype="' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'form_enctype'] .
'" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
102 $this->P[
'uid'] = $versionRec[
'uid'];
105 if ($this->P[
'table'] && $this->P[
'field'] && $this->P[
'uid'] && $this->
checkEditAccess($this->P[
'table'], $this->P[
'uid'])) {
107 $rawRec = BackendUtility::getRecord($this->P[
'table'], $this->P[
'uid']);
111 $this->doc->JScodeArray[
'jumpToUrl'] =
' 112 function jumpToUrl(URL,formEl) { 113 if (document.editform) { 114 if (!TBE_EDITOR.isFormChanged()) { 115 window.location.href = URL; 117 if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1; 120 window.location.href = URL; 126 if ($this->popView) {
132 $tceforms->initDefaultBEMode();
134 $tceforms->disableWizards = 1;
136 $tceforms->colorScheme[0] = $this->doc->bgColor;
140 if ($RTEobj->ID ==
'rte') {
141 $RTEobj->RTEdivStyle =
'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';
145 $trData->lockRecords = 1;
146 $trData->fetchRecord($this->P[
'table'], $this->P[
'uid'],
'');
148 $rec = reset($trData->regTableItems_data);
149 $rec[
'uid'] = $this->P[
'uid'];
150 $rec[
'pid'] = $rawRec[
'pid'];
152 $fieldTSConfig = $tceforms->setTSconfig($this->P[
'table'], $rec, $this->P[
'field']);
153 if ((
string)$fieldTSConfig[
'RTEfullScreenWidth'] !==
'') {
154 $width = $fieldTSConfig[
'RTEfullScreenWidth'];
159 $formContent = $tceforms->getSoloField($this->P[
'table'], $rec, $this->P[
'field']);
166 <table border="0" cellpadding="0" cellspacing="0" width="' . $width .
'" id="typo3-rtewizard"> 168 <td width="' . $width .
'" colspan="2" id="c-formContent">' . $formContent .
'</td> 173 $formContent .=
'<input type="hidden" name="redirect" value="' . htmlspecialchars($this->R_URI) .
'" /> 176 $this->content .= $tceforms->printNeededJSFunctions_top() . $formContent . $tceforms->printNeededJSFunctions();
179 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'forms_title'),
'<span class="typo3-red">' .
$GLOBALS[
'LANG']->getLL(
'table_noData', TRUE) .
'</span>', 0, 1);
185 $this->content = $this->doc->startPage(
'');
186 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
187 $this->content .= $this->doc->endPage();
188 $this->content = $this->doc->insertStylesAndJS($this->content);
198 $this->content .= $this->doc->endPage();
199 $this->content = $this->doc->insertStylesAndJS($this->content);
217 if ($this->P[
'table'] && $this->P[
'field'] && $this->P[
'uid'] && $this->
checkEditAccess($this->P[
'table'], $this->P[
'uid'])) {
221 $undoRes =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'tstamp',
'sys_history',
'tablename=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->P[
'table'],
'sys_history') .
' AND recuid=' . (
int)$this->P[
'uid'],
'',
'tstamp DESC',
'1');
222 if ($undoButtonR =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($undoRes)) {
226 $buttons[
'close'] =
'<a href="#" onclick="' . htmlspecialchars(
'jumpToUrl(unescape(\'' . rawurlencode($closeUrl) .
'\'));
return false;
') . '" title="' . $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc
', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>'; 228 $buttons['save'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image
" name="_savedok
" class="c-inputButton
" src="clear.gif
" onclick="TBE_EDITOR.checkAndDoSubmit(1);
return false;
" title="' . $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc
', TRUE) . '" />')); 230 $buttons['save_view'] = IconUtility::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image
" class="c-inputButton
" name="_savedokview
" src="clear.gif
" onclick="' . htmlspecialchars('document.editform.redirect.value+=\
'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') .
'" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) .
'" />'));
232 $buttons[
'save_close'] =
IconUtility::getSpriteIcon(
'actions-document-save-close', array(
'html' =>
'<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" onclick="' . htmlspecialchars(
'document.editform.redirect.value=\'' . $closeUrl .
'\'; TBE_EDITOR.checkAndDoSubmit(1);
return false;
') . '" title="' . $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc
', TRUE) . '" />')); 235 $aOnClick = 'window.location.href=' . 236 GeneralUtility::quoteJSvalue( 237 BackendUtility::getModuleUrl( 240 'element' => $this->P['table'] . ':' . $this->P['uid'], 241 'revert' => 'field:' . $this->P['field'], 243 'returnUrl' => $this->R_URI, 246 ) . '; return false;'; 247 $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>'; 250 if ($GLOBALS['BE_USER']->mayMakeShortcut()) { 251 $buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1); 266 public function checkEditAccess($table, $uid) { 267 $calcPRec = BackendUtility::getRecord($table, $uid); 268 BackendUtility::fixVersioningPid($table, $calcPRec); 269 if (is_array($calcPRec)) { 271 if ($table == 'pages') { 272 $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($calcPRec); 273 $hasAccess = $CALC_PERMS & 2 ? TRUE : FALSE; 275 // Fetching pid-record first. 276 $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms(BackendUtility::getRecord('pages', $calcPRec['pid'])); 277 $hasAccess = $CALC_PERMS & 16 ? TRUE : FALSE; 279 // Check internals regarding access: 281 $hasAccess = $GLOBALS['BE_USER']->recordEditAccessInternals($table, $calcPRec);
static getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *')
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
checkEditAccess($table, $uid)
static makeInstance($className)
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static linkThisScript(array $getParams=array())
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch=FALSE)
static sanitizeLocalUrl($url='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]