Fixed bug #11468: [Bug]: $altUrl parameter has no effect in t3lib_BEfunc::viewOnClick...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_browsetree.php
old mode 100755 (executable)
new mode 100644 (file)
index 0779a58..62b74ea
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 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
  *   83:     function init($clause='')
  *  116:     function getTitleAttrib($row)
  *  128:     function wrapIcon($icon,$row)
+ *  150:     function getTitleStr($row,$titleLen=30)
  *
- * TOTAL FUNCTIONS: 3
+ * TOTAL FUNCTIONS: 4
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
 
-require_once (PATH_t3lib.'class.t3lib_treeview.php');
-
 
 
 
@@ -100,9 +99,18 @@ class t3lib_browseTree extends t3lib_treeView {
                $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                $this->MOUNTS = $GLOBALS['WEBMOUNTS'];
 
-               $this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id','t3ver_state','t3ver_wsid','t3ver_swapmode'));
+               if ($pidList)   {
+                               // Remove mountpoint if explicitely set in options.hideRecords.pages (see above)
+                       $hideList = explode(',',$pidList);
+                       $this->MOUNTS = array_diff($this->MOUNTS,$hideList);
+               }
+
+               $this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id','t3ver_state','t3ver_wsid','t3ver_swapmode','t3ver_state','t3ver_move_id'));
                if (t3lib_extMgm::isLoaded('cms'))      {
-                       $this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages'));
+                       $this->fieldArray = array_merge(
+                               $this->fieldArray,
+                               array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'is_siteroot', 'nav_hide')
+                       );
                }
        }
 
@@ -138,9 +146,31 @@ class t3lib_browseTree extends t3lib_treeView {
                }
                return $theIcon;
        }
+
+       /**
+        * Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
+        * Do NOT htmlspecialchar the string from this function - has already been done.
+        *
+        * @param       array           The input row array (where the key "title" is used for the title)
+        * @param       integer         Title length (30)
+        * @return      string          The title.
+        */
+       function getTitleStr($row,$titleLen=30) {
+                       // get the basic title from the parent implementation in t3lib_treeview
+               $title = parent::getTitleStr($row,$titleLen);
+               if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
+                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain',
+                                               'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'], 'sys_domain'), '', 'sorting', 1);
+                       if (is_array($rows) && count($rows) > 0) {
+                               $title = sprintf('%s [%s]', $title, $rows[0]['domainName']);
+                       }
+               }
+               return $title;
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php'])       {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php']);
 }
-?>
+
+?>
\ No newline at end of file