You are here

function bueditor_write_editor in BUEditor 7

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

Update/insert an editor.

4 calls to bueditor_write_editor()
bueditor_editor_submit in admin/bueditor.admin.inc
Editor form submission.
bueditor_eop_copy in admin/bueditor.admin.inc
Editor copy operation.
bueditor_save_import in admin/bueditor.admin.inc
Save imported editor data. Save icons and library files into specified editor path.
bueditor_selaction_submit in admin/bueditor.admin.inc
Selected buttons actions form submission.

File

admin/bueditor.admin.inc, line 912

Code

function bueditor_write_editor($editor, $buttons = array()) {
  if (isset($editor->spriteon) && $editor->spriteon) {
    include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'bueditor') . '/admin/bueditor.sprite.inc';
    $editor->spritename = bueditor_sprite($editor, $buttons);
  }
  if (drupal_write_record('bueditor_editors', $editor, bueditor_isupdate($editor, 'eid'))) {
    foreach ($buttons as $button) {
      $button->eid = $editor->eid;
      drupal_write_record('bueditor_buttons', $button, bueditor_isupdate($button, 'bid'));
    }
    return $editor;
  }
  return FALSE;
}