Follow-up to #12381: Scheduler: BLOB database fields may not be NOT NULL
[Packages/TYPO3.CMS.git] / typo3 / alt_db_navframe.php
old mode 100755 (executable)
new mode 100644 (file)
index 1d0b4e5..1edf306
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -150,7 +150,7 @@ class SC_alt_db_navframe {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
                $this->doc->setModuleTemplate('templates/alt_db_navframe.html');
-               $this->doc->docType  = 'xhtml_trans';
+               $this->doc->showFlashMessages = FALSE;
 
                        // get HTML-Template
 
@@ -158,7 +158,7 @@ class SC_alt_db_navframe {
                        // Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
                $this->doc->getDragDropCode('pages');
                $this->doc->getContextMenuCode();
-               $this->doc->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js?load=effects');
+               $this->doc->getPageRenderer()->loadScriptaculous('effects');
 
                $this->doc->JScode .= $this->doc->wrapScriptTags(
                ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
@@ -167,11 +167,19 @@ class SC_alt_db_navframe {
 
                // Function, loading the list frame from navigation tree:
                function jumpTo(id, linkObj, highlightID, bank) { //
-                       var theUrl = top.TS.PATH_typo3 + top.currentSubScript + "?id=" + id;
+                       var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
+                       if (theUrl.indexOf("?") != -1) {
+                               theUrl += "&id=" + id
+                       } else {
+                               theUrl += "?id=" + id
+                       }
                        top.fsMod.currentBank = bank;
 
-                       if (top.condensedMode) top.content.location.href = theUrl;
-                       else                   parent.list_frame.location.href=theUrl;
+                       if (top.condensedMode) {
+                               top.content.location.href = theUrl;
+                       } else {
+                               parent.list_frame.location.href=theUrl;
+                       }
 
                        '.($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '').'
                        '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
@@ -206,7 +214,7 @@ class SC_alt_db_navframe {
                <img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.
                '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))).'">'.
                $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount',1).
-               '</a><br/>
+               '</a><br />
                '.$LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.path',1).': <span title="'.htmlspecialchars($this->active_tempMountPoint['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->active_tempMountPoint['_thePath'],-50)).'</span>
        </div>
                        ';
@@ -223,18 +231,23 @@ class SC_alt_db_navframe {
 
                        // 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" />',
+                       'IMG_RESET'     => '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') .
+                       ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" ' .
+                       'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" />',
                        'WORKSPACEINFO' => $this->getWorkspaceInfo(),
-                       'CONTENT' => $this->content
+                       'CONTENT'       => $this->content
                );
+               $subparts = array();
 
+               if (!$this->hasFilterBox) {
+                       $subparts['###SECOND_ROW###'] = '';
+               }
                        // 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->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
                $this->content.= $this->doc->endPage();
+
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
@@ -252,7 +265,7 @@ class SC_alt_db_navframe {
         *
         * @return      array   all available buttons as an assoc. array
         */
-       private function getButtons()   {
+       protected function getButtons() {
                global $LANG;
 
                $buttons = array(
@@ -262,14 +275,14 @@ class SC_alt_db_navframe {
                );
 
                        // New Page
-               $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?id=1&pagesOnly=1\';"';
+               $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?pagesOnly=1&amp;id=\'+Tree.pageID;';
                $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']));
+               $buttons['csh'] = str_replace('typo3-csh-inline','typo3-csh-inline show-right',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'], '', TRUE));
 
                return $buttons;
        }
@@ -279,7 +292,7 @@ class SC_alt_db_navframe {
         *
         * @return      string  HTML containing workspace info
         */
-       private function getWorkspaceInfo() {
+       protected function getWorkspaceInfo() {
                global $LANG;
 
                if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo'))  {
@@ -307,27 +320,6 @@ class SC_alt_db_navframe {
                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;
-       }
-
-
 
        /**********************************
         *
@@ -391,10 +383,10 @@ class SC_alt_db_navframe {
         * Called by typo3/ajax.php
         *
         * @param       array           $params: additional parameters (not used here)
-        * @param       TYPO3AJAX       &$ajaxObj: reference of the TYPO3AJAX object of this request
+        * @param       TYPO3AJAX       $ajaxObj: The TYPO3AJAX object of this request
         * @return      void
         */
-       public function ajaxExpandCollapse($params, &$ajaxObj) {
+       public function ajaxExpandCollapse($params, $ajaxObj) {
                global $LANG;
 
                $this->init();
@@ -405,26 +397,10 @@ class SC_alt_db_navframe {
                        $ajaxObj->addContent('tree', $tree);
                }
        }
-
-       /**
-        * Makes the AJAX call to expand or collapse the filterbox.
-        * Called by typo3/ajax.php
-        *
-        * @param       array           $params: additional parameters (not used here)
-        * @param       TYPO3AJAX       &$ajaxObj: reference of the TYPO3AJAX object of this request
-        * @return      void
-        */
-       public function ajaxSaveFilterboxStatus(array $params, &$ajaxObj) {
-               $state = t3lib_div::_POST('state') === 'true' ? 1 : 0;
-
-               $GLOBALS['BE_USER']->uc['moduleData']['pageTree']['filterBox'] = $state;
-               $GLOBALS['BE_USER']->writeUC();
-       }
-
 }
 
 
-// Include extension?
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php'])      {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
 }