Index: cm1/index.php =================================================================== --- cm1/index.php (revision 34698) +++ cm1/index.php (working copy) @@ -378,13 +378,20 @@ class tx_templavoila_cm1 extends t3lib_SCbase { function main_mode() { global $LANG, $BACK_PATH; - // Draw the header. - $this->doc = t3lib_div::makeInstance('noDoc'); + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->docType= 'xhtml_trans'; $this->doc->backPath = $BACK_PATH; - $this->doc->docType = 'xhtml_trans'; + if(version_compare(TYPO3_version,'4.3','>')) { + $this->doc->setModuleTemplate('EXT:templavoila/resources/templates/cm1_default.html'); + } else { + $this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('templavoila') . 'resources/templates/cm1_default.html'); + } + $this->doc->bodyTagId = 'typo3-mod-php'; + $this->doc->divClass = ''; + $this->doc->inDocStylesArray[]=' - DIV.typo3-noDoc { width: 98%; margin: 0 0 0 0; } - DIV.typo3-noDoc H2 { width: 100%; } + #templavoila-frame-visual { height:500px; display:block; margin:0 5px; width:98%; border: 1xpx solid black;} + DIV.typo3-fullDoc H2 { width: 100%; } TABLE#c-mapInfo {margin-top: 10px; margin-bottom: 5px; } TABLE#c-mapInfo TR TD {padding-right: 20px;} select option.pagetemplate {background-image:url(../icon_pagetemplate.gif);background-repeat: no-repeat; background-position: 5px 50%; padding: 1px 0 3px 24px; -webkit-background-size: 0;} @@ -449,17 +456,6 @@ class tx_templavoila_cm1 extends t3lib_SCbase { $this->doc->JScode.=$CMparts[0]; $this->doc->postCode.= $CMparts[2]; - $this->content.=$this->doc->startPage($LANG->getLL('title')); - $this->content.=$this->doc->header($LANG->getLL('title')); - $this->content.=$this->doc->spacer(5); - - if ($this->returnUrl) { - $this->content.=''. - 'doc->backPath,'gfx/goback.gif','width="14" height="14"').' alt="" />'. - $LANG->sL('LLL:EXT:lang/locallang_misc.xml:goBack',1). - '
'; - } - // Icons $this->dsTypes = array( 'sc' => $LANG->getLL('dsTypes_section') . ': ', @@ -494,6 +490,65 @@ class tx_templavoila_cm1 extends t3lib_SCbase { // Add spacer: $this->content.=$this->doc->spacer(10); + + $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause); + $docHeaderButtons = $this->getDocHeaderButtons(); + $docContent = array( + 'CSH' => $docHeaderButtons['csh'], + 'CONTENT' => $this->content + ); + + $content = $this->doc->startPage($GLOBALS['LANG']->getLL('title')); + $content .= $this->doc->moduleBody( + $this->pageinfo, + $docHeaderButtons, + $docContent + ); + $content .= $this->doc->endPage(); + + // Replace content with templated content + $this->content = $content; + } + + /** + * Gets the buttons that shall be rendered in the docHeader. + * + * @return array Available buttons for the docHeader + */ + protected function getDocHeaderButtons() { + $buttons = array( + 'csh' => t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaCM1', '', $this->backPath), + 'back' => '', + 'shortcut' => $this->getShortcutButton(), + ); + + // Back + if ($this->returnUrl) { + if(version_compare(TYPO3_version,'4.4','>')) { + $backIcon = t3lib_iconWorks::getSpriteIcon('actions-view-go-back'); + } else { + $backIcon = 'doc->backPath,'gfx/goback.gif','width="14" height="14"') . ' alt="" />'; + } + + $buttons['back'] = '' . + $backIcon . + ''; + } + return $buttons; + } + + /** + * Gets the button to set a new shortcut in the backend (if current user is allowed to). + * + * @return string HTML representiation of the shortcut button + */ + protected function getShortcutButton() { + $result = ''; + if ($GLOBALS['BE_USER']->mayMakeShortcut()) { + $result = $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); + } + + return $result; } /** @@ -2322,6 +2377,7 @@ class tx_templavoila_cm1 extends t3lib_SCbase { */ function linkThisScript($array=array()) { $theArray=array( + 'id' => $this->id, // id of the current sysfolder 'file' => $this->displayFile, 'table' => $this->displayTable, 'uid' => $this->displayUid, @@ -2350,7 +2406,7 @@ class tx_templavoila_cm1 extends t3lib_SCbase { '&path='.rawurlencode($path). '&preview='.($preview?1:0). ($showOnly?'&show=1':'&limitTags='.rawurlencode($limitTags)); - return ''; + return ''; } /** Index: cm1/locallang.xml =================================================================== --- cm1/locallang.xml (revision 34698) +++ cm1/locallang.xml (working copy) @@ -15,7 +15,7 @@ - + Index: mod2/index.php =================================================================== --- mod2/index.php (revision 34698) +++ mod2/index.php (working copy) @@ -159,14 +159,21 @@ class tx_templavoila_module2 extends t3lib_SCbase { $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; - if ($access) { + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->docType= 'xhtml_trans'; + $this->doc->backPath = $BACK_PATH; + if (version_compare(TYPO3_version,'4.3','>')) { + $this->doc->setModuleTemplate('EXT:templavoila/resources/templates/mod2_default.html'); + } else { + $this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('templavoila') . 'resources/templates/mod2_default.html'); + } + $this->doc->bodyTagId = 'typo3-mod-php'; + $this->doc->divClass = ''; + $this->doc->form='
'; + + if ($access) { // Draw the header. - $this->doc = t3lib_div::makeInstance('noDoc'); - $this->doc->docType= 'xhtml_trans'; - $this->doc->backPath = $BACK_PATH; - $this->doc->divClass = ''; - $this->doc->form=''; // Add custom styles $this->doc->styleSheetFile2 = t3lib_extMgm::extRelPath($this->extKey)."mod2/styles.css"; @@ -190,31 +197,38 @@ class tx_templavoila_module2 extends t3lib_SCbase { } ').$this->doc->getDynTabMenuJScode(); + $this->renderModuleContent(); + // Setting up support for context menus (when clicking the items icon) $CMparts = $this->doc->getContextMenuCode(); $this->doc->bodyTagAdditions = $CMparts[1]; $this->doc->JScode.= $CMparts[0]; $this->doc->postCode.= $CMparts[2]; - $this->content.=$this->doc->startPage($LANG->getLL('title')); - - // Rendering module content - $this->renderModuleContent(); - - if ($BE_USER->mayMakeShortcut()) { - $this->content.='

'.$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']); + } else { + if (version_compare(TYPO3_version, '4.3', '>')) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('noaccess'), + '', + t3lib_FlashMessage::ERROR + ); + $this->content = $flashMessage->render(); + } else { + $this->content = '' . $GLOBALS['LANG']->getLL('error') . ' ' . $GLOBALS['LANG']->getLL('noaccess'); } - } else { // No access or no current uid: - - // Draw the header. - $this->doc = t3lib_div::makeInstance('noDoc'); - $this->doc->docType= 'xhtml_trans'; - $this->doc->backPath = $BACK_PATH; - $this->doc->divClass = ''; - $this->doc->form=''; - $this->content.=$this->doc->startPage($LANG->getLL('title')); } - $this->content.=$this->doc->endPage(); + // Place content inside template + $content = $this->doc->startPage($GLOBALS['LANG']->getLL('title')); + $content .= $this->doc->moduleBody( + $this->pageinfo, + $this->getDocHeaderButtons(), + array('CONTENT' => $this->content) + ); + $content .= $this->doc->endPage(); + + // Replace content with templated content + $this->content = $content; } /** @@ -227,7 +241,32 @@ class tx_templavoila_module2 extends t3lib_SCbase { } + /** + * Gets the buttons that shall be rendered in the docHeader. + * + * @return array Available buttons for the docHeader + */ + protected function getDocHeaderButtons() { + $buttons = array( + 'csh' => t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM2', '', $this->backPath), + 'shortcut' => $this->getShortcutButton(), + ); + return $buttons; + } + + /** + * Gets the button to set a new shortcut in the backend (if current user is allowed to). + * + * @return string HTML representiation of the shortcut button + */ + protected function getShortcutButton() { + $result = ''; + if ($GLOBALS['BE_USER']->mayMakeShortcut()) { + $result = $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); + } + return $result; + } @@ -632,7 +671,7 @@ class tx_templavoila_module2 extends t3lib_SCbase { // Links: $editLink = $lpXML.= 'doc->backPath,'gfx/edit2.gif','width="11" height="12"').' alt="" class="absmiddle" />'; - $dsTitle = '' . htmlspecialchars($GLOBALS['LANG']->sL($dsR['title'])) . ''; + $dsTitle = '' . htmlspecialchars($GLOBALS['LANG']->sL($dsR['title'])) . ''; if ($this->MOD_SETTINGS['set_details']) { $XMLinfo = $this->DSdetails($dsR['dataprot']); @@ -805,7 +844,7 @@ class tx_templavoila_module2 extends t3lib_SCbase { } // Mapping status / link: - $linkUrl = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$toObj['uid'].'&_reload_from=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); + $linkUrl = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$toObj['uid'].'&_reload_from=1&id=' . $this->id . '&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); $fileReference = t3lib_div::getFileAbsFileName($toObj['fileref']); if (@is_file($fileReference)) { @@ -2076,7 +2115,7 @@ class tx_templavoila_module2 extends t3lib_SCbase { // If a template Object id was found, continue with mapping: if ($this->wizardData['templateObjectId']) { - $url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$this->wizardData['templateObjectId'].'&SET[selectHeaderContent]=0&_reload_from=1&returnUrl='.rawurlencode('../mod2/index.php?SET[wiz_step]=4'); + $url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$this->wizardData['templateObjectId'].'&SET[selectHeaderContent]=0&_reload_from=1&id=' . $this->id . '&returnUrl='.rawurlencode('../mod2/index.php?SET[wiz_step]=4'); $outputString.= $GLOBALS['LANG']->getLL('newsitewizard_step3ready') . '
@@ -2097,7 +2136,7 @@ class tx_templavoila_module2 extends t3lib_SCbase { * @return void */ function wizard_step4() { - $url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$this->wizardData['templateObjectId'].'&SET[selectHeaderContent]=1&_reload_from=1&returnUrl='.rawurlencode('../mod2/index.php?SET[wiz_step]=5'); + $url = '../cm1/index.php?table=tx_templavoila_tmplobj&uid='.$this->wizardData['templateObjectId'].'&SET[selectHeaderContent]=1&_reload_from=1&id=' . $this->id . '&returnUrl='.rawurlencode('../mod2/index.php?SET[wiz_step]=5'); $outputString .= $GLOBALS['LANG']->getLL('newsitewizard_headerinclude') . '

Index: resources/templates/cm1_default.html new file mode 100644 =================================================================== --- resources/templates/cm1_default.html (revision 34698) +++ resources/templates/cm1_default.html (working copy) @@ -0,0 +1,35 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
###CSH###
+
###PAGEPATH######PAGEINFO###
+
+
+ +
+
+ ###CONTENT### +
+
+
+ + + + + +
###BUTTONS###
+ + + +###BACK### + + + +###SHORTCUT### + \ No newline at end of file Index: resources/templates/mod2_default.html new file mode 100644 =================================================================== --- resources/templates/mod2_default.html (revision 34698) +++ resources/templates/mod2_default.html (working copy) @@ -0,0 +1,35 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
 
+
###PAGEPATH######PAGEINFO###
+
+
+ +
+
+ ###CONTENT### +
+
+
+ + + + + +
###BUTTONS###
+ + + +
###CSH###
+ + + +###SHORTCUT### + \ No newline at end of file