You are here

function _s3fs_convert_form_state_to_config in S3 File System 7

Same name and namespace in other branches
  1. 7.3 s3fs.admin.inc \_s3fs_convert_form_state_to_config()
  2. 7.2 s3fs.admin.inc \_s3fs_convert_form_state_to_config()

Converts a $form_state array to a configuration settings array.

1 call to _s3fs_convert_form_state_to_config()
s3fs_settings_validate in ./s3fs.admin.inc
Validates the values on the admin form.

File

./s3fs.admin.inc, line 250
Administration form setup for S3 File System.

Code

function _s3fs_convert_form_state_to_config($form_state) {
  $config = array();
  foreach ($form_state['values'] as $name => $value) {

    // If the name starts with 's3fs_', strip that off and save the value.
    if (substr($name, 0, 5) == 's3fs_') {
      $config[substr($name, 5)] = $value;
    }
  }
  return $config;
}