Howdy, as part of a small intranet environment, I'm attempting to create an html document browser . I want to keep everything in one file (in my case, index.php). This file has two functions:
Display a dynamic menu (in my case a pulldown selectbox) of all the documents in specified directory. The links generated contain in their querystring, both the filepath and the document itself.
Display the file specified in the query string (the documents themselves have no headers and footers, they use the common ones in this main display file.)
So far so good, this I can do without a problem. Making this a bit more advanced is where I'm at a lost and not sure how to proceed:
I would like for the dopdown menu to only specify the contents of the current directorypath specified in the querystring. If no directorypath is specified, the menu should display elements from the root folder (a hardcoded specified directory in the script that is, not the actual html documents root on the server).
I'd also like for the menu array to both contain sub-directories and documents. If the array element is a directory, the querystring will only specify a path, while a document would specify both the path and the document name in the querystring.
So if the page is loaded and no document is specified in the querystring, I'd have it load some default page, but the menu will change to reflect the contents of that directory.
If a document is specified in the querystring, the document in question is loaded via an include but the menu stays the same since users remain on the same level.
This should be simple enough, but it gets even harder here I think:
Finally, while the above would allow users to explore deeper and deeper into the directory structure, I'd like to automaticaly prepend a link to the previous level up as the first element of the menu (except for the root).
Maybe I'm missing something obvious or if I'm not clear, I will try to explain this another way. In any case, thanks for looking into this and possibly help me!
Thank you!!!
Steph