function feeds_tamper_ui_delete_form in Feeds Tamper 6
Same name and namespace in other branches
- 7 feeds_tamper_ui/feeds_tamper_ui.admin.inc \feeds_tamper_ui_delete_form()
1 string reference to 'feeds_tamper_ui_delete_form'
- feeds_tamper_ui_menu in feeds_tamper_ui/
feeds_tamper_ui.module - Implementation of hook_menu().
File
- feeds_tamper_ui/
feeds_tamper_ui.admin.inc, line 454 - Forms and their accompanying validation and submit functions for Feeds Tamper UI.
Code
function feeds_tamper_ui_delete_form(&$form_state, $instance) {
if (!$instance) {
drupal_set_message(t('Invalid plugin id.'), 'error');
return;
}
$form = array();
// Set breadcrumb.
$importer = feeds_importer($instance->importer);
$crumb = drupal_get_breadcrumb();
$crumb[] = l(t('Tamper plugins: @importer', array(
'@importer' => $importer->config['name'],
)), FEEDS_TAMPER_UI_BASE . '/list/' . $importer->id);
drupal_set_breadcrumb($crumb);
$form_state['storage']['instance'] = $instance;
if ($instance->export_type & EXPORT_IN_CODE) {
$question = t('Would you really like to revert the plugin @instance?', array(
'@instance' => $instance->description,
));
$button_label = t('Revert');
}
else {
$question = t('Would you really like to delete the plugin @instance?', array(
'@instance' => $instance->description,
));
$button_label = t('Delete');
}
return confirm_form($form, $question, FEEDS_TAMPER_UI_BASE . '/list/' . $instance->importer, NULL, $button_label);
}