(feature/cleanup) Refactored clickmenu to speed up the BE
[Packages/TYPO3.CMS.git] / typo3 / alt_db_navframe.php
index 614c371..86a9480 100755 (executable)
@@ -70,6 +70,12 @@ class SC_alt_db_navframe {
                // Internal:
        var $content;
        var $pagetree;
+
+       /**
+        * document template object
+        *
+        * @var template
+        */
        var $doc;
        var $active_tempMountPoint = 0;         // Temporary mount point (record), if any
        var $backPath;
@@ -90,7 +96,6 @@ class SC_alt_db_navframe {
 
                        // Setting backPath
                $this->backPath = $BACK_PATH;
-               $this->doc->backPath = $BACK_PATH;
 
                        // Setting GPvars:
                $this->ajax = t3lib_div::_GP('ajax');
@@ -102,6 +107,9 @@ class SC_alt_db_navframe {
                $this->pagetree = t3lib_div::makeInstance('webPageTree');
                $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
                $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
+               $this->pagetree->ext_showNavTitle = $BE_USER->getTSConfigVal('options.pageTree.showNavTitle');
+               $this->pagetree->ext_separateNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.separateNotinmenuPages');
+               $this->pagetree->ext_alphasortNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.alphasortNotinmenuPages');
                $this->pagetree->thisScript = 'alt_db_navframe.php';
                $this->pagetree->addField('alias');
                $this->pagetree->addField('shortcut');
@@ -109,6 +117,7 @@ class SC_alt_db_navframe {
                $this->pagetree->addField('mount_pid');
                $this->pagetree->addField('mount_pid_ol');
                $this->pagetree->addField('nav_hide');
+               $this->pagetree->addField('nav_title');
                $this->pagetree->addField('url');
 
                        // Temporary DB mounts:
@@ -127,12 +136,12 @@ class SC_alt_db_navframe {
 
                                // Create template object:
                        $this->doc = t3lib_div::makeInstance('template');
+                       $this->doc->backPath = $BACK_PATH;
                        $this->doc->docType = 'xhtml_trans';
 
                                // Adding javascript code for AJAX (prototype), drag&drop and the pagetree
-                       $this->doc->JScode  = '
-                       <script type="text/javascript" src="'.$this->backPath.'contrib/prototype/prototype.js"></script>
-                       <script type="text/javascript" src="'.$this->backPath.'tree.js"></script>'."\n";
+                       $this->doc->loadJavascriptLib('contrib/prototype/prototype.js');
+                       $this->doc->loadJavascriptLib('tree.js');
 
                        $this->doc->JScode .= $this->doc->wrapScriptTags(
                        ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
@@ -160,10 +169,8 @@ class SC_alt_db_navframe {
                        ');
 
                                // Click menu code is added:
-                       $CMparts=$this->doc->getContextMenuCode();
-                       $this->doc->bodyTagAdditions = $CMparts[1];
-                       $this->doc->JScode.= $CMparts[0];
-                       $this->doc->postCode.= $CMparts[2];
+                       $this->doc->getContextMenuCode();
+                       $this->doc->bodyTagId = 'bodyTag';
                }
        }
 
@@ -211,6 +218,14 @@ class SC_alt_db_navframe {
                        ';
                }
 
+               if (!$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'))        {
+                       $this->content.= '
+                                       <div class="bgColor4">
+                                               Filter: <input type="text" value="" name="_livesearch" id="_livesearch" onkeyup="filter(this.value);"/>
+                                       </div><br>
+                       ';
+               }
+
                        // Outputting Temporary DB mount notice:
                if ($this->active_tempMountPoint)       {
                        $this->content.= '
@@ -254,6 +269,7 @@ class SC_alt_db_navframe {
        function printContent() {
                        // If we handle an AJAX call, send headers:
                if ($this->ajax) {
+                       header('X-JSON: ('.($this->pagetree->ajaxStatus?'true':'false').')');
                        header('Content-type: text/html; charset=utf-8');
                        // If it's the regular call to fully output the tree:
                } else {
@@ -337,4 +353,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>