wiki:CleanUp/CodeReorganization

Currently there are at least 3 places in the admin folder, which implement their own code for uploading images. It would be a lot easier to update/fix bugs in the code, if there would be some kind of library that contains share functionality.

After discussing this with Michael, we agreed that for sake of consistency we should stick with imperative style.

So I'd say we should have 2 files: plog-functions in the plogger directory, which would contains the following functions (prefixed with plogger_, so the file can be included without name clashes from other applications - like WordPress? - as well)

* plogger_get_collection_by_id()
* plogger_get_collection_by_name()
* plogger_get_album_by_id()
* plogger_get_album_by_name()
* plogger_get_picture_by_id()
* plogger_get_comment_by_id()
* plogger_add_comment()

More can be added later. This would also be the start of solution to ticket #14

Another file: plog-admin-functions.php should reside in the admin directory and would contain the following functions

* update_comment()
* delete_comment()
* update_collection()
* add_collection()
* update_album()
* add_album()
* update_picture()
* add_picture()

Basically, it would contain all functions that are in some way related to the admin interface (editing things). Also, the admin interface will also need functions from plog-functions, therefore it will include both files.

Please let me know what you think of that idea.

Attachments