| 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 |
| 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(); |
| 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 |
} |
} |
| 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 |
} |
} |