| 1 |
<?php |
<?php |
| 2 |
// $Id: feature.module,v 1.26 2007/01/08 00:05:31 killes Exp $ |
// $Id: feature.module,v 1.25.2.1 2007/01/31 21:08:22 dww Exp $ |
| 3 |
|
|
| 4 |
define('FEATURE_CATEGORY_LIST', 'feature_category_list'); |
define('FEATURE_CATEGORY_LIST', 'feature_category_list'); |
| 5 |
|
|
| 202 |
|
|
| 203 |
function feature_admin_delete() { |
function feature_admin_delete() { |
| 204 |
$fid = (int)arg(3); |
$fid = (int)arg(3); |
| 205 |
if ($fid) { |
if (feature_get($fid)) { |
| 206 |
if ($_POST['confirm']) { |
return drupal_get_form('feature_admin_delete_confirm', $fid); |
| 207 |
db_query("DELETE FROM {feature} WHERE fid = %d", $fid); |
} |
| 208 |
drupal_set_message(t('The feature has been deleted.')); |
else { |
| 209 |
drupal_goto('admin/feature'); |
drupal_set_message(t('You requested to delete an invalid feature.')); |
| 210 |
} |
drupal_goto('admin/feature'); |
|
else { |
|
|
return drupal_get_form('feature_admin_delete_confirm', $fid); |
|
|
} |
|
| 211 |
} |
} |
| 212 |
} |
} |
| 213 |
|
|
| 214 |
function feature_admin_delete_confirm($fid) { |
function feature_admin_delete_confirm($fid) { |
| 215 |
$feature = feature_get($fid); |
$feature = feature_get($fid); |
| 216 |
|
$form['fid'] = array('#type' => 'value', '#value' => $fid); |
| 217 |
return confirm_form( |
return confirm_form( |
| 218 |
array(), |
$form, |
| 219 |
t('Are you sure you want to delete feature %name?', array('%name' => $feature->name)), |
t('Are you sure you want to delete feature %name?', array('%name' => $feature->name)), |
| 220 |
'admin/feature', |
'admin/feature', |
| 221 |
t('This action cannot be undone.'), |
t('This action cannot be undone.'), |
| 223 |
t('Cancel')); |
t('Cancel')); |
| 224 |
} |
} |
| 225 |
|
|
| 226 |
|
function feature_admin_delete_confirm_submit($form_id, $form_values) { |
| 227 |
|
db_query("DELETE FROM {feature} WHERE fid = %d", $form_values['fid']); |
| 228 |
|
drupal_set_message(t('The feature has been deleted.')); |
| 229 |
|
return 'admin/feature'; |
| 230 |
|
} |
| 231 |
|
|
| 232 |
function feature_admin_list() { |
function feature_admin_list() { |
| 233 |
$categories = _feature_get_categories(); |
$categories = _feature_get_categories(); |
| 234 |
|
|