Added feature #13379: Introduced a Sprite Icon API to render icons from sprites ...
[Packages/TYPO3.CMS.git] / typo3 / class.filelistfoldertree.php
index 0529716..1847791 100644 (file)
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
-
-require_once (PATH_t3lib.'class.t3lib_foldertree.php');
-
-
-
 /**
  * Extension class for the t3lib_filetree class, needed for drag and drop and ajax functionality
  *
@@ -138,7 +133,7 @@ class filelistFolderTree extends t3lib_folderTree {
 
                $out = '
                        <!-- TYPO3 folder tree structure. -->
-                       <ul class="tree">
+                       <ul class="tree" id="treeRoot">
                ';
                $titleLen=intval($this->BE_USER->uc['titleLen']);
                if (!is_array($treeArr))        $treeArr=$this->tree;
@@ -174,7 +169,7 @@ class filelistFolderTree extends t3lib_folderTree {
                        // if this item is the start of a new level,
                        // then a new level <ul> is needed, but not in ajax mode
                        if($v['isFirst'] && !($doCollapse) && !($doExpand && $expandedFolderUid == $uid))       {
-                               $itemHTML = "<ul>\n";
+                               $itemHTML = "</div><ul>\n";
                        }
 
                        // add CSS classes to the list item
@@ -182,12 +177,12 @@ class filelistFolderTree extends t3lib_folderTree {
                        if($v['isLast']) { $classAttr = ($classAttr) ? ' last'  : 'last';        }
 
                        $itemHTML .='
-                               <li id="'.$idAttr.'"'.($classAttr ? ' class="'.$classAttr.'"' : '').'>'.
+                               <li id="'.$idAttr.'"'.($classAttr ? ' class="'.$classAttr.'"' : '').'><div class="treeLinkItem">'.
                                        $v['HTML'].
                                        $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$v['bank']);
 
 
-                       if(!$v['hasSub']) { $itemHTML .= "</li>\n"; }
+                       if(!$v['hasSub']) { $itemHTML .= "</div></li>\n"; }
 
                        // we have to remember if this is the last one
                        // on level X so the last child on level X+1 closes the <ul>-tag
@@ -380,7 +375,7 @@ class filelistFolderTree extends t3lib_folderTree {
                        end($this->tree);
                        $treeKey = key($this->tree);    // Get the key for this space
 
-                       $val = ereg_replace('^\./','',$val);
+                       $val = preg_replace('/^\.\//','',$val);
                        $title = $val;
                        $path = $files_path.$val.'/';
 
@@ -411,6 +406,13 @@ class filelistFolderTree extends t3lib_folderTree {
                                $HTML = $this->PMicon($row,$a,$c,$nextCount,$exp);
 
                                $webpath = t3lib_BEfunc::getPathType_web_nonweb($path);
+
+                               if (is_writable($path)) {
+                                       $type = '';
+                               } else {
+                                       $type = 'readonly';
+                               }
+
                                $icon = 'gfx/i/_icon_' .$webpath . 'folders' . ($type == 'readonly' ? '_ro' : '') . '.gif';
                                if ($val == '_temp_')   {
                                        $icon = 'gfx/i/sysf.gif';