Index: typo3/db_new.php =================================================================== --- typo3/db_new.php (revision 3159) +++ typo3/db_new.php (working copy) @@ -180,14 +180,17 @@ $this->pagesOnly = t3lib_div::_GP('pagesOnly'); // Create instance of template class for output - $this->doc = t3lib_div::makeInstance('mediumDoc'); + $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; + $this->doc->setModuleTemplate('templates/db_new.html'); $this->doc->docType= 'xhtml_trans'; $this->doc->JScode=''; + + // Setting up the context sensitive menu: + $this->doc->getContextMenuCode(); // Creating content $this->content=''; - $this->content.=$this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle')); $this->content.=$this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle')); // Id a positive id is supplied, ask for the page record with permission information contained: @@ -254,8 +257,16 @@ // Set header-HTML and return_url - $this->code = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'
- '; + if (is_array($this->pageinfo) && $this->pageinfo['uid']) { + $iconImgTag = t3lib_iconWorks::getIconImage('pages', $this->pageinfo, $this->backPath, 'title="' . htmlspecialchars($this->pageinfo['_thePath']) . '"'); + $title = strip_tags($this->pageinfo[$GLOBALS['TCA']['pages']['ctrl']['label']]); + } else { + $iconImgTag = 'backPath, 'gfx/i/_icon_website.gif') . ' title="' . htmlspecialchars($this->pageinfo['_thePath']) . '" alt="" />'; + $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']; + } + + $this->code = '' . $this->doc->wrapClickMenuOnIcon($iconImgTag, 'pages', $this->pageinfo['uid']) . htmlspecialchars(t3lib_div::fixed_lgd_cs($title, 45)) . '
'; + $this->R_URI = $this->returnUrl; // GENERATE the HTML-output depending on mode (pagesOnly is the page wizard) @@ -265,19 +276,81 @@ $this->pagesOnly(); } - // Create go-back link. - if ($this->R_URI) { - $this->code.='
- '. - 'doc->backPath,'gfx/goback.gif','width="14" height="14"').' alt="" />'. - $LANG->getLL('goBack',1). - ''; - } // Add all the content to an output section $this->content.=$this->doc->section('',$this->code); + + // 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($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle')); + $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); + $this->content.= $this->doc->endPage(); + $this->content = $this->doc->insertStylesAndJS($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; + + $buttons = array( + 'csh' => '', + 'back' => '', + 'view' => '', + 'new_page' => '', + 'record_list' => '' + ); + + + if (!$this->pagesOnly) { // Regular new element: + // New page + if ($this->showNewRecLink('pages')) { + $buttons['new_page'] = '' . + 'doc->backPath, 'gfx/new_page.gif') . ' alt="" />' . + ''; + } + // CSH + $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH']); + } elseif($this->showNewRecLink('pages')) { // Pages only wizard + // CSH + $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH']); + } + // Back + if ($this->R_URI) { + $buttons['back'] = '' . + 'doc->backPath, 'gfx/goback.gif') . ' alt="" />' . + ''; + } + + if (is_array($this->pageinfo) && $this->pageinfo['uid']) { + // View + $buttons['view'] = '' . + 'backPath, 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" alt="" />' . + ''; + + // Record list + if ($GLOBALS['BE_USER']->check('modules', 'web_list')) { + $href = $this->backPath . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); + $buttons['record_list'] = '' . + 'backPath, 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' . + ''; + } + } + + + + return $buttons; + } + /** * Creates the position map for pages wizard * @@ -291,9 +364,6 @@

'.htmlspecialchars($LANG->getLL('selectPosition')).':

'; $this->code.= $posMap->positionTree($this->id,$this->pageinfo,$this->perms_clause,$this->R_URI); - - // Add CSH: - $this->code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH'],'
'); } /** @@ -439,25 +509,6 @@ '.implode('',$tRows).' '; - - // Create a link to the new-pages wizard. - if ($this->showNewRecLink('pages')) { - $this->code.=' - - - - '; - } - - // Add CSH: - $this->code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH'],'
'); } /** @@ -466,8 +517,6 @@ * @return void */ function printContent() { - $this->content.= $this->doc->endPage(); - $this->content = $this->doc->insertStylesAndJS($this->content); echo $this->content; } Index: typo3/stylesheet.css =================================================================== --- typo3/stylesheet.css (revision 3159) +++ typo3/stylesheet.css (working copy) @@ -126,7 +126,7 @@ background-color: #9BA1A8; } -body#typo3-alt-doc-php, body#typo3-db-list-php, body#ext-cms-layout-db-layout-php, body#ext-tstemplate-ts-index-php, body#typo3-mod-web-perm-index-php, body#typo3-mod-web-info-index-php, body#typo3-mod-web-func-index-php, body#ext-version-cm1-index-php { padding: 0; margin: 0; overflow: hidden; height: 100%; } +body#typo3-alt-doc-php, body#typo3-db-list-php, body#ext-cms-layout-db-layout-php, body#ext-tstemplate-ts-index-php, body#typo3-mod-web-perm-index-php, body#typo3-mod-web-info-index-php, body#typo3-mod-web-func-index-php, body#ext-version-cm1-index-php, body#typo3-db-new-php { padding: 0; margin: 0; overflow: hidden; height: 100%; } /**************************************** Index: typo3/templates/db_new.html =================================================================== --- typo3/templates/db_new.html (revision 0) +++ typo3/templates/db_new.html (revision 0) @@ -0,0 +1,34 @@ + +
+ +
+
+
###BUTTONLIST_LEFT###
+
###BUTTONLIST_RIGHT###
+
+
+
###CSH######PAGEPATH###
+
###PAGEINFO###
+
+
+ +
+ ###CONTENT### +
+
+ + + + +
###BUTTONS###
+ + + +###BACK### +###NEW_PAGE### +###VIEW### + + + +###RECORD_LIST### + \ No newline at end of file