예제 #1
0
function fmGetFolders(){
	global $dir;
	$output ="";
	if(!$dir) $dir = _START_FOLDER;
	$dirs = MFile::getDir($dir,false);
	$isDir = (sizeof($dirs)>0)? true:false;
	if($isDir){
		$firstInfo = MFile::info($dir);
		foreach($dirs as $d){
			$isSub = (MFile::hasSubDir($d->fileName))? 'plus':'spacer';

			$wp ="";
			if( ! $d->isWritable){
				$wp = '<span class=\'writeProtected\'>'.MText::_("write_protected")."</span>";
			}

			$finfo = MText::_('folderpermission')." ".$d->mode.'<br>'.MText::_('owner').": ".$d->owner.'<br>'.$wp;
			$output .= '<li><div class="'.$isSub.'" droppable="folders" ></div><a href="'.MURL::_("xhrfiles",MURL::safePath($d->fileName)).'" class="closed" finfo="'.$finfo.'" url="'.MURL::safePath($d->fileName).'" chmod="'.$d->mode.'"><span>'.$d->baseName.'</span></a>';
			$output .= '<ul id="off" dummy="1"></ul></li>'."\n";
		}//EOF foreach
	}//EOF isDir
	return $output;
}//EOF gmGetFolders