You are here

function bueditor_eop_copy in BUEditor 6.2

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

Editor copy operation.

1 call to bueditor_eop_copy()
bueditor_eop in admin/bueditor.admin.inc
Prepare and execute if there is any valid editor operation that doesn't require form submission.

File

admin/bueditor.admin.inc, line 721

Code

function bueditor_eop_copy($editor, $name) {
  $editor = drupal_clone($editor);
  $buttons = bueditor_buttons($editor->eid);
  $editor->eid = NULL;
  $editor->name = $name ? $name : 'Copy of ' . $editor->name;
  array_walk($buttons, create_function('&$button', '$button->bid = NULL;'));
  if ($editor = bueditor_write_editor($editor, $buttons)) {
    bueditor_message_added($editor->name);
  }
  return $editor;
}