You are here

function disclaimer_admin_settings_submit in Disclaimer 6.2

Same name and namespace in other branches
  1. 6 disclaimer.admin.inc \disclaimer_admin_settings_submit()
  2. 7 disclaimer.admin.inc \disclaimer_admin_settings_submit()

Submit function for the general configuration form.

1 string reference to 'disclaimer_admin_settings_submit'
disclaimer_admin_settings in ./disclaimer.admin.inc

File

./disclaimer.admin.inc, line 322
Admin page callbacks for the disclaimer module.

Code

function disclaimer_admin_settings_submit($form, &$form_state) {
  if ($form_state['values']['disclaimer_input_format']) {
    variable_set('disclaimer_content_format', $form_state['values']['disclaimer_input_format']);
  }
  if ($form_state['values']['disclaimer_footer_input_format']) {
    variable_set('disclaimer_content_footer_format', $form_state['values']['disclaimer_footer_input_format']);
  }
  $validators = array(
    'file_validate_extensions' => array(
      'gif jpg jpeg png',
    ),
  );

  // Save new file uploads.
  if ($file = file_save_upload('disclaimer_enter_img', $validators, file_directory_path(), FILE_EXISTS_REPLACE)) {
    file_set_status($file, FILE_STATUS_PERMANENT);
    variable_set('disclaimer_enter_img_path', $file->filepath);
  }
  if ($file = file_save_upload('disclaimer_exit_img', $validators, file_directory_path(), FILE_EXISTS_REPLACE)) {
    file_set_status($file, FILE_STATUS_PERMANENT);
    variable_set('disclaimer_exit_img_path', $file->filepath);
  }
}