Index: typo3/wizard_rte.php =================================================================== --- typo3/wizard_rte.php (revision 3994) +++ typo3/wizard_rte.php (working copy) @@ -102,8 +102,6 @@ * @return void */ function init() { - global $BACK_PATH; - // Setting GPvars: $this->P = t3lib_div::_GP('P'); $this->popView = t3lib_div::_GP('popView'); @@ -112,11 +110,11 @@ $this->MCONF['name']='xMOD_wizard_rte.php'; // Starting the document template object: - $this->doc = t3lib_div::makeInstance('mediumDoc'); + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->backPath = $GLOBALS['BACK_PATH']; + $this->doc->setModuleTemplate('templates/wizard_rte.html'); $this->doc->divClass = ''; // Need to NOT have the page wrapped in DIV since if we do that we destroy the feature that the RTE spans the whole height of the page!!! $this->doc->form='
'; - $this->doc->backPath = $BACK_PATH; - } /** @@ -153,10 +151,6 @@ '.($this->popView ? t3lib_BEfunc::viewOnClick($rawRec['pid'],'',t3lib_BEfunc::BEgetRootLine($rawRec['pid'])) : '').' '); - // Create page HTML header: - $this->content.=$this->doc->startPage(''); - - // Initialize TCeforms - for rendering the field: $tceforms = t3lib_div::makeInstance('t3lib_TCEforms'); $tceforms->initDefaultBEMode(); // Init... @@ -167,7 +161,6 @@ $RTEobj = &t3lib_BEfunc::RTEgetObj(); // Getting reference to the RTE object used to render the field! if ($RTEobj->ID == 'rte') { $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;'; // SPECIAL: Setting style for the RTE
layer containing the IFRAME - # $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:600px; width:100%; border:solid 0px;'; // SPECIAL: Setting style for the RTE
layer containing the IFRAME } // Fetching content of record: @@ -181,60 +174,6 @@ $rec['uid'] = $this->P['uid']; $rec['pid'] = $rawRec['pid']; - // Making the toolbar: - $closeUrl = $this->P['returnUrl']; - $R_URI=t3lib_div::linkThisScript(array('popView'=>'')); - - // Getting settings for the undo button: - $undoButton = 0; - $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->P['table'], 'sys_history').' AND recuid='.intval($this->P['uid']), '', 'tstamp DESC', '1'); - if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) { - $undoButton = 1; - } - - // ShortCut - if ($BE_USER->mayMakeShortcut()) { - $sCut = $this->doc->makeShortcutIcon('P','',$this->MCONF['name'],1); - } else { - $sCut =''; - } - - - // Make Toolbar of buttons: - $toolBarButtons=array(); - - // Save: - $toolBarButtons[]= - ''. - 'doc->backPath,'gfx/savedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'" alt="" />'. - ''; - - // Save/View: - if (t3lib_extMgm::isLoaded('cms')) { - $toolBarButtons[]= - ''. - 'doc->backPath,'gfx/savedokshow.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow',1).'" alt="" />'. - ''; - } - // Save/Close: - $toolBarButtons[] = 'doc->backPath,'gfx/saveandclosedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc',1).'" />'; - // Close: - $toolBarButtons[]= - ''. - 'doc->backPath,'gfx/closedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc',1).'" alt="" />'. - ''; - - // Undo/Revert: - if ($undoButton) { - $toolBarButtons[]= - ''. - 'doc->backPath,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('rte_undoLastChange'),t3lib_BEfunc::calcAge(time()-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'. - ''; - } - - $panel = ''.implode('',$toolBarButtons).''; - - // TSconfig, setting width: $fieldTSConfig = $tceforms->setTSconfig($this->P['table'],$rec,$this->P['field']); if (strcmp($fieldTSConfig['RTEfullScreenWidth'],'')) { @@ -253,11 +192,6 @@ --> - - - - - @@ -275,10 +209,19 @@ $tceforms->printNeededJSFunctions(); } else { // ERROR: - $this->content.=$this->doc->startPage(''); $this->content.=$this->doc->section($LANG->getLL('forms_title'),''.$LANG->getLL('table_noData',1).'',0,1); } + // Setting up the buttons and markers for docheader + $docHeaderButtons = $this->getButtons(); + $markers['CONTENT'] = $this->content; + + // Build the for the module + $this->content = $this->doc->startPage(''); + $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); + $this->content.= $this->doc->endPage(); + $this->content = $this->doc->insertStylesAndJS($this->content); + } /** @@ -293,6 +236,68 @@ } /** + * Create the panel of buttons for submitting the form or otherwise perform operations. + * + * @return array all available buttons as an assoc. array + */ + protected function getButtons() { + $buttons = array( + 'close' => '', + 'save' => '', + 'save_view' => '', + 'save_close' => '', + 'shortcut' => '', + 'undo' => '', + ); + + if ($this->P['table'] && $this->P['field'] && $this->P['uid'] && $this->checkEditAccess($this->P['table'],$this->P['uid'])) { + $closeUrl = $this->P['returnUrl']; + $R_URI=t3lib_div::linkThisScript(array('popView' => '')); + + // Getting settings for the undo button: + $undoButton = 0; + $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->P['table'], 'sys_history') . ' AND recuid=' . intval($this->P['uid']), '', 'tstamp DESC', '1'); + if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) { + $undoButton = 1; + } + + // Close + $buttons['close'] = '' . + 'doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" />' . + ''; + + // Save + $buttons['save'] = '' . + 'doc->backPath, 'gfx/savedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" alt="" />' . + ''; + + // Save & View + if (t3lib_extMgm::isLoaded('cms')) { + $buttons['save_view'] = '' . + 'doc->backPath, 'gfx/savedokshow.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" alt="" />' . + ''; + } + + // Save & Close + $buttons['save_close'] = 'doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />'; + + // Undo/Revert: + if ($undoButton) { + $buttons['undo'] = '' . + 'doc->backPath, 'gfx/undo.gif') . ' class="c-inputButton" title="' . htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge(time() - $undoButtonR['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' . + ''; + } + + // Shortcut + if ($GLOBALS['BE_USER']->mayMakeShortcut()) { + $buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1); + } + } + + return $buttons; + } + + /** * Checks access for element * * @param string Table name Index: typo3/stylesheet.css =================================================================== --- typo3/stylesheet.css (revision 3994) +++ typo3/stylesheet.css (working copy) @@ -195,6 +195,7 @@ body#typo3-mod-user-ws-workspaceforms-php, body#typo3-mod-php, body#typo3-mod-tools-em-index-php, +body#typo3-wizard-rte-php, body#typo3-pagetree, body#typo3-db-new-php, body#typo3-move-el-php, Index: typo3/templates/wizard_rte.html =================================================================== --- typo3/templates/wizard_rte.html (revision 0) +++ typo3/templates/wizard_rte.html (revision 0) @@ -0,0 +1,37 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
+
+
+
+ +
+
+ ###CONTENT### +
+
+
+ + + + + +
###BUTTONS###
+ + + +###CLOSE### +###SAVE######SAVE_VIEW######SAVE_CLOSE### +###UNDO### + + + +###SHORTCUT### +
'.$panel.''.$sCut.'
'.$formContent.'