You are here

function node_convert_template_delete_confirm_submit in Node Convert 6

Same name and namespace in other branches
  1. 7 node_convert.admin.inc \node_convert_template_delete_confirm_submit()

File

./node_convert.module, line 520
The node_convert module converts nodes from one type to another.

Code

function node_convert_template_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    db_query("DELETE FROM {node_convert_templates} WHERE nctid = %d", $form_state['values']['template_id']);
    if ($form_state['values']['delete_action'] == 1) {
      db_query("DELETE FROM {actions} WHERE callback = 'node_convert_convert_action' AND parameters LIKE '%%template\";s:%%:\"%d%%'", $form_state['values']['template_id']);
    }
    else {
      $none = serialize(array(
        'template' => '0',
      ));
      db_query("UPDATE {actions} SET parameters = '%s' WHERE callback = 'node_convert_convert_action' AND parameters LIKE '%%template\";s:%%:\"%d%%'", $none, $form_state['values']['template_id']);
    }
  }
  $form_state['redirect'] = 'admin/build/node_convert_templates';
}