7532: Docheaders: Wizard New Content Element (db_new_content_el.php): No docheader
authorPatrick Broens <patrick@netcreators.com>
Mon, 3 Mar 2008 15:36:21 +0000 (15:36 +0000)
committerPatrick Broens <patrick@netcreators.com>
Mon, 3 Mar 2008 15:36:21 +0000 (15:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3357 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/stylesheet.css
typo3/sysext/cms/layout/db_new_content_el.php
typo3/templates/db_new_content_el.html [new file with mode: 0644]

index b8f48d7..1950ac8 100755 (executable)
@@ -141,7 +141,8 @@ 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-pagetree {
+body#typo3-pagetree,
+body#ext-cms-layout-db-new-content-el-php {
        padding: 0;
        margin: 0;
        overflow: hidden;
index 5893076..010f357 100644 (file)
@@ -198,16 +198,20 @@ class SC_db_new_content_el {
                $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
 
                        // 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/db_new_content_el.html');
                $this->doc->JScode='';
                $this->doc->form='<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
 
+                       // Setting up the context sensitive menu:
+               $this->doc->getContextMenuCode();
+               
                        // Getting the current page and receiving access information (used in main())
                $perms_clause = $BE_USER->getPagePermsClause(1);
-               $pageinfo = t3lib_BEfunc::readPageAccess($this->id,$perms_clause);
-               $this->access = is_array($pageinfo) ? 1 : 0;
+               $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$perms_clause);
+               $this->access = is_array($this->pageinfo) ? 1 : 0;
        }
 
        /**
@@ -248,17 +252,9 @@ class SC_db_new_content_el {
                        // Creating content
                        // ***************************
                        $this->content='';
-                       $this->content.=$this->doc->startPage($LANG->getLL('newContentElement'));
                        $this->content.=$this->doc->header($LANG->getLL('newContentElement'));
                        $this->content.=$this->doc->spacer(5);
 
-                       $elRow = t3lib_BEfunc::getRecordWSOL('pages',$this->id);
-                       $hline = t3lib_iconWorks::getIconImage('pages',$elRow,$BACK_PATH,' title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow,'pages')).'" align="top"');
-                       $hline.= t3lib_BEfunc::getRecordTitle('pages',$elRow,TRUE);
-                       $this->content.=$this->doc->section('',$hline,0,1);
-                       $this->content.=$this->doc->spacer(10);
-
-
                                // Wizard
                        $code='';
                        $lines=array();
@@ -336,25 +332,22 @@ class SC_db_new_content_el {
                                $code.= $posMap->printContentElementColumns($this->id,0,$colPosList,1,$this->R_URI);
                                $this->content.= $this->doc->section($LANG->getLL('2_selectPosition'),$code,0,1);
                        }
-
-                               // IF there is a return-url set, then print a 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>';
-                               $this->content.= $this->doc->section('',$code,0,1);
-                       }
-
-                               // Add CSH:
-                       $this->content.= $this->doc->section('',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'],'<br/>'),0,1);
-
-                               // Add a very high clear-gif, 700 px (so that the link to the anchor "sel2" shows this part in top for sure...)
-                       $this->content.= $this->doc->section('','<img src="clear.gif" width="1" height="700" alt="" />',0,1);
-
                } else {                // In case of no access:
                        $this->content = '';
-                       $this->content.= $this->doc->startPage($LANG->getLL('newContentElement'));
                        $this->content.= $this->doc->header($LANG->getLL('newContentElement'));
                        $this->content.= $this->doc->spacer(5);
                }
+               
+                       // 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('newContentElement'));
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
@@ -363,13 +356,38 @@ class SC_db_new_content_el {
         * @return      void
         */
        function printContent() {
-               global $SOBE;
-
-               $this->content.= $this->doc->endPage();
                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->id && $this->access) {
+                               // CSH
+                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH']);
 
+                               // Back
+                       if ($this->R_URI)       {
+                               $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;
+       }
 
 
 
diff --git a/typo3/templates/db_new_content_el.html b/typo3/templates/db_new_content_el.html
new file mode 100644 (file)
index 0000000..4679f0b
--- /dev/null
@@ -0,0 +1,31 @@
+<!-- ###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######PAGEPATH###</div>\r
+                       <div class="infooptions">###PAGEINFO###</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
+       <!-- Wrapper for button group -->\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