You are here

function onepixelout_admin_form_submit in SWF Tools 6

Same name and namespace in other branches
  1. 5 onepixelout/onepixelout.module \onepixelout_admin_form_submit()
  2. 6.2 onepixelout/onepixelout.admin.inc \onepixelout_admin_form_submit()

File

onepixelout/onepixelout.admin.inc, line 53

Code

function onepixelout_admin_form_submit($form, &$form_state) {
  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
  if ($op == t('Reset to defaults')) {
    variable_del('swftools_' . ONEPIXELOUT);
    drupal_set_message(t('The configuration options have been reset to their default values.'));
  }
  else {

    // Exclude unnecessary elements.
    unset($form_state['values']['submit'], $form_state['values']['reset'], $form_state['values']['form_id'], $form_state['values']['op'], $form_state['values']['form_token'], $form_state['values']['form_build_id']);

    // Store values
    variable_set('swftools_' . ONEPIXELOUT, $form_state['values']);
    drupal_set_message(t('The configuration options have been saved.'));
  }

  // Clear all caches
  drupal_flush_all_caches();
}