RFC #7435: Docheaders: Module User Tools > Workspace: No docheader
authorPatrick Broens <patrick@netcreators.com>
Sun, 17 Feb 2008 14:20:58 +0000 (14:20 +0000)
committerPatrick Broens <patrick@netcreators.com>
Sun, 17 Feb 2008 14:20:58 +0000 (14:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3185 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/mod/user/ws/index.php
typo3/mod/user/ws/workspaceforms.php
typo3/stylesheet.css
typo3/templates/ws.html [new file with mode: 0644]
typo3/templates/ws_forms.html [new file with mode: 0644]

index 79883c2..207ab37 100755 (executable)
@@ -250,8 +250,9 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $this->MCONF = $GLOBALS['MCONF'];
 
                        // Initialize Document Template object:
-               $this->doc = t3lib_div::makeInstance('noDoc');
+               $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
+               $this->doc->setModuleTemplate('templates/ws.html');
                $this->doc->docType = 'xhtml_trans';
 
                        // JavaScript
@@ -305,12 +306,9 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $changeWorkspace = t3lib_div::_GET('changeWorkspace');
                if ($changeWorkspace != '') {
                        $BE_USER->setWorkspace($changeWorkspace);
-                       $this->content = $this->doc->startPage($LANG->getLL('title'));
                        $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . t3lib_BEfunc::getBackendScript() . '";');
-               }
-               else {
+               } else {
                                // Starting page:
-                       $this->content.=$this->doc->startPage($LANG->getLL('title'));
                        $this->content.=$this->doc->header($LANG->getLL('title'));
                        $this->content.=$this->doc->spacer(5);
 
@@ -337,7 +335,20 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                // Add hidden fields and create tabs:
                        $content = $this->doc->getDynTabMenu($menuItems,'user_ws');
                        $this->content.=$this->doc->section('',$content,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('title'));
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
+                       
        }
 
        /**
@@ -346,13 +357,31 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
         * @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(
+                       'new_record' => '',
+               );
+
+               $newWkspUrl = 'workspaceforms.php?action=new';
 
+                       // workspace creation link
+               if ($GLOBALS['BE_USER']->isAdmin() || 0 != ($GLOBALS['BE_USER']->groupData['workspace_perms'] & 4))     {
+                       $buttons['new_record'] = '<a href="' . $newWkspUrl . '">' .
+                                               '<img ' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/new_el.gif') . ' alt="' . $LANG->getLL('img_title_create_new_workspace') . '" id="ver-wl-new-workspace-icon" />' .
+                                               '</a>';
+               }
+               return $buttons;
+       }
 
 
 
@@ -607,16 +636,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                }
                $content .= '</table>';
 
-               $newWkspUrl = 'workspaceforms.php?action=new';
-
-                       // workspace creation link
-               if ($GLOBALS['BE_USER']->isAdmin() || 0 != ($GLOBALS['BE_USER']->groupData['workspace_perms'] & 4))     {
-                       $content .= '<br /><a href="' . $newWkspUrl . '">' .
-                                               '<img ' .
-                                               t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/new_el.gif', 'width="11" height="12"') .
-                                               ' alt="' . $LANG->getLL('img_title_create_new_workspace'). '" id="ver-wl-new-workspace-icon" />' .
-                                               $LANG->getLL('link_text_create_new_workspace') . '</a>';
-               }
                return $content;
        }
 
index 6489cbd..a8a661b 100644 (file)
@@ -137,8 +137,9 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                $this->MCONF = $GLOBALS['MCONF'];
 
                // Initialize Document Template object:
-               $this->doc = t3lib_div::makeInstance('mediumDoc');
+               $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
+               $this->doc->setModuleTemplate('templates/ws_forms.html');
                $this->doc->docType = 'xhtml_trans';
                $this->doc->form = '<form action="' . t3lib_div::getIndpEnv('SCRIPT_NAME').'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
 
@@ -208,9 +209,7 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                //
                // start page
                //
-               $title = $this->getTitle();
-               $this->content .= $this->doc->startPage($title);
-               $this->content .= $this->doc->header($title);
+               $this->content .= $this->doc->header($this->getTitle());
                $this->content .= $this->doc->spacer(5);
 
                //
@@ -219,21 +218,19 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                $this->content .= $this->tceforms->printNeededJSFunctions_top();
                $this->content .= $this->buildForm();
                $this->content .= $this->tceforms->printNeededJSFunctions();
-
-               //
-               // end page
-               //
-               $this->content .= $this->doc->endPage();
+               
+                       // 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($this->getTitle());
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
-
-
-
-
-
-
-
-
        /**
         * Outputs module content to the browser.
         *
@@ -243,7 +240,29 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                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;
+               
+               $buttons = array(
+                       'close' => '',
+                       'save' => '',
+                       'save_close' => ''
+               );
+                       
+                       // Close,  `n` below is simply to prevent caching
+               $buttons['close'] = '<a href="index.php?n=' . uniqid('wksp') . '"><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" /></a>';      
+                       // Save
+               $buttons['save'] = '<input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" value="_savedok" />'; 
+                       // Save & Close
+               $buttons['save_close'] = '<input type="image" class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', 1) . '" value="_saveandclosedok" />';
+               
+               return $buttons;
+       }
 
 
 
@@ -377,10 +396,8 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                $form .= '<input type="hidden" name="wkspId" value="' . htmlspecialchars($this->workspaceId) . '" />';
                $form = $this->tceforms->wrapTotal($form, $rec, $table);
 
-               $buttons = $this->createButtons() . $this->doc->spacer(5);
-
                // Combine it all:
-               $content .= $buttons . $form . $buttons;
+               $content .= $form;
                return $content;
        }
 
@@ -433,7 +450,6 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
 
                // Create form for the record (either specific list of fields or the whole record):
                $form = '';
-               $form .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path', 1) . ': ' . $this->tceforms->getRecordPath($table,$rec);
                $form .= $this->doc->spacer(5);
                $form .= $this->tceforms->getMainFields($table,$rec);
 
@@ -447,28 +463,12 @@ class SC_mod_user_ws_workspaceForms extends t3lib_SCbase {
                $form .= '<input type="hidden" name="_disableRTE" value="'.$this->tceforms->disableRTE.'" />';
                $form = $this->tceforms->wrapTotal($form, $rec, $table);
 
-               $buttons = $this->createButtons() . $this->doc->spacer(5);
-
                // Combine it all:
-               $content .= $buttons . $form . $buttons;
+               $content .= $form;
                return $content;
        }
 
-       /**
-        * Creates standard buttons for form. Adopted from <code>alt_doc.php</code>.
-        *
-        * @return      string          Generated buttons code
-        */
-       function createButtons() {
-               global  $LANG;
 
-               $content = '';
-               $content .= '<input type="image" class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/savedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'" value="_savedok" />';
-               $content .= '<input type="image" class="c-inputButton" name="_saveandclosedok"'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/saveandclosedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc',1).'" value="_saveandclosedok" />';
-               // `n` below is simply to prevent caching
-               $content .= '<a href="index.php?n=' . uniqid('wksp') . '"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/closedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc',1).'" alt="" /></a>';
-               return $content;
-       }
 
 
 
index 6dba26d..5b6ae63 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 { 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 { padding: 0; margin: 0; overflow: hidden; height: 100%; }
 
 
 /****************************************
diff --git a/typo3/templates/ws.html b/typo3/templates/ws.html
new file mode 100644 (file)
index 0000000..4767d89
--- /dev/null
@@ -0,0 +1,66 @@
+<!-- ###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"></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### -->###NEW_RECORD###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###BUTTON_GROUP1### --><!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###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"></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### -->###NEW_RECORD###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###BUTTON_GROUP1### --><!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
diff --git a/typo3/templates/ws_forms.html b/typo3/templates/ws_forms.html
new file mode 100644 (file)
index 0000000..8b98ff2
--- /dev/null
@@ -0,0 +1,68 @@
+<!-- ###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">###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
+<!-- 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### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_CLOSE###<!-- ###BUTTON_GROUP2### -->\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###BUTTON_GROUP1### --><!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###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">###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
+<!-- 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### -->###CLOSE###<!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUP2### -->###SAVE######SAVE_CLOSE###<!-- ###BUTTON_GROUP2### -->\r
+<!-- ###BUTTON_GROUPS_LEFT### -->\r
+\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r
+<!-- ###BUTTON_GROUP1### --><!-- ###BUTTON_GROUP1### -->\r
+<!-- ###BUTTON_GROUPS_RIGHT### -->\r