Re: Object or such for building a directory tree?

From: Date: Sat, 01 May 2010 15:54:45 +0000
Subject: Re: Object or such for building a directory tree?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-304810@lists.php.net to get a copy of this message
At 1:59 PM +0200 5/1/10, Michelle Konzack wrote:
Hello *, before I reinvent the wheel, I ask here, if someone know an "object" or "function" which build from an array of directories (filesystem or IMAP) a directory tree which can be opened and close? I have the need to do this for a "local and remote filesystem" and a "courier-imap tree". Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
Hi Michelle: You have one of the longest signature files I've seen in a while. If at all possible, please trim it for the archives. Now on to your problem. You want to take a multidimensional array that contains the names of directories and names of the files contained therein and show them in a file tree where you can open and close the nodes of the tree to show contents -- is that correct? It's pretty simple to populate an array in PHP to contain directories and files. To do this via PHP can produce something like this: http://php1.net/b/file-browser I'm not happy with the result because it doesn't show a file tree complete with clickable nodes. While I am sure it's possible to do this in PHP, I was thinking that javascript might provide a better functional solution (i.e., client-side with less trips to the server). Namely have PHP create the array and then have javascript show it. This is what I found: http://labs.abeautifulsite.net/projects/js/jquery/fileTree/demo/ It works for me. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#304810) next »