You are here

function calendar_systems_profile_overview_submit in Calendar Systems 6

Same name and namespace in other branches
  1. 8 calendar_systems.admin.inc \calendar_systems_profile_overview_submit()
  2. 6.3 calendar_systems.admin.inc \calendar_systems_profile_overview_submit()
  3. 7.3 calendar_systems.admin.inc \calendar_systems_profile_overview_submit()
  4. 7 calendar_systems.admin.inc \calendar_systems_profile_overview_submit()
  5. 7.2 calendar_systems.admin.inc \calendar_systems_profile_overview_submit()

Submit callback for Calendar systems profile overview form.

File

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

Code

function calendar_systems_profile_overview_submit($form, &$form_state) {
  foreach ($form_state['values']['formats'] as $format => $values) {
    if ($values['editor'] != 'default') {
      db_query("UPDATE {calendar_systems} SET calendar_system = '%s' WHERE language = '%s'", $values['editor'], $format);
      if (!db_affected_rows()) {
        db_query("INSERT INTO {calendar_systems} (language, calendar_system) VALUES ('%s', '%s')", $format, $values['editor']);
      }
    }
  }
}