RFC #7503: Docheaders: Module Admin tools > Ext Manager: No docheader
authorPatrick Broens <patrick@netcreators.com>
Sun, 17 Feb 2008 14:57:05 +0000 (14:57 +0000)
committerPatrick Broens <patrick@netcreators.com>
Sun, 17 Feb 2008 14:57:05 +0000 (14:57 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3193 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/mod/tools/em/class.em_index.php
typo3/stylesheet.css
typo3/templates/em_index.html [new file with mode: 0644]

index c290ba1..c81ee26 100644 (file)
@@ -402,9 +402,10 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                $this->xmlhandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
 
                        // Initialize Document Template object:
-               $this->doc = t3lib_div::makeInstance('noDoc');
+               $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
-               $this->doc->docType = 'xhtml_trans';
+               $this->doc->setModuleTemplate('templates/em_index.html');                       
+               $this->doc->docType='xhtml_trans';
 
                        // JavaScript
                $this->doc->JScode = $this->doc->wrapScriptTags('
@@ -555,7 +556,6 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                if (empty($this->MOD_SETTINGS['mirrorListURL'])) $this->MOD_SETTINGS['mirrorListURL'] = $TYPO3_CONF_VARS['EXT']['em_mirrorListURL'];
 
                // Starting page:
-               $this->content.=$this->doc->startPage('Extension Manager');
                $this->content.=$this->doc->header('Extension Manager');
                $this->content.=$this->doc->spacer(5);
 
@@ -575,10 +575,6 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                } elseif ($this->CMD['importExtInfo'])  {       // Gets detailed information of an extension from online rep.
                        $this->importExtInfo($this->CMD['importExtInfo'],$this->CMD['extVersion']);
                } else {        // No command - we show what the menu setting tells us:
-
-                       $menu = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.menu').' '.
-                       t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']);
-
                        if (t3lib_div::inList('0,1,2',$this->MOD_SETTINGS['function'])) {
                                $menu.='&nbsp;Group by:&nbsp;'.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
                                '&nbsp;&nbsp;Show:&nbsp;'.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
@@ -626,11 +622,20 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                        break;
                        }
                }
-
-               // Shortcuts:
-               if ($BE_USER->mayMakeShortcut())        {
-                       $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('CMD','function',$this->MCONF['name']));
-               }
+               
+                       // Setting up the buttons and markers for docheader
+               $docHeaderButtons = $this->getButtons();
+               $markers = array(
+                       'CSH' => $docHeaderButtons['csh'],
+                       'FUNC_MENU' => $this->getFuncMenu(),
+                       'CONTENT' => $this->content
+               );      
+
+                       // Build the <body> for the module
+               $this->content = $this->doc->startPage('Extension Manager');
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
@@ -640,12 +645,51 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
         */
        function printContent() {
                if ($this->doPrintContent) {
-                       $this->content.= $this->doc->endPage();
                        echo $this->content;
                }
        }
+       
+       /**
+        * Create the function menu
+        *
+        * @return      string  HTML of the function menu
+        */
+       private function getFuncMenu() {
+               $funcMenu = '';
+               if(!$this->CMD['showExt'] && !$this->CMD['requestInstallExtensions'] && !$this->CMD['importExt'] && !$this->CMD['uploadExt'] && !$this->CMD['importExtInfo']) {
+                       $funcMenu = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
+               } elseif($this->CMD['showExt'] && (!$this->CMD['standAlone'] && !t3lib_div::_GP('standAlone'))) {
+                       $funcMenu = t3lib_BEfunc::getFuncMenu(0, 'SET[singleDetails]', $this->MOD_SETTINGS['singleDetails'], $this->MOD_MENU['singleDetails'], '', '&CMD[showExt]=' . $this->CMD['showExt']);
+               }
+               return $funcMenu;       
+       }
 
-
+       /**
+        * 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()   {
+               
+               $buttons = array(
+                       'csh' => '',
+                       'back' => '',
+                       'shortcut' => ''
+               );
+                       // CSH
+               //$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']);
+               
+                       // Shortcut
+               if ($GLOBALS['BE_USER']->mayMakeShortcut())     {
+                       $buttons['shortcut'] = $this->doc->makeShortcutIcon('CMD','function',$this->MCONF['name']);
+               }
+                       // Back
+               if(($this->CMD['showExt'] && (!$this->CMD['standAlone'] && !t3lib_div::_GP('standAlone'))) || ($this->CMD['importExt'] || $this->CMD['uploadExt'] && (!$this->CMD['standAlone'])) || $this->CMD['importExtInfo']) {
+                       $buttons['back'] = '<a href="index.php" class="typo3-goBack"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/goback.gif') . ' title="Go back" class="absmiddle" alt="" /></a>';
+               }
+       
+               return $buttons;
+       }
 
 
 
@@ -1408,9 +1452,6 @@ EXTENSION KEYS:
         */
        function importExtInfo($extKey, $version='')    {
 
-                       // "Go back" link
-               $content = '<a href="index.php" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/goback.gif','width="14" height="14"').' alt="" /> Go back</a>';
-               $this->content.= $this->doc->section('',$content);
                $content = '';
 
                        // Fetch remote data:
@@ -1840,7 +1881,6 @@ EXTENSION KEYS:
 
                                                                                                // Install / Uninstall:
                                                                                        if(!$this->CMD['standAlone']) {
-                                                                                               $content = '<a href="index.php" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/goback.gif','width="14" height="14"').' alt="" /> Go back</a><br />'.$content;
                                                                                                $content.='<h3>Install / Uninstall Extension:</h3>';
                                                                                                $content.= $new_list[$extKey] ?
                                                                                                        '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().' Uninstall extension</a>' :
@@ -1897,16 +1937,8 @@ EXTENSION KEYS:
 
                        // Function menu here:
                if(!$this->CMD['standAlone'] && !t3lib_div::_GP('standAlone')) {
-                       $content = '
-                               <table border="0" cellpadding="0" cellspacing="0" width="100%">
-                                       <tr>
-                                               <td nowrap="nowrap">Extension:&nbsp;<strong>'.$this->extensionTitleIconHeader($extKey,$list[$extKey]).'</strong> ('.$extKey.')</td>
-                                               <td align="right" nowrap="nowrap">'.
-                       t3lib_BEfunc::getFuncMenu(0,'SET[singleDetails]',$this->MOD_SETTINGS['singleDetails'],$this->MOD_MENU['singleDetails'],'','&CMD[showExt]='.$extKey).' &nbsp; &nbsp; '.
-                       '<a href="index.php" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/goback.gif','width="14" height="14"').' class="absmiddle" alt="" /> Go back</a></td>
-                                       </tr>
-                               </table>';
-                       $this->content.=$this->doc->section('',$content);
+                       $content = 'Extension:&nbsp;<strong>' . $this->extensionTitleIconHeader($extKey, $list[$extKey]) . '</strong> (' . $extKey . ')';
+                       $this->content.= $this->doc->section('', $content);
                }
 
                        // Show extension details:
index 636b4e3..b06cb95 100755 (executable)
@@ -126,7 +126,7 @@ BODY#typo3-alt-toplogo-php, BODY#typo3-alt-menu-sel-php, BODY#typo3-alt-topmenu-
        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, body#ext-setup-mod-index-php, body#typo3-mod-user-ws-index-php, body#typo3-mod-user-ws-workspaceforms-php, body#typo3-mod-php, body#ext-tsconfig-help-mod1-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#ext-setup-mod-index-php, body#typo3-mod-user-ws-index-php, body#typo3-mod-user-ws-workspaceforms-php, body#typo3-mod-php, body#ext-tsconfig-help-mod1-index-php, body#typo3-mod-tools-em-index-php { padding: 0; margin: 0; overflow: hidden; height: 100%; }
 
 
 /****************************************
diff --git a/typo3/templates/em_index.html b/typo3/templates/em_index.html
new file mode 100644 (file)
index 0000000..f213ecf
--- /dev/null
@@ -0,0 +1,33 @@
+<!-- ###FULLDOC### begin -->\r
+<div class="typo3-fullDoc">\r
+       <!-- Page header with buttons, path details and csh -->\r
+       <div id="typo3-docheader">\r
+               <div id="typo3-docheader-row1">\r
+                       <div class="buttonsleft">###BUTTONLIST_LEFT###</div>\r
+                       <div class="buttonsright">###BUTTONLIST_RIGHT######FUNC_MENU###</div>\r
+               </div>\r
+               <div id="typo3-docheader-row2">\r
+                       <div class="pagepath"></div>\r
+                       <div class="infooptions"></div>\r
+               </div>\r
+       </div>\r
+       <!-- Content of module, for instance listing, info or editing -->\r
+       <div id="typo3-docbody">\r
+               ###CONTENT###\r
+       </div>\r
+</div>\r
+<!-- ###FULLDOC### end -->\r
+\r
+<!-- Grouping the icons on top -->\r
+\r
+<!-- ###BUTTON_GROUP_WRAP### -->\r
+       <div class="buttongroup">###BUTTONS###</div>\r
+<!-- ###BUTTON_GROUP_WRAP### -->\r
+\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+<!-- ###BUTTON_GROUP1### -->###BACK###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###BUTTON_GROUP1### -->###SHORTCUT###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r