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:
@@ -182,60 +177,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'],'')) {
@@ -254,11 +195,6 @@
-->
- '.$panel.'
- '.$sCut.'
-
-
-
'.$formContent.'
@@ -276,9 +212,17 @@
$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);
}
@@ -292,6 +236,67 @@
$this->content = $this->doc->insertStylesAndJS($this->content);
echo $this->content;
}
+
+ /**
+ * Create the panel of buttons for submitting the form or otherwise perform operations.
+ *
+ * @return array all available buttons as an assoc. array
+ */
+ private function getButtons() {
+ global $LANG, $BACK_PATH, $BE_USER;
+
+ $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="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" />' .
+ ' ';
+ // Save
+ $buttons['save'] = '' .
+ ' doc->backPath, 'gfx/savedok.gif') . ' class="c-inputButton" title="' . $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="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow', 1) . '" alt="" />' .
+ ' ';
+ }
+ // Save & Close
+ $buttons['save_close'] = ' doc->backPath, 'gfx/saveandclosedok.gif', '') . ' title="' . $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($LANG->getLL('rte_undoLastChange'), t3lib_BEfunc::calcAge(time() - $undoButtonR['tstamp'], $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))) . '" alt="" />' .
+ ' ';
+ }
+
+ // Shortcut
+ if ($BE_USER->mayMakeShortcut()) {
+ $buttons['shortcut'] = $this->doc->makeShortcutIcon('P', '', $this->MCONF['name'], 1);
+ }
+ }
+
+ return $buttons;
+ }
/**
* Checks access for element