/***************************************************************
* Copyright notice
*
-* (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+* (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
$PM = t3lib_div::_GP('PM');
if(($PMpos = strpos($PM, '#')) !== false) { $PM = substr($PM, 0, $PMpos); }
$PM = explode('_', $PM);
- if(($isAjaxCall = t3lib_div::_GP('ajax')) && is_array($PM) && count($PM)==4) {
+ if((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) && is_array($PM) && count($PM)==4) {
if($PM[1]) {
$expandedFolderUid = $PM[2];
$ajaxOutput = '';
}
- // we need to count the opened <ul>'s every time we dig into another level,
+ // we need to count the opened <ul>'s every time we dig into another level,
// so we know how many we have to close when all children are done rendering
$closeDepth = array();
$idAttr = htmlspecialchars($this->domIdPrefix.$this->getId($v['row']).'_'.$v['bank']);
$itemHTML = '';
- // if this item is the start of a new level,
+ // 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";
if($doExpand && $expandedFolderUid == $uid) {
$ajaxOutput .= $itemHTML;
$invertedDepthOfAjaxRequestedItem = $v['invertedDepth'];
- } elseif($invertedDepthOfAjaxRequestedItem) {
+ } elseif($invertedDepthOfAjaxRequestedItem) {
if($v['invertedDepth'] < $invertedDepthOfAjaxRequestedItem) {
$ajaxOutput .= $itemHTML;
} else {
$icon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($isOpen?'minus':'plus').'only.gif').' 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
// If the mount is expanded, go down:
if ($isOpen)
- $this->getFolderTree($val['path'], 999);
+ $this->getFolderTree($val['path'], 999, $val['type']);
// Add tree:
$treeArr = array_merge($treeArr, $this->tree);
* @return integer The count of items on the level
* @see getBrowsableTree()
*/
- function getFolderTree($files_path, $depth=999) {
+ function getFolderTree($files_path, $depth=999, $type='') {
// This generates the directory tree
$dirs = t3lib_div::get_dirs($files_path);
sort($dirs);
$c = count($dirs);
-
+
$depth = intval($depth);
$HTML = '';
$a = 0;
$nextCount = $this->getFolderTree(
$path,
$depth-1,
- $this->makeHTML ? '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($a == $c ? 'blank' : 'line').'.gif','width="18" height="16"').' alt="" />' : ''
+ $this->makeHTML ? '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($a == $c ? 'blank' : 'line').'.gif','width="18" height="16"').' alt="" />' : '',
+ $type
);
$exp = 1; // Set "did expand" flag
} else {
if ($this->makeHTML) {
$HTML = $this->PMicon($row,$a,$c,$nextCount,$exp);
- $icon = 'gfx/i/_icon_'.t3lib_BEfunc::getPathType_web_nonweb($path).'folders.gif';
+ $webpath = t3lib_BEfunc::getPathType_web_nonweb($path);
+ $icon = 'gfx/i/_icon_' .$webpath . 'folders' . ($type == 'readonly' ? '_ro' : '') . '.gif';
if ($val == '_temp_') {
$icon = 'gfx/i/sysf.gif';
$row['title']='TEMP';
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.filelistfoldertree.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.filelistfoldertree.php']);
}
+
?>
\ No newline at end of file