Tree Menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sheepysheep
Forum Newbie
Posts: 9
Joined: Mon Oct 12, 2009 8:14 am

Tree Menu

Post by sheepysheep »

Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowing users to upload their files to share with each other. They can create folders, but I'm having real trouble working out how to give the folders 'depth', i.e. folder within a folder within a folder...

If I could print out an xml file of the folder structure, that would be amazing, but I have no idea how to go about it. All the folders are stored within a database (with info such as their names, permissions, owners etc), as well as being physically stored on my hard disk (this is all just local at the moment).

If I can make an xml file then I can just use a Flex tree component and save myself a lot of time. If anyone has any other ideas or techniques I'd love to hear about them. Also, at present all the folders are actually stored side by side with each other, its the database that tells them how deep they are, but when I get this tree system up and running i think I'll be in a much better place to sort that out.

Thank you so much for any help in advance,

Dave
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Tree Menu

Post by it2051229 »

it's not as easy as it looks... you need to learn how to do javascripting (learn also how to traverse XML files with javascript) and AJAX request from the server and that's where you start...
sheepysheep
Forum Newbie
Posts: 9
Joined: Mon Oct 12, 2009 8:14 am

Re: Tree Menu

Post by sheepysheep »

Well, I'm dissappointed you haven't given me a full, coded, commented example tree menu ;) - but thank you so much - plenty to get googling about right there!

Thanks,

Dave
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Tree Menu

Post by it2051229 »

yeah like i've said, it's not as easy as it looks.. unless you want to pay for my time to create a lengthy detailed commented code :D
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Tree Menu

Post by josh »

You could use simplexml to generate xml
Post Reply