Meta Management in Filehandler
Created originally on Bitbucket by lambjs (Josh Lamb)
In order to integrate "simple" tracking of information unrelated to the basic file properties (name, path, size, type, mime-type), we need to add support for meta-data. The end goal will be to have an icon appear when a single file is selected which when clicked, opens up a meta-data editor popup window. Meta will be folder specific, and may optionally inherit from parent folders and/or affect subdirectories.
-
In the pathObj() function, assuming the file exists, generate a unique ID for a file based on the filesize, and an md5 digest of the contents of the file. If the file does not exist, or is a directory, the uid should be null.
-
I've documented the class FilemanagerMetaHandler. Read through the documentation and build the needed class functions.
-
Test this by setting up a simple connection to a database and updating the meta data as described in the example of class A in the filemanager_meta_i interface.
-
Add an icon for meta properties to the images, similar to the copy/paste icons in the bottom left when a file is selected
-
This icon should only appear if a file is selected. Clicking it should open a new jquery popup which should include a form with the rel-path of the clicked file, a region where you'll load the HTML meta form via ajax, and buttons Save and Cancel. Save will make an ajax call using the data from $('#form').serialize(), Cancel will close the window. Configure the ajax path the same way you did for the rest of the filemanager.
-
Create the request handlers in the ajax file to load and save the meta-data from the form using a filemanager_meta_manager() object.
-
Test thoroughly! Try creating two meta_handler classes that apply a name and caption in one, and then another that applies a gallery_id to the gallery subdirectory. Only the name/caption should show up in the root, but all three in the gallery dir. No meta should show up for