We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15065
    • 138 Posts
    Hi all

    I want to get my folders in fcdeditor in alphabetical order. ( I mean when I tried to insert images to WYSIWYG editor, I click on ’Insert/Edit images’ button , then ’Insert/Edit images’ window appeared. I click on browse to select my image. Then the fckeditor window appeared. It displays all folders and images. I want to get these folders in ascending -alphabetical order. Becacause my images folder contains a lot of folders and images.) How can I do this.?
    My manager/media/browser/mcpuk/connectors/php/Commands/GetFolders.php code is below;
    <?php 
    class GetFolders {
    	var $fckphp_config;
    	var $type;
    	var $cwd;
    	var $actual_cwd;
    	
    	function GetFolders($fckphp_config,$type,$cwd) {
    		$this->fckphp_config=$fckphp_config;
    		$this->type=$type;
    		$this->raw_cwd=$cwd;
    		$this->actual_cwd=str_replace("//","/",($fckphp_config['UserFilesPath']."/$type/".$this->raw_cwd));
    		$this->real_cwd=str_replace("//","/",($this->fckphp_config['basedir']."/".$this->actual_cwd));
    	}
    	
    	function run() {
    		header ("content-type: text/xml");
    		echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
    		?>
    <Connector command="GetFolders" resourceType="<?php echo $this->type; ?>">
    	<CurrentFolder path="<?php echo $this->raw_cwd; ?>" url="<?php echo $this->actual_cwd; ?>" />
    	<Folders>
    		<?php
    		
    			if ($dh=opendir($this->real_cwd)) {
    				while (($filename=readdir($dh))!==false) {
    					if (($filename!=".")&&($filename!="..")) {
    						if (is_dir($this->real_cwd."/$filename")) {
    							
    							//check if$fckphp_configured not to show this folder
    							$hide=false;
    							
    							for($i=0;$i<sizeof($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders']);$i++) 
    								$hide=(ereg($this->fckphp_config['ResourceAreas'][$this->type]['HideFolders'][$i],$filename)?true:$hide);
    							
    							if (!$hide) echo "<Folder name=\"$filename\" />\n";
    							
    						}
    					}
    					
    				}
    							
    				closedir($dh);
    			}
    			
    		?>
    	</Folders>
    </Connector>
    		<?php 
    	}
    }
    ?>
    


    Pls anybody can help me...

    thanks

    jurdi