Fixed bug #11937: Do not show E_DEPRECATED messages on productive systems
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_foldertree.php
old mode 100755 (executable)
new mode 100644 (file)
index 04f8eb9..a09fc92
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
 /***************************************************************
 *  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
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -55,7 +55,6 @@
  *
  */
 
  *
  */
 
-require_once (PATH_t3lib.'class.t3lib_treeview.php');
 
 
 
 
 
 
@@ -199,10 +198,19 @@ class t3lib_folderTree extends t3lib_treeView  {
                        $icon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($isOpen?'minus':'plus').'only.gif','width="18" height="16"').' alt="" />';
                        $firstHtml= $this->PM_ATagWrap($icon,$cmd);
 
                        $icon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($isOpen?'minus':'plus').'only.gif','width="18" height="16"').' alt="" />';
                        $firstHtml= $this->PM_ATagWrap($icon,$cmd);
 
-                       switch($val['type'])    {
-                               case 'user':    $icon = 'gfx/i/_icon_ftp_user.gif';     break;
-                               case 'group':   $icon = 'gfx/i/_icon_ftp_group.gif'; break;
-                               default:                $icon = 'gfx/i/_icon_ftp.gif'; break;
+                       switch ($val['type']) {
+                               case 'user':
+                                       $icon = 'gfx/i/_icon_ftp_user.gif';
+                                       break;
+                               case 'group':
+                                       $icon = 'gfx/i/_icon_ftp_group.gif';
+                                       break;
+                               case 'readonly':
+                                       $icon = 'gfx/i/_icon_ftp_readonly.gif';
+                                       break;
+                               default:
+                                       $icon = 'gfx/i/_icon_ftp.gif';
+                                       break;
                        }
 
                                // Preparing rootRec for the mount
                        }
 
                                // Preparing rootRec for the mount
@@ -219,7 +227,7 @@ class t3lib_folderTree extends t3lib_treeView  {
                        if ($isOpen)    {
                                        // Set depth:
                                $depthD='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/blank.gif','width="18" height="16"').' alt="" />';
                        if ($isOpen)    {
                                        // Set depth:
                                $depthD='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/blank.gif','width="18" height="16"').' alt="" />';
-                               $this->getFolderTree($val['path'],999,$depthD);
+                               $this->getFolderTree($val['path'], 999, $depthD, $val['type']);
                        }
 
                                // Add tree:
                        }
 
                                // Add tree:
@@ -237,7 +245,7 @@ class t3lib_folderTree extends t3lib_treeView  {
         * @return      integer         The count of items on the level
         * @see getBrowsableTree()
         */
         * @return      integer         The count of items on the level
         * @see getBrowsableTree()
         */
-       function getFolderTree($files_path, $depth=999, $depthData='' {
+       function getFolderTree($files_path, $depth=999, $depthData='', $type='') {
 
                        // This generates the directory tree
                $dirs = t3lib_div::get_dirs($files_path);
 
                        // This generates the directory tree
                $dirs = t3lib_div::get_dirs($files_path);
@@ -257,7 +265,7 @@ class t3lib_folderTree extends t3lib_treeView  {
                                $treeKey = key($this->tree);    // Get the key for this space
                                $LN = ($a==$c)?'blank':'line';
 
                                $treeKey = key($this->tree);    // Get the key for this space
                                $LN = ($a==$c)?'blank':'line';
 
-                               $val = ereg_replace('^\./','',$val);
+                               $val = preg_replace('/^\.\//','',$val);
                                $title = $val;
                                $path = $files_path.$val.'/';
                                $webpath=t3lib_BEfunc::getPathType_web_nonweb($path);
                                $title = $val;
                                $path = $files_path.$val.'/';
                                $webpath=t3lib_BEfunc::getPathType_web_nonweb($path);
@@ -274,7 +282,8 @@ class t3lib_folderTree extends t3lib_treeView  {
                                        $nextCount=$this->getFolderTree(
                                                $path,
                                                $depth-1,
                                        $nextCount=$this->getFolderTree(
                                                $path,
                                                $depth-1,
-                                               $this->makeHTML ? $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' alt="" />' : ''
+                                               $this->makeHTML ? $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$LN.'.gif','width="18" height="16"').' alt="" />' : '',
+                                               $type
                                        );
                                        $exp=1;         // Set "did expand" flag
                                } else {
                                        );
                                        $exp=1;         // Set "did expand" flag
                                } else {
@@ -286,16 +295,16 @@ class t3lib_folderTree extends t3lib_treeView  {
                                if ($this->makeHTML)    {
                                        $HTML=$depthData.$this->PMicon($row,$a,$c,$nextCount,$exp);
 
                                if ($this->makeHTML)    {
                                        $HTML=$depthData.$this->PMicon($row,$a,$c,$nextCount,$exp);
 
-                                       $icon = 'gfx/i/_icon_'.$webpath.'folders.gif';
+                                       $icon = 'gfx/i/_icon_' .$webpath . 'folders' . ($type == 'readonly' ? '_ro' : '') . '.gif';
                                        if ($val=='_temp_')     {
                                                $icon = 'gfx/i/sysf.gif';
                                        if ($val=='_temp_')     {
                                                $icon = 'gfx/i/sysf.gif';
-                                               $row['title']='TEMP';
-                                               $row['_title']='<b>TEMP</b>';
+                                               $row['title'] = $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true);
+                                               $row['_title'] = '<strong>' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true) . '</strong>';
                                        }
                                        if ($val=='_recycler_') {
                                                $icon = 'gfx/i/recycler.gif';
                                        }
                                        if ($val=='_recycler_') {
                                                $icon = 'gfx/i/recycler.gif';
-                                               $row['title']='RECYCLER';
-                                               $row['_title']='<b>RECYCLER</b>';
+                                               $row['title'] = $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_file_list.xml:recycler', true);
+                                               $row['_title'] = '<strong>' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_file_list.xml:recycler', true) . '</strong>';
                                        }
                                        $HTML.=$this->wrapIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' alt="" />',$row);
                                }
                                        }
                                        $HTML.=$this->wrapIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' alt="" />',$row);
                                }
@@ -365,4 +374,5 @@ class t3lib_folderTree extends t3lib_treeView  {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_foldertree.php'])       {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_foldertree.php']);
 }
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_foldertree.php'])       {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_foldertree.php']);
 }
+
 ?>
\ No newline at end of file
 ?>
\ No newline at end of file