function bueditor_editor_submit in BUEditor 7
Same name and namespace in other branches
- 6.2 admin/bueditor.admin.inc \bueditor_editor_submit()
- 6 bueditor.admin.inc \bueditor_editor_submit()
Editor form submission.
1 string reference to 'bueditor_editor_submit'
- bueditor_editor_form in admin/
bueditor.admin.inc - Editor form.
File
- admin/
bueditor.admin.inc, line 429
Code
function bueditor_editor_submit($form, &$form_state) {
$editor = (object) $form_state['values']['editor'];
$buttons = array();
foreach ($form_state['values']['buttons'] as $bid => $button) {
if ($button['title']) {
$button['bid'] = $bid;
$button['content'] = str_replace("\r\n", "\n", $button['content']);
$buttons[] = (object) $button;
}
}
$old = $editor->eid;
if ($editor = bueditor_write_editor($editor, $buttons)) {
$form_state['redirect'] = 'admin/config/content/bueditor/' . $editor->eid;
$old ? drupal_set_message(t('The changes have been saved.')) : bueditor_message_added($editor->name);
}
}