fixed bug #7642: Page tree Filter use wrong div for collapse
authorIngo Renner <ingo.renner@typo3.org>
Sun, 2 Mar 2008 19:50:49 +0000 (19:50 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Sun, 2 Mar 2008 19:50:49 +0000 (19:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3342 709f56b5-9817-0410-a4d7-c38de5d9e867

18 files changed:
ChangeLog
typo3/alt_db_navframe.php
typo3/gfx/arrowdown.gif [deleted file]
typo3/gfx/arrowdown.png [new file with mode: 0644]
typo3/gfx/arrowleft.gif [deleted file]
typo3/gfx/arrowleft.png [new file with mode: 0644]
typo3/gfx/arrowright.gif [deleted file]
typo3/gfx/arrowright.png [new file with mode: 0644]
typo3/gfx/arrowup.gif [deleted file]
typo3/gfx/arrowup.png [new file with mode: 0644]
typo3/gfx/close_gray.gif [new file with mode: 0644]
typo3/gfx/filter_bg.png [new file with mode: 0644]
typo3/gfx/search_bubble.png [deleted file]
typo3/gfx/search_reset.png [deleted file]
typo3/js/tree.js
typo3/stylesheet.css
typo3/sysext/t3skin/stylesheets/modulemenu.css
typo3/templates/alt_db_navframe.html

index 77470ef..8ce73b7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2008-03-02  Ingo Renner  <ingo@typo3.org>
+
+       * fixed bug #7642: Page tree Filter use wrong div for collapse
 
 2008-03-02  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index 9a87f20..1d0b4e5 100755 (executable)
@@ -149,10 +149,10 @@ class SC_alt_db_navframe {
                        // Create template object:
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
+               $this->doc->setModuleTemplate('templates/alt_db_navframe.html');
                $this->doc->docType  = 'xhtml_trans';
 
                        // get HTML-Template
-               $this->template = $this->doc->getHtmlTemplate('templates/alt_db_navframe.html');
 
 
                        // Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
@@ -198,68 +198,6 @@ class SC_alt_db_navframe {
                        // Produce browse-tree:
                $tree = $this->pagetree->getBrowsableTree();
 
-                       // Start page:
-               $this->content = $this->doc->startPage('TYPO3 Page Tree');
-
-                       // Outputting workspace info
-               if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))  {
-                       switch($GLOBALS['BE_USER']->workspace)  {
-                               case 0:
-                                       $wsTitle = '&nbsp;'.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
-                               break;
-                               case -1:
-                                       $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
-                               break;
-                               default:
-                                       $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
-                               break;
-                       }
-
-                       $showWorkspaceInfo = true;
-               }
-
-               //prepare onclick links
-               $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
-
-               $docheader = t3lib_parsehtml::getSubpart($this->template, '###DOCHEADER###');
-
-               $markers['BUTTONSLEFT'] =
-                               // Filter switch
-                       ($this->hasFilterBox ? '
-                                       <a href="#" id="toggleTreeFilter">
-                                               <img'.t3lib_iconWorks::skinImg('',$GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? 'gfx/arrowright.gif' : 'gfx/arrowdown.gif','width="16" height="16"').' title="show filter" alt="" />
-                                               <span>'.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:pageTree_filter',1).'</span>
-                                       </a>' : '')
-               ;
-
-               $markers['BUTTONSRIGHT'] =
-                               // New Page
-                       '<a href="#" onclick="'.$onclickNewPageWizard.'"><img'.t3lib_iconWorks::skinImg('','gfx/new_page.gif','width="13" height="12"').' title="'.$LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage',1).'" alt="" /></a>'.
-
-                               // Refresh-Icon
-                       '<a href="'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'"><img'.t3lib_iconWorks::skinImg('','gfx/refresh_n.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.refresh',1).'" alt="" /></a>'.
-
-                               // CSH-Icon
-                       t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'])
-
-               ;
-
-               $markers['STYLE'] = $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? ' style="display:none;"' : '';
-               $markers['IMG_RESET'] = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/search_reset.png', ' width="11" height="11"').' id="treeFilterReset" alt="Reset Filter" />';
-
-               $this->content .= t3lib_parsehtml::substituteMarkerArray($docheader, $markers, '###|###');
-
-
-               if($showWorkspaceInfo) {
-                       $this->content.= '
-                               <div class="bgColor4 workspace-info">'.
-                                       '<a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
-                                       '<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
-                                       '</a>'.$wsTitle.'
-                               </div>
-                       ';
-               }
-
 
                        // Outputting Temporary DB mount notice:
                if ($this->active_tempMountPoint)       {
@@ -274,7 +212,6 @@ class SC_alt_db_navframe {
                        ';
                }
 
-
                        // Outputting page tree:
                $this->content .= '<div id="PageTreeDiv">'.$tree.'</div>';
 
@@ -283,6 +220,22 @@ class SC_alt_db_navframe {
                        '.($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '').'
                        '.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
                );
+
+                       // Setting up the buttons and markers for docheader
+               $docHeaderButtons = $this->getButtons();
+               $docHeaderButtons['filtertoggle'] = $this->getFilterToggle();
+               $markers = array(
+                       'STYLE' => $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? ' style="display:none;"' : '',
+                       'IMG_RESET' => '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"').' id="treeFilterReset" alt="Reset Filter" />',
+                       'WORKSPACEINFO' => $this->getWorkspaceInfo(),
+                       'CONTENT' => $this->content
+               );
+
+                       // Build the <body> for the module
+               $this->content = $this->doc->startPage('TYPO3 Page Tree');
+               $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
@@ -291,12 +244,88 @@ class SC_alt_db_navframe {
         * @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;
+
+               $buttons = array(
+                       'csh' => '',
+                       'new_page' => '',
+                       'refresh' => '',
+               );
+
+                       // New Page
+               $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
+               $buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/new_page.gif') . ' title="' . $LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1) . '" alt="" /></a>';
+
+                       // Refresh
+               $buttons['refresh'] = '<a href="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '"><img' . t3lib_iconWorks::skinImg('', 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh', 1) . '" alt="" /></a>';
+
+                       // CSH
+               $buttons['csh'] = str_replace('typo3-csh-inline','typo3-csh-inline show-right',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']));
+
+               return $buttons;
+       }
+
+       /**
+        * Create the workspace information
+        *
+        * @return      string  HTML containing workspace info
+        */
+       private function getWorkspaceInfo() {
+               global $LANG;
+
+               if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))  {
+                       switch($GLOBALS['BE_USER']->workspace)  {
+                               case 0:
+                                       $wsTitle = '&nbsp;'.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
+                               break;
+                               case -1:
+                                       $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
+                               break;
+                               default:
+                                       $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
+                               break;
+                       }
+
+                       $workspaceInfo = '
+                               <div class="bgColor4 workspace-info">
+                                       <a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
+                                       '<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
+                                       '</a>'.$wsTitle.'
+                               </div>
+                       ';
+               }
+
+               return $workspaceInfo;
+       }
 
+       /**
+        * Create the filter toggle
+        *
+        * @return      string  HTML for filter toggle
+        */
+       private function getFilterToggle() {
+               $filterToggle = '';
+
+               if($this->hasFilterBox) {
+                       $filterToggle = '
+                               <a href="#" id="toggleTreeFilter">
+                                       <img' . t3lib_iconWorks::skinImg('', $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] ? 'gfx/arrowright.png' : 'gfx/arrowdown.png') . ' title="toggle filter" alt="" />
+                                       <span>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:pageTree_filter', 1) . '</span>
+                               </a>
+                       ';
+               }
+
+               return $filterToggle;
+       }
 
 
 
diff --git a/typo3/gfx/arrowdown.gif b/typo3/gfx/arrowdown.gif
deleted file mode 100644 (file)
index 4fd4dc5..0000000
Binary files a/typo3/gfx/arrowdown.gif and /dev/null differ
diff --git a/typo3/gfx/arrowdown.png b/typo3/gfx/arrowdown.png
new file mode 100644 (file)
index 0000000..eba4b28
Binary files /dev/null and b/typo3/gfx/arrowdown.png differ
diff --git a/typo3/gfx/arrowleft.gif b/typo3/gfx/arrowleft.gif
deleted file mode 100644 (file)
index ff3cc7b..0000000
Binary files a/typo3/gfx/arrowleft.gif and /dev/null differ
diff --git a/typo3/gfx/arrowleft.png b/typo3/gfx/arrowleft.png
new file mode 100644 (file)
index 0000000..f035acb
Binary files /dev/null and b/typo3/gfx/arrowleft.png differ
diff --git a/typo3/gfx/arrowright.gif b/typo3/gfx/arrowright.gif
deleted file mode 100644 (file)
index 21b38ee..0000000
Binary files a/typo3/gfx/arrowright.gif and /dev/null differ
diff --git a/typo3/gfx/arrowright.png b/typo3/gfx/arrowright.png
new file mode 100644 (file)
index 0000000..1ba4401
Binary files /dev/null and b/typo3/gfx/arrowright.png differ
diff --git a/typo3/gfx/arrowup.gif b/typo3/gfx/arrowup.gif
deleted file mode 100644 (file)
index f7885ca..0000000
Binary files a/typo3/gfx/arrowup.gif and /dev/null differ
diff --git a/typo3/gfx/arrowup.png b/typo3/gfx/arrowup.png
new file mode 100644 (file)
index 0000000..8406539
Binary files /dev/null and b/typo3/gfx/arrowup.png differ
diff --git a/typo3/gfx/close_gray.gif b/typo3/gfx/close_gray.gif
new file mode 100644 (file)
index 0000000..82695f7
Binary files /dev/null and b/typo3/gfx/close_gray.gif differ
diff --git a/typo3/gfx/filter_bg.png b/typo3/gfx/filter_bg.png
new file mode 100644 (file)
index 0000000..7751472
Binary files /dev/null and b/typo3/gfx/filter_bg.png differ
diff --git a/typo3/gfx/search_bubble.png b/typo3/gfx/search_bubble.png
deleted file mode 100644 (file)
index 7a7f0ab..0000000
Binary files a/typo3/gfx/search_bubble.png and /dev/null differ
diff --git a/typo3/gfx/search_reset.png b/typo3/gfx/search_reset.png
deleted file mode 100644 (file)
index c09a700..0000000
Binary files a/typo3/gfx/search_reset.png and /dev/null differ
index 6f34d4d..603aca5 100644 (file)
@@ -244,11 +244,11 @@ var PageTreeFilter = Class.create({
 
                if (state) {
                        Effect.BlindUp(filterBox, {duration : 0.2});
-                       this.toggleFilterBoxIcon.src = 'gfx/arrowright.gif';
+                       this.toggleFilterBoxIcon.src = 'gfx/arrowright.png';
                        this.resetSearchField();
                } else {
                        Effect.BlindDown(filterBox, {duration : 0.1});
-                       this.toggleFilterBoxIcon.src = 'gfx/arrowdown.gif';
+                       this.toggleFilterBoxIcon.src = 'gfx/arrowdown.png';
                }
        },
 
index c881319..9df0efc 100755 (executable)
@@ -116,17 +116,38 @@ IMG {
  *********************************************/
 
  /* Set default values for bodytags: */
-BODY {
+body {
        margin: 2px 2px 0px 4px;
        background-color: #F7F3EF;
 }
 
  /* Setting alternative background color on some frames: */
-BODY#typo3-alt-toplogo-php, BODY#typo3-alt-menu-sel-php, BODY#typo3-alt-topmenu-dummy-php, BODY#typo3-alt-topmenu-dummy-php-iconmenu, BODY#typo3-alt-clickmenu-php, BODY#typo3-alt-clickmenu-php-notop, BODY#typo3-alt-palette-php {
+body#typo3-alt-toplogo-php,
+body#typo3-alt-menu-sel-php,
+body#typo3-alt-topmenu-dummy-php,
+body#typo3-alt-topmenu-dummy-php-iconmenu,
+body#typo3-alt-clickmenu-php,
+body#typo3-alt-clickmenu-php-notop,
+body#typo3-alt-palette-php {
        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, body#typo3-mod-tools-em-index-php, body#ext-lowlevel-dbint-index-php, body#ext-lowlevel-config-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-pagetree {
+       padding: 0;
+       margin: 0;
+       overflow: hidden;
+       height: 100%;
+}
+
 
 
 /****************************************
@@ -289,11 +310,55 @@ UL.tree LI.active, UL.tree UL LI.active   { background-color: #ebebeb !important;
 UL.tree LI.active UL, UL.tree UL LI.active UL  { background-color: #f7f3ef; }
 #dragIcon { z-index: 1; position: absolute; visibility: hidden; filter: alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; white-space: nowrap; }
 
-div#treeFilterBox      { background: url('gfx/search_bubble.png') no-repeat 8px 0; padding-left: 10px; }
-input#treeFilter       { height: 12px; width: 120px; margin: 4px 0 0 18px !important; border: 0; }
-img#treeFilterReset    { border: 0; margin: 5px 0 0 !important; cursor: pointer; visibility: hidden; }
-#toggleTreeFilter span {font-weight:bold; margin-left:-4px; font-size:12px;}
-#typo3-pagetree #typo3-docheader img {margin:2px 1px;}
+#treeFilterBox {
+       position: absolute;
+       z-index: 3;
+       top: 22px;
+       width: 260px;
+       height: 27px;
+       background: url('gfx/filter_bg.png') no-repeat 2px -2px;
+}
+
+#searchBubble {
+       padding-left: 10px;
+}
+
+#treeFilter {
+       font-size: 11px;
+       height: 16px;
+       width: 165px;
+       margin: 6px 0pt 0pt 19px !important;
+       border: 0px;
+       background: transparent;
+}
+
+#treeFilterReset {
+       border: 0;
+       position: absolute;
+       top: 6px;
+       left: 194px;
+       cursor: pointer;
+       visibility: hidden;
+}
+
+#toggleTreeFilter span {
+       font-weight: bold;
+       margin: 4px 0 0 -4px;
+       font-size: 12px;
+}
+
+#toggleTreeFilter img {
+       vertical-align: middle;
+}
+
+#toggleTreeFilter {
+       outline:none;
+       text-decoration:none;
+}
+
+#typo3-pagetree #typo3-docheader img {
+       margin:2px 1px;
+}
 
 #treeRoot {
        margin-top: 6px;
@@ -565,8 +630,8 @@ BODY#typo3-mod-tools-em-index-php TR TD.extstate { color: #fff; font-weight: bol
 
 /* Workspace */
 div.workspace-info {
-       padding: 0px 2px 0px 2px;
-       margin: 2px 0px 4px 0px;
+       padding: 1px 0px 1px 2px;
+       margin: 0px 5px 4px 0px;
        border: 1px solid #999;
 }
 .ver-element, UL.tree UL LI.ver-element { background-color: #ccddcc; }
@@ -668,6 +733,9 @@ A.typo3-csh-link SPAN.typo3-csh-inline { display: none; position: absolute; padd
 A.typo3-csh-link:hover SPAN.typo3-csh-inline { display: block; }
 SPAN.typo3-csh-inline SPAN.header, TABLE.typo3-csh-inline SPAN.header { font-weight: bold; float: left; width: 100%; background-color: #F6F2E6; }
 SPAN.typo3-csh-inline { line-height: 16px; }
+a.typo3-csh-link span.typo3-csh-inline.show-right {
+       margin: 0px 0px 0px -148px;
+}
 
 
 /*********************************************
@@ -707,3 +775,5 @@ H2,H3,H4,DIV { border: 1px dotted #666; }
 */
 
 
+
+
index 0886ace..207b6a5 100644 (file)
@@ -44,12 +44,12 @@ TYPO3 backend menu - vertical
 }
 
 #typo3-menu li div.collapsed {
-       background-image: url(../../../gfx/arrowright.gif);
+       background-image: url(../../../gfx/arrowright.png);
        background-repeat: no-repeat;
 }
 
 #typo3-menu li div.expanded {
-       background-image: url(../../../gfx/arrowdown.gif);
+       background-image: url(../../../gfx/arrowdown.png);
        background-repeat: no-repeat;
 }
 
index a895c96..696a675 100644 (file)
@@ -1,16 +1,38 @@
-
-<!-- ###DOCHEADER### -->
-       <!-- Page header with buttons for saving & closing and path details -->
+<!-- ###FULLDOC### begin -->
+<div class="typo3-fullDoc">
+       <!-- Page header with buttons, path details and csh -->
        <div id="typo3-docheader">
                <div id="typo3-docheader-row1">
-            <div class="buttonsleft">###BUTTONSLEFT###</div>
-                       <div class="buttonsright">###BUTTONSRIGHT###</div>
+                       <div class="buttonsleft">###BUTTONLIST_LEFT###</div>
+                       <div class="buttonsright">###BUTTONLIST_RIGHT###</div>
                </div>
-               <div id="typo3-docheader-row2"###STYLE###>
-                       <div id="treeFilterBox">
-                               <input type="text" value="" name="treeFilter" id="treeFilter" />
-                               ###IMG_RESET###
+               <div id="typo3-docheader-row2">
+                       <div id="treeFilterBox" class="bgColor4" ###STYLE###>
+                               <div id="searchBubble">
+                                       <input type="text" value="" name="treeFilter" id="treeFilter" />
+                                       ###IMG_RESET###
+                               </div>
                        </div>
                </div>
        </div>
-<!-- ###DOCHEADER### -->
+       <!-- Content of module, for instance listing, info or editing -->
+       <div id="typo3-docbody">
+               ###WORKSPACEINFO###
+               ###CONTENT###
+       </div>
+</div>
+<!-- ###FULLDOC### end -->
+
+<!-- Grouping the icons on top -->
+
+<!-- ###BUTTON_GROUP_WRAP### -->
+       <div class="buttongroup">###BUTTONS###</div>
+<!-- ###BUTTON_GROUP_WRAP### -->
+
+<!-- ###BUTTON_GROUPS_LEFT### -->
+<!-- ###BUTTON_GROUP4### -->###FILTERTOGGLE###<!-- ###BUTTON_GROUP4### -->
+<!-- ###BUTTON_GROUPS_LEFT### -->
+
+<!-- ###BUTTON_GROUPS_RIGHT### -->
+<!-- ###BUTTON_GROUP1### -->###NEW_PAGE######REFRESH######CSH###<!-- ###BUTTON_GROUP1### -->
+<!-- ###BUTTON_GROUPS_RIGHT### -->