diff options
Diffstat (limited to 'exif_location')
-rw-r--r-- | exif_location/CVS/Entries | 6 | ||||
-rw-r--r-- | exif_location/exif_location.info | 1 | ||||
-rw-r--r-- | exif_location/exif_location.install | 15 | ||||
-rw-r--r-- | exif_location/exif_location.module | 32 |
4 files changed, 37 insertions, 17 deletions
diff --git a/exif_location/CVS/Entries b/exif_location/CVS/Entries index 61c0fea..cb74d2f 100644 --- a/exif_location/CVS/Entries +++ b/exif_location/CVS/Entries @@ -1,4 +1,4 @@ -/exif_location.info/1.1/Thu Oct 7 21:44:03 2010// -/exif_location.install/1.1/Thu Oct 7 21:44:03 2010// -/exif_location.module/1.1/Thu Oct 7 21:44:03 2010// +/exif_location.info/1.1.2.2/Fri Oct 8 18:33:46 2010//TDRUPAL-6--1 +/exif_location.install/1.1.2.4/Fri Oct 8 18:33:46 2010//TDRUPAL-6--1 +/exif_location.module/1.1.2.4/Fri Oct 8 18:33:46 2010//TDRUPAL-6--1 D diff --git a/exif_location/exif_location.info b/exif_location/exif_location.info index 1eaa37a..3702dbb 100644 --- a/exif_location/exif_location.info +++ b/exif_location/exif_location.info @@ -1,5 +1,6 @@ name = EXIF Location description = "Sets a node location based on EXIF info in image." core = 6.x +version = "6.x-0.1" dependencies[] = exif diff --git a/exif_location/exif_location.install b/exif_location/exif_location.install index a1fb871..3ccb94f 100644 --- a/exif_location/exif_location.install +++ b/exif_location/exif_location.install @@ -1,12 +1,21 @@ <?php +// $Id: exif_location.install,v 1.1.2.4 2010/10/08 17:57:43 rapsli Exp $ + +/** + * @file This is the exif location install part + */ /* - * Hook sets weight must be less than exif module (zero by default). + * Hook sets weight must be higher than exif module (-10), but lower than location (0 by default). */ function exif_location_install() { $ret = array(); - $ret[] = db_query("UPDATE {system} SET weight = 2 WHERE name = 'exif_location'"); + $ret[] = db_query("UPDATE {system} SET weight = -2 WHERE name = 'exif_location'"); return $ret; } -?> +function exif_location_update_6001() { + $return = array(); + $return[] = update_sql("UPDATE {system} SET weight = -2 WHERE name = 'exif_location'"); + return $return; +}
\ No newline at end of file diff --git a/exif_location/exif_location.module b/exif_location/exif_location.module index f0d5093..b353184 100644 --- a/exif_location/exif_location.module +++ b/exif_location/exif_location.module @@ -1,12 +1,21 @@ <?php +// $Id: exif_location.module,v 1.1.2.4 2010/10/08 17:57:43 rapsli Exp $ -/* - * Hook nodeapi. +/** + * implementation of hook_nodeapi + * @param stdClass $node + * @param string $op + * @param string $a3 + * @param string $a4 */ - function exif_location_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { - switch($op) { - case 'presave': + switch ($op) { + case 'update': + //we are only going to update if we have said so + if (!variable_get('exif_update', TRUE)) { + break; + } + case 'insert': $lid = 0; /* Go get the location from EXIF fields */ if (is_array($node->field_gps_gpslongitude) && @@ -20,7 +29,8 @@ function exif_location_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { */ $node->locations[$lid]['longitude'] = $longitude; $node->locations[$lid]['latitude'] = $latitude; - } else { + } + else { $node->locations[$lid] = array( 'longitude' => $longitude, @@ -40,10 +50,12 @@ function exif_location_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { } } -/* - * Hook form_alter. +/** + * Implementation of hook_form_alter + * @param array $form + * @param array $form_state + * @param array $form_id */ - function exif_location_form_alter(&$form, $form_state, $form_id) { /* Comment out the return below to enable this */ return; @@ -54,5 +66,3 @@ function exif_location_form_alter(&$form, $form_state, $form_id) { $form['locations']['#access'] = FALSE; } } - -?> |