I've had some free time and decided I'd try and create a browseable folder tree. Here is what I have so far, again it uses the same files.lst file as the search I created but a newer version of it. So it will only show the folders that the current user has access to.
If you click on one of the folders it will take you to that folder so you must use the arrows to browse it.
You can see a preview of it HERE Note: The preview is not the most current version.
To use, just simply use the files.lst file and place the swf/html file somewhere in your vfs/template.
Comments/suggestions please.
The latest version I've made should work and have the following features.
- Flash Cookies - Retain the directory structure between pages, so no need to redownload files.lst. It will check if the information is more than 1 hour old and redownload if necessary.
- Auto Expand - Automatically expand to the current folder.
- Default Files.lst - No longer needing the custom files.tpl file, Work off of the hfs default.
- Manual Update - Right Click and select "Update" to redownload the files.lst and retrieve any changes in the vfs.
- Clickable Folders - Double Click on the folder to open it in the current window. One click will Expand/Minimize the folder.
- Restricted Access - Automatically updates when logged in user changes and protected folders become avaliable.
Auto Expand: To use the auto expand you have to pass the current url to the tree either by a querystring or flashvars in a variable called "current_location". I recommend the use of flashvars as that way the .swf is cached and not redownloaded every time the user changes the page.
Restricted Access: You need to pass the name of the current user to the tree same way as you do with the url, but this time inside the "user" variable.
you can use this code as an example to automatically send the variable if you are calling it from the template and not the html file.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400">
<param name="movie" value="relative path to folder tree.swf">
<param name="quality" value="high">
<param name="FlashVars" value="current_location=http://%host%%folder%&user=%user%">
<embed src="relative path to folder tree.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400" flashvars="current_location=http://%host%%folder%&user=%user%"></embed>
</object>