You are here

function bueditor_delete_editor in BUEditor 7

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

Delete an editor.

1 call to bueditor_delete_editor()
bueditor_delete_form_submit in admin/bueditor.admin.inc
Editor delete form submission.

File

admin/bueditor.admin.inc, line 599

Code

function bueditor_delete_editor($eid) {
  db_delete('bueditor_buttons')
    ->condition('eid', $eid)
    ->execute();
  db_delete('bueditor_editors')
    ->condition('eid', $eid)
    ->execute();

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