You are here

function bueditor_delete_form_submit in BUEditor 6

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_delete_form_submit()
  2. 7 admin/bueditor.admin.inc \bueditor_delete_form_submit()

File

./bueditor.admin.inc, line 369

Code

function bueditor_delete_form_submit($form, &$form_state) {
  $editor = $form['#parameters'][2];
  bueditor_delete_editor($editor->eid);
  drupal_set_message(t('%name editor has been deleted.', array(
    '%name' => $editor->name,
  )));

  //update roles
  $roles = variable_get('bueditor_roles', array());
  foreach ($roles as $rid => $role) {
    $roles[$rid]['editor'] = $editor->eid == $role['editor'] ? 0 : $role['editor'];
    $roles[$rid]['alt'] = $editor->eid == $role['alt'] ? 0 : $role['alt'];
  }
  variable_set('bueditor_roles', $roles);
  $form_state['redirect'] = 'admin/settings/bueditor';
}