diff options
author | Silvio <silvio@devlet.com.br> | 2010-10-08 15:34:02 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-10-08 15:34:02 -0300 |
commit | ebbcd617393c83364699592dfeca8c6e7c3a578a (patch) | |
tree | cb940bddbed4b1ad1cfcfb1a1e0496dfc5a5ad03 /exif_location/exif_location.module | |
parent | 6715a36dad52d37b54c63c9ccc0f9532d61e1b43 (diff) | |
download | exif-ebbcd617393c83364699592dfeca8c6e7c3a578a.tar.gz exif-ebbcd617393c83364699592dfeca8c6e7c3a578a.tar.bz2 |
CVS update
Diffstat (limited to 'exif_location/exif_location.module')
-rw-r--r-- | exif_location/exif_location.module | 32 |
1 files changed, 21 insertions, 11 deletions
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; } } - -?> |