Thursday, October 19, 2006

A little metadata and object inheritance...

...and suddenly pieces fall together. A file management part of the admin tool now not only imports new sets, but merges your new file selection with the current list, and remembers its association with the database record even if you move or rename the directory. I've stored a bit of metadata in each directory so the path, while stored, doesn't have anything to do with the actual identification of either the record or the directory. That way, users can organize the directory structure the way they like rather than getting forced into a structure that may or may not make sense. When you look at a set of directories in an FTP client, the PHP simply has no way of informing you that you'll break something by renaming folder to folder1 or moving cool stuff into a new my stuff directory. And when it comes down to it, it shouldn't really have to care.

Also, a simple little 16-line database object later, and it has persistent user preferences, and a way to keep you from having to drill down to the same directory every time you open the file manager. Happily, since I've kept the markup for the layout moderately semantic, viewing the contents of a directory with 100 usable files (triple the norm for the current usage) renders a page weighing in at only 40k, including file information and controls for each file. Later on, I'll add some pagination, but at this point I need to finish more than I need to polish.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home