function wysiwyg_profile_form_submit in Wysiwyg 5
Same name and namespace in other branches
- 5.2 wysiwyg.admin.inc \wysiwyg_profile_form_submit()
- 6.2 wysiwyg.admin.inc \wysiwyg_profile_form_submit()
- 6 wysiwyg.admin.inc \wysiwyg_profile_form_submit()
- 7.2 wysiwyg.admin.inc \wysiwyg_profile_form_submit()
Submit callback for Wysiwyg profile form.
See also
File
- ./
wysiwyg.admin.inc, line 320 - Integrate Wysiwyg editors into Drupal.
Code
function wysiwyg_profile_form_submit($form_id, &$form_values) {
if (isset($form_values['buttons'])) {
// Store only enabled buttons for each plugin.
foreach ($form_values['buttons'] as $plugin => $buttons) {
$form_values['buttons'][$plugin] = array_filter($form_values['buttons'][$plugin]);
}
// Store only enabled plugins.
$form_values['buttons'] = array_filter($form_values['buttons']);
}
// Remove input format name.
$format = $form_values['format'];
$input_format = $form_values['input_format'];
$editor = $form_values['editor'];
unset($form_values['format'], $form_values['input_format'], $form_values['editor']);
// Remove FAPI values.
// @see system_settings_form_submit()
unset($form_values['submit'], $form_values['form_id'], $form_values['op'], $form_values['form_token']);
// Insert new profile data.
db_query("UPDATE {wysiwyg} SET settings = '%s' WHERE format = %d", serialize($form_values), $format);
drupal_set_message(t('Wysiwyg profile for %format has been saved.', array(
'%format' => $input_format,
)));
drupal_goto('admin/settings/wysiwyg/profile');
}