Index: mod1/class.tx_templavoila_mod1_localization.php =================================================================== --- mod1/class.tx_templavoila_mod1_localization.php (revision 31917) +++ mod1/class.tx_templavoila_mod1_localization.php (working copy) @@ -81,7 +81,7 @@ 'sidebar_renderItem', $LANG->getLL('localization', 1), 60, - true + false ); } Index: mod1/class.tx_templavoila_mod1_sidebar.php =================================================================== --- mod1/class.tx_templavoila_mod1_sidebar.php (revision 31917) +++ mod1/class.tx_templavoila_mod1_sidebar.php (working copy) @@ -221,7 +221,7 @@ $sideBar = ' -
+
'.$this->doc->getDynTabMenu($numSortedSideBarItems, 'TEMPLAVOILA:pagemodule:sidebar', 1, FALSE, 100, 0, TRUE).'
Index: mod1/index.php =================================================================== --- mod1/index.php (revision 31917) +++ mod1/index.php (working copy) @@ -237,6 +237,11 @@ // Initialize the record module $this->recordsObj =& t3lib_div::getUserObj ('&tx_templavoila_mod1_records',''); $this->recordsObj->init($this); + // Add the localization module if localization is enabled: + if ($this->alternativeLanguagesDefined()) { + $this->localizationObj =& t3lib_div::getUserObj ('&tx_templavoila_mod1_localization',''); + $this->localizationObj->init($this); + } } /** @@ -359,9 +364,16 @@ } // Draw the header. - $this->doc = t3lib_div::makeInstance('noDoc'); + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->backPath = $BACK_PATH; + if (t3lib_div::compat_version('4.3')) { + $this->doc->setModuleTemplate('EXT:templavoila/resources/templates/mod1_default.html'); + } else { + $this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('templavoila') . 'resources/templates/mod1_default.html'); + } $this->doc->docType= 'xhtml_trans'; - $this->doc->backPath = $BACK_PATH; + + $this->doc->bodyTagId = 'typo3-mod-php'; $this->doc->divClass = ''; $this->doc->form='
'; @@ -554,25 +566,11 @@ $this->render_editPageScreen(); echo $this->render_sidebar(); exit; - } - - // Show the "edit current page" screen along with the sidebar - $shortCut = ($BE_USER->mayMakeShortcut() ? '

'.$this->doc->makeShortcutIcon('id,altRoot',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']) : ''); - if ($this->sideBarObj->position == 'left' && $this->modTSconfig['properties']['sideBarEnable']) { - $this->content .= ' - - - - - -
'.$this->render_sidebar().''.$editCurrentPageHTML.$shortCut;'
- '; - } else { - $sideBarTop = $this->modTSconfig['properties']['sideBarEnable'] && ($this->sideBarObj->position == 'toprows' || $this->sideBarObj->position == 'toptabs') ? $this->render_sidebar() : ''; - $this->content .= $sideBarTop.$editCurrentPageHTML.$shortCut; } - // Create sortables + $this->content .= $editCurrentPageHTML; + + // Create sortables if (is_array($this->sortableContainers)) { $script = ''; if (t3lib_div::compat_version ('4.3')) { @@ -597,11 +595,17 @@ } } else { // No access or no current page uid: - - $this->doc = t3lib_div::makeInstance('mediumDoc'); + $this->doc = t3lib_div::makeInstance('template'); + $this->doc->backPath = $BACK_PATH; + if (t3lib_div::compat_version('4.3')) { + $this->doc->setModuleTemplate('EXT:templavoila/resources/templates/mod1_noaccess.html'); + } else { + $this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('templavoila') . 'resources/templates/mod1_noaccess.html'); + } $this->doc->docType= 'xhtml_trans'; - $this->doc->backPath = $BACK_PATH; + $this->doc->bodyTagId = 'typo3-mod-php'; + $cmd = t3lib_div::_GP ('cmd'); switch ($cmd) { @@ -617,8 +621,18 @@ $this->content.=$LANG->getLL('default_introduction'); } } - $this->content = $this->doc->startPage($LANG->getLL('title')) . $this->content; - $this->content.=$this->doc->endPage(); + + // Place content inside template + $content = $this->doc->startPage($GLOBALS['LANG']->getLL('title')); + $content .= $this->doc->moduleBody( + array(), + $this->getDocHeaderButtons(), + $this->getBodyMarkers() + ); + $content .= $this->doc->endPage(); + + // Replace content with templated content + $this->content = $content; } /** @@ -632,9 +646,136 @@ } + /************************* + * + * RENDERING UTILITIES + * + *************************/ + /** + * Gets the filled markers that are used in the HTML template. + * + * @return array The filled marker array + */ + protected function getBodyMarkers() { + $bodyMarkers = array( + 'TITLE' => $GLOBALS['LANG']->getLL('title'), + ); + if ($this->modTSconfig['properties']['sideBarEnable'] && $this->sideBarObj->position == 'left') { + $sidebarMode = 'SIDEBAR_LEFT'; + } elseif($this->modTSconfig['properties']['sideBarEnable']) { + $sidebarMode = 'SIDEBAR_TOP'; + } else { + $sidebarMode = 'SIDEBAR_DISABLED'; + } + + $editareaTpl = t3lib_parsehtml::getSubpart($this->doc->moduleTemplate, $sidebarMode); + if ($editareaTpl) { + $editareaMarkers = array( + 'TABROW' => $this->render_sidebar(), + 'CONTENT' => $this->content, + ); + $editareaContent = t3lib_parsehtml::substituteMarkerArray($editareaTpl, $editareaMarkers, '###|###', true); + + $bodyMarkers['EDITAREA'] = $editareaContent; + } else { + $bodyMarkers['CONTENT'] = $this->content; + } + return $bodyMarkers; + } + + /** + * Create the panel of buttons for submitting the form or otherwise perform operations. + * + * @param string Identifier for function of module + * @return array all available buttons as an assoc. array + */ + protected function getDocHeaderButtons() { + global $TCA, $LANG, $BACK_PATH, $BE_USER; + + $buttons = array( + 'csh' => '', + 'view' => '', + 'history_page' => '', + 'new_content' => '', + 'move_page' => '', + 'move_record' => '', + 'new_page' => '', + 'edit_page' => '', + 'record_list' => '', + 'shortcut' => '', + 'cache' => '' + ); + + // View page + $viewAddGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; + $buttons['view'] = '' . + '' . + ''; + + // Shortcut + if ($BE_USER->mayMakeShortcut()) { + $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); + } + + // If access to Web>List for user, then link to that module. + if ($BE_USER->check('modules','web_list')) { + $href = $BACK_PATH . 'db_list.php?id=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); + $buttons['record_list'] = '' . + '' . + ''; + } + + if (!$this->modTSconfig['properties']['disableIconToolbar']) { + + // Page history + $buttons['history_page'] = '' . + '' . + ''; + // New content element + $buttons['new_content'] = '' . + '' . + ''; + // Move page + $buttons['move_page'] = '' . + '' . + ''; + // Create new page (wizard) + $buttons['new_page'] = '' . + '' . + ''; + // Edit page properties + if (!$this->translatorMode && $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit')) { + $params='&edit[pages][' . $this->id . ']=edit'; + $buttons['edit_page'] = '' . + '' . + ''; + } + + $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagemodule', $BACK_PATH); + + } + + 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('', 'function', $this->MCONF['name']); + } + + return $result; + } + + /******************************************** * * Rendering functions @@ -667,12 +808,6 @@ $output .= '
doc->backPath,'gfx/goback.gif','').' title="'.htmlspecialchars($LANG->getLL ('goback')).'" alt="" />
'; } - // Add the localization module if localization is enabled: - if ($this->alternativeLanguagesDefined()) { - $this->localizationObj =& t3lib_div::getUserObj ('&tx_templavoila_mod1_localization',''); - $this->localizationObj->init($this); - } - // Hook for content at the very top (fx. a toolbar): if (is_array ($TYPO3_CONF_VARS['EXTCONF']['templavoila']['mod1']['renderTopToolbar'])) { foreach ($TYPO3_CONF_VARS['EXTCONF']['templavoila']['mod1']['renderTopToolbar'] as $_funcRef) { @@ -696,8 +831,6 @@ } } - $output .= t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagemodule', $this->doc->backPath,'
|' . $LANG->getLL('csh_whatisthetemplavoilapagemodule', 1)); - // show sys_notes include_once(PATH_typo3 . 'class.db_list.inc'); $sys_notes = recordList::showSysNotesForPage(); @@ -771,7 +904,6 @@ $elementBelongsToCurrentPage = $contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent; - $canEditPage = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit'); $canEditContent = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'editcontent'); $elementClass = 'tpm-container-element'; @@ -799,13 +931,7 @@ case 'pages' : $elementTitlebarClass = 'tpm-titlebar-page'; $elementClass .= ' pagecontainer'; - $titleBarLeftButtons .= $this->translatorMode || !$canEditPage ? '' : $this->link_edit('doc->backPath,'gfx/edit2.gif','').' title="'.htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')).'" alt="" />',$contentTreeArr['el']['table'],$contentTreeArr['el']['uid']); $titleBarRightButtons = ''; - - $addGetVars = ($this->currentLanguageUid?'&L='.$this->currentLanguageUid:''); - $viewPageOnClick = 'onclick= "'.htmlspecialchars(t3lib_BEfunc::viewOnClick($contentTreeArr['el']['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($contentTreeArr['el']['uid']),'','',$addGetVars)).'"'; - $viewPageIcon = 'doc->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.showPage',1).'" hspace="3" alt="" />'; - $titleBarLeftButtons .= ''.$viewPageIcon.''; break; case 'tt_content' : Index: resources/templates/mod1_default.html =================================================================== --- resources/templates/mod1_default.html (revision 0) +++ resources/templates/mod1_default.html (revision 0) @@ -0,0 +1,63 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+ + ###EDITAREA### +
+ + + + +
+
+ ###CONTENT### +
+
+ + + + +
+
+
###TABROW###
+
+
+ ###CONTENT### +
+
+ + + + +
+
+ + + + + +
###TABROW######CONTENT###
+
+
+ + + + + +
###BUTTONS###
+ + + +###CSH######NEW_PAGE######NEW_CONTENT### +###VIEW######EDIT_PAGE######MOVE_PAGE######HISTORY_PAGE### + + + +###RECORD_LIST######SHORTCUT### + Index: resources/templates/mod1_noaccess.html =================================================================== --- resources/templates/mod1_noaccess.html (revision 0) +++ resources/templates/mod1_noaccess.html (revision 0) @@ -0,0 +1,31 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
 
+
+
+ + ###CONTENT### +
+ + + + + +
###BUTTONS###
+ + + +###CSH### + + + + +###RECORD_LIST######SHORTCUT### +