7540: Docheaders: Wizard Move Element (move_el.php): No docheader
authorPatrick Broens <patrick@netcreators.com>
Mon, 3 Mar 2008 15:43:32 +0000 (15:43 +0000)
committerPatrick Broens <patrick@netcreators.com>
Mon, 3 Mar 2008 15:43:32 +0000 (15:43 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3360 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/move_el.php
typo3/stylesheet.css
typo3/templates/move_el.html [new file with mode: 0644]

index eb320c4..d2bdda4 100755 (executable)
@@ -269,14 +269,14 @@ class SC_move_el {
                $this->perms_clause = $BE_USER->getPagePermsClause(1);
 
                        // Starting the document template object:
-               $this->doc = t3lib_div::makeInstance('mediumDoc');
+               $this->doc = t3lib_div::makeInstance('template');
                $this->doc->docType= 'xhtml_trans';
                $this->doc->backPath = $BACK_PATH;
+               $this->doc->setModuleTemplate('templates/move_el.html');
                $this->doc->JScode='';
 
                        // Starting document content (header):
                $this->content='';
-               $this->content.=$this->doc->startPage($LANG->getLL('movingElement'));
                $this->content.=$this->doc->header($LANG->getLL('movingElement'));
                $this->content.=$this->doc->spacer(5);
        }
@@ -339,9 +339,6 @@ class SC_move_el {
 
                                                // Create the position tree:
                                        $code.= $posMap->positionTree($this->page_id,$pageinfo,$this->perms_clause,$this->R_URI);
-
-                                               // CSH for move-pages:
-                                       $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_pages', $GLOBALS['BACK_PATH'],'<br/>|');
                                }
                        }
 
@@ -397,20 +394,23 @@ class SC_move_el {
 
                                                // Create the position tree (for pages):
                                        $code.= $posMap->positionTree($this->page_id,$pageinfo,$this->perms_clause,$this->R_URI);
-
-                                               // CSH for move-content-elements:
-                                       $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_cs', $GLOBALS['BACK_PATH'],'<br/>|');
                                }
                        }
 
-                               // IF a return-url is given, print the go-back link:
-                       if ($this->R_URI)       {
-                               $code.='<br /><br /><a href="'.htmlspecialchars($this->R_URI).'" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/goback.gif','width="14" height="14"').' alt="" />'.$LANG->getLL('goBack',1).'</a>';
-                       }
-
                                // Add the $code content as a new section to the module:
                        $this->content.=$this->doc->section($LANG->getLL('selectPositionOfElement').':',$code,0,1);
                }
+               
+                       // Setting up the buttons and markers for docheader
+               $docHeaderButtons = $this->getButtons();
+               $markers['CSH'] = $docHeaderButtons['csh'];     
+               $markers['CONTENT'] = $this->content;
+               
+                       // Build the <body> for the module
+               $this->content = $this->doc->startPage($LANG->getLL('movingElement'));
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
@@ -419,10 +419,39 @@ class SC_move_el {
         * @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
+        */
+       private function getButtons()   {
+               global $LANG, $BACK_PATH;
+               
+               $buttons = array(
+                       'csh' => '',
+                       'back' => ''                    
+               );
+                       
+               if ($this->page_id)     {
+                       if ((string)$this->table == 'pages') {
+                                       // CSH
+                               $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_pages', $GLOBALS['BACK_PATH'], '');
+                       } elseif((string)$this->table == 'tt_content') {
+                                       // CSH
+                               $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_cs', $GLOBALS['BACK_PATH'], '');
+                       }
+                       
+                       if ($this->R_URI) {
+                                       // Back
+                               $buttons['back'] ='<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/goback.gif') . ' alt="" title="' . $LANG->getLL('goBack', 1) .'" /></a>';
+                       }
+               }
+               
+               return $buttons;
+       }
 }
 
 // Include extension?
@@ -446,4 +475,4 @@ $SOBE = t3lib_div::makeInstance('SC_move_el');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>
index ae9e8ca..3015b9a 100755 (executable)
@@ -143,7 +143,8 @@ body#typo3-mod-web-func-index-php,
 body#ext-version-cm1-index-php,
 body#typo3-pagetree,
 body#ext-cms-layout-db-new-content-el-php,
-body#typo3-db-new-php {
+body#typo3-db-new-php,
+body#typo3-move-el-php {
        padding: 0;
        margin: 0;
        overflow: hidden;
diff --git a/typo3/templates/move_el.html b/typo3/templates/move_el.html
new file mode 100644 (file)
index 0000000..42ba749
--- /dev/null
@@ -0,0 +1,30 @@
+<!-- ###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###</div>\r
+               </div>\r
+               <div id="typo3-docheader-row2">\r
+                       <div class="pagepath">###CSH###</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
+<!-- ###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_GROUPS_RIGHT### -->\r