You are here

function calendar_systems_profile_form_submit in Calendar Systems 6.3

Same name and namespace in other branches
  1. 6 calendar_systems.admin.inc \calendar_systems_profile_form_submit()

Submit callback for Calendar systems profile form.

See also

calendar_systems_profile_form()

File

./calendar_systems.admin.inc, line 293
Integrate Calendar systems editors into Drupal.

Code

function calendar_systems_profile_form_submit($form, &$form_state) {
  exit;
  $values = $form_state['values'];
  if (isset($values['buttons'])) {

    // Store only enabled buttons for each plugin.
    foreach ($values['buttons'] as $plugin => $buttons) {
      $values['buttons'][$plugin] = array_filter($values['buttons'][$plugin]);
    }

    // Store only enabled plugins.
    $values['buttons'] = array_filter($values['buttons']);
  }

  // Remove input format name.
  $format = $values['format'];
  $input_format = $values['input_format'];
  $editor = $values['editor'];
  unset($values['format'], $values['input_format'], $values['editor']);

  // Remove FAPI values.
  // @see system_settings_form_submit()
  unset($values['submit'], $values['form_id'], $values['op'], $values['form_token']);

  // Insert new profile data.
  db_query("UPDATE {calendar_systems} SET settings = '%s' WHERE language = %d", serialize($values), $format);
  drupal_set_message(t('Calendar systems profile for %format has been saved.', array(
    '%format' => $input_format,
  )));
  $form_state['redirect'] = 'admin/settings/calendar_systems';
}