summaryrefslogtreecommitdiff
path: root/modules/exif/helpers/exif_installer.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-09-20 20:59:18 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-09-20 20:59:18 -0700
commita00619b812393cf73d1c188af7961af820d36185 (patch)
treed19e6bf187c56bfc0a4c72db2adfb5e9560aa154 /modules/exif/helpers/exif_installer.php
parent09f998e7a5a58720636c7b1140279b5efbdb33c6 (diff)
* Move the captured field into the exif module where it is created and populated.
* Create a new API event get_sort_fields that allows modules to contribute new sort fields that they manage. the only condition is that the module needs to add it to the item table. * Changed g2_import to call this api to get the allowable sort fields * Changed album::get_edit_form to call this new api to get the available sort fields Partial fix for ticket #627, as the Capture date is not available until the exif module is installed.
Diffstat (limited to 'modules/exif/helpers/exif_installer.php')
-rw-r--r--modules/exif/helpers/exif_installer.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/exif/helpers/exif_installer.php b/modules/exif/helpers/exif_installer.php
index 66226061..b826224a 100644
--- a/modules/exif/helpers/exif_installer.php
+++ b/modules/exif/helpers/exif_installer.php
@@ -29,6 +29,12 @@ class exif_installer {
PRIMARY KEY (`id`),
KEY(`item_id`))
DEFAULT CHARSET=utf8;");
+
+
+ $item_fields = $db->list_fields("items");
+ if (empty($item_fields["captured"])) {
+ $db->query("ALTER TABLE {items} ADD COLUMN `captured` int(9) default NULL");
+ }
module::set_version("exif", 1);
}
@@ -41,6 +47,8 @@ class exif_installer {
}
static function uninstall() {
- Database::instance()->query("DROP TABLE IF EXISTS {exif_records};");
+ $db = Database::instance();
+ $db->query("DROP TABLE IF EXISTS {exif_records};");
+ $db->query("ALTER TABLE {items} DROP COLUMN `captured`");
}
}