/[drupal]/contributions/modules/location/contrib/location_cck/location_cck.module
ViewVC logotype

Diff of /contributions/modules/location/contrib/location_cck/location_cck.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5.2.17, Thu Jul 30 17:27:51 2009 UTC revision 1.5.2.18, Thu Jul 30 20:58:43 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: location_cck.module,v 1.5.2.16 2009/07/28 19:17:43 bdragon Exp $  // $Id: location_cck.module,v 1.5.2.17 2009/07/30 17:27:51 bdragon Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 148  function location_cck_field($op, &$node, Line 148  function location_cck_field($op, &$node,
148        return array($field['field_name'] => $locations);        return array($field['field_name'] => $locations);
149    
150      case 'delete':      case 'delete':
151        // Run through the revisions and clean up all applicable references.        // Use the CCK storage to figure out the vids that need to be deleted,
152        $result = db_query('SELECT vid FROM {node_revisions} WHERE nid = %d', $node->nid);        // and clean up all the applicable references.
153          $db_info = content_database_info($field);
154          $result = db_query('SELECT vid FROM {'. $db_info['table'] .'} WHERE nid = %d', $node->nid);
155        while ($row = db_fetch_object($result)) {        while ($row = db_fetch_object($result)) {
156          $genid = 'cck:'. $field['field_name'] .':'. $row->vid;          $genid = 'cck:'. $field['field_name'] .':'. $row->vid;
157          $locs = array();          $locs = array();
# Line 297  function theme_location_cck_formatter_de Line 299  function theme_location_cck_formatter_de
299    if (!empty($location['cck_preview_in_progress'])) {    if (!empty($location['cck_preview_in_progress'])) {
300      // Our canary field is in place, we are in a node preview.      // Our canary field is in place, we are in a node preview.
301      $fields = array();      $fields = array();
302      // If the delete location checkbox isn't checked, and the location isn't      // If the location isn't "empty", then theme it based on the current state
303      // "empty", then theme it based on the current state of the item.      // of the item.
304      if (!location_is_empty($location, $fields) && empty($location['delete_location'])) {      if (!location_is_empty($location, $fields)) {
305        return theme('location', $location, $hide);        return theme('location', $location, $hide);
306      }      }
307    }    }
# Line 321  function theme_location_cck_formatter_al Line 323  function theme_location_cck_formatter_al
323    if (!empty($location['cck_preview_in_progress'])) {    if (!empty($location['cck_preview_in_progress'])) {
324      // Our canary field is in place, we are in a node preview.      // Our canary field is in place, we are in a node preview.
325      $fields = array();      $fields = array();
326      // If the delete location checkbox isn't checked, and the location isn't      // If the location isn't "empty", then theme it based on the current state
327      // "empty", then theme it based on the current state of the item.      // of the item.
328      if (!location_is_empty($location, $fields) && empty($location['delete_location'])) {      if (!location_is_empty($location, $fields)) {
329        $content = theme('location', $location, $hide);        $content = theme('location', $location, $hide);
330      }      }
331    }    }

Legend:
Removed from v.1.5.2.17  
changed lines
  Added in v.1.5.2.18

  ViewVC Help
Powered by ViewVC 1.1.2