You are here

function dynamic_banner_settings_submit in Dynamic Banner 6

Same name and namespace in other branches
  1. 7 includes/callbacks.inc \dynamic_banner_settings_submit()

when the settings form submits this function will save the settings for use

File

includes/callbacks.inc, line 431
Dynamic Banner Admin Pages and various other functions to make them work Most of the code in this file was derived from path module

Code

function dynamic_banner_settings_submit($form, &$form_state) {
  $display = $form_state['values']['display_setting'];
  if ($display == 0) {
    $display = 'url';
  }
  elseif ($display == 1) {
    $display = 'text';
  }
  elseif ($display == 2) {
    $display = 'urltext';
  }
  elseif ($display == 3) {
    $display = 'urllink';
  }
  variable_set('dynamic_banner_display_setting', $display);
  $errors = $form_state['values']['display_errors'];
  if ($errors == 0) {
    variable_set('dynamic_banner_display_errors', TRUE);
  }
  else {
    variable_set('dynamic_banner_display_errors', FALSE);
  }

  // end of saving settings push FAPI to redirect
  $form_state['redirect'] = '/admin/build/banners/';
}