From b4b76ee1e8695f7dff1540d458295203f0a5e70f Mon Sep 17 00:00:00 2001 From: Benni Mack Date: Mon, 15 Sep 2008 04:31:25 +0000 Subject: [PATCH] Fixed bug #7536: Docheaders: Wizard Table: No docheader (Thanks to Christian Kuhn and Steffen Kamper, initial fix by Patrick Broens) git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4123 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 1 + typo3/stylesheet.css | 1 + typo3/templates/wizard_forms.html | 72 ++++++++++++++++++++++++ typo3/wizard_forms.php | 93 +++++++++++++++++++------------ 4 files changed, 131 insertions(+), 36 deletions(-) create mode 100644 typo3/templates/wizard_forms.html diff --git a/ChangeLog b/ChangeLog index e6817aba484d..6d97e3b06746 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-09-14 Benjamin Mack + * Fixed bug #7536: Docheaders: Wizard Table: No docheader (Thanks to Christian Kuhn and Steffen Kamper, initial fix by Patrick Broens) * Updated NEWS.txt for #9167 * Followup to #9167: Mark extension as write protected: Option now called "excludeFromUpdates" * Fixed Bug #8621: Whitespace and CGL cleanup for class.tx_opendocs.php (Thanks to Stefano Kowalke) diff --git a/typo3/stylesheet.css b/typo3/stylesheet.css index 09a2bdbd4543..40302e55af56 100755 --- a/typo3/stylesheet.css +++ b/typo3/stylesheet.css @@ -200,6 +200,7 @@ body#typo3-pagetree, body#typo3-db-new-php, body#typo3-move-el-php, body#typo3-show-rechis-php, +body#typo3-wizard-forms-php, body#ext-cms-layout-db-layout-php, body#ext-tstemplate-ts-index-php, body#ext-version-cm1-index-php, diff --git a/typo3/templates/wizard_forms.html b/typo3/templates/wizard_forms.html new file mode 100644 index 000000000000..c33bea2a798b --- /dev/null +++ b/typo3/templates/wizard_forms.html @@ -0,0 +1,72 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
###CSH###
+
+
+
+ +
+
+ ###CONTENT### +
+
+
+ + + + + +
###BUTTONS###
+ + + +###CLOSE### +###SAVE######SAVE_CLOSE### + + + +###RELOAD### + + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
###CSH###
+
+
+
+ +
+
+ ###CONTENT### +
+
+
+ + + + + +
###BUTTONS###
+ + + +###CLOSE### +###SAVE######SAVE_CLOSE### + + + +###RELOAD### + diff --git a/typo3/wizard_forms.php b/typo3/wizard_forms.php index 7440204a2617..627772ff3a07 100755 --- a/typo3/wizard_forms.php +++ b/typo3/wizard_forms.php @@ -206,8 +206,6 @@ class SC_wizard_forms { * @return void */ function init() { - global $BACK_PATH; - // GPvars: $this->P = t3lib_div::_GP('P'); $this->special = t3lib_div::_GP('special'); @@ -217,8 +215,9 @@ class SC_wizard_forms { $this->xmlStorage = $this->P['params']['xmlOutput']; // Document template object: - $this->doc = t3lib_div::makeInstance('mediumDoc'); - $this->doc->backPath = $BACK_PATH; + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->backPath = $GLOBALS['BACK_PATH']; + $this->doc->setModuleTemplate('templates/wizard_forms.html'); $this->doc->JScode=$this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // window.location.href = URL; @@ -229,9 +228,6 @@ class SC_wizard_forms { list($rUri) = explode('#',t3lib_div::getIndpEnv('REQUEST_URI')); $this->doc->form ='
'; - // Start page: - $this->content=$this->doc->startPage('Form Wizard'); - // If save command found, include tcemain: if ($_POST['savedok_x'] || $_POST['saveandclosedok_x']) { $this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php'; @@ -244,13 +240,22 @@ class SC_wizard_forms { * @return void */ function main() { - global $LANG; - if ($this->P['table'] && $this->P['field'] && $this->P['uid']) { - $this->content.=$this->doc->section($LANG->getLL('forms_title'),$this->formsWizard(),0,1); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('forms_title'), $this->formsWizard(), 0, 1); } else { - $this->content.=$this->doc->section($LANG->getLL('forms_title'),''.$LANG->getLL('table_noData',1).'',0,1); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('forms_title'), '' . $GLOBALS['LANG']->getLL('table_noData',1) . '', 0, 1); } + + // Setting up the buttons and markers for docheader + $docHeaderButtons = $this->getButtons(); + $markers['CSH'] = $docHeaderButtons['csh']; + $markers['CONTENT'] = $this->content; + + // Build the for the module + $this->content = $this->doc->startPage('Form Wizard'); + $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); + $this->content.= $this->doc->endPage(); + $this->content = $this->doc->insertStylesAndJS($this->content); } /** @@ -259,11 +264,49 @@ class SC_wizard_forms { * @return void */ function printContent() { - $this->content.= $this->doc->endPage(); - $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 + */ + protected function getButtons() { + $buttons = array( + 'csh' => '', + 'csh_buttons' => '', + 'close' => '', + 'save' => '', + 'save_close' => '', + 'reload' => '', + ); + + if ($this->P['table'] && $this->P['field'] && $this->P['uid']) { + // CSH + $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz', $GLOBALS['BACK_PATH'], ''); + + // CSH Buttons + $buttons['csh_buttons'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons', $GLOBALS['BACK_PATH'], ''); + + // 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') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />'; + + // Save & Close + $buttons['save_close'] = 'doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" />'; + + // Reload + $buttons['reload'] = ''; + } + + return $buttons; + } + /** * Draws the form wizard content * @@ -272,7 +315,7 @@ class SC_wizard_forms { function formsWizard() { // First, check the references by selecting the record: - $row = t3lib_BEfunc::getRecord($this->P['table'],$this->P['uid']); + $row = t3lib_BEfunc::getRecord($this->P['table'],$this->P['uid']); if (!is_array($row)) { t3lib_BEfunc::typo3PrintError ('Wizard Error','No reference to record',0); exit; @@ -618,9 +661,6 @@ class SC_wizard_forms { $content = ''; - // Add CSH: - $content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz', $GLOBALS['BACK_PATH'],''); - // Implode all table rows into a string, wrapped in table tags. $content.= ' @@ -631,25 +671,6 @@ class SC_wizard_forms { '.implode('',$tRows).' '; - // Add saving buttons in the bottom: - $content.= ' - - -
'; - $content.= 'doc->backPath,'gfx/savedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'" />'; - $content.= 'doc->backPath,'gfx/saveandclosedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc',1).'" />'; - $content.= ''. - '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="" />'. - ''; - $content.= ''; - // Add CSH: - $content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons', $GLOBALS['BACK_PATH'],''); - $content.= ' -
- '; - // Add hidden fields: $content.= implode('',$hiddenFields); -- 2.20.1