You are here

function s3fs_cors_admin_form in S3 File System CORS Upload 7

Builds the Admin form.

1 string reference to 's3fs_cors_admin_form'
s3fs_cors_menu in ./s3fs_cors.module
Implements hook_menu().

File

./s3fs_cors.admin.inc, line 11
Administration form setup for S3 File System CORS Upload.

Code

function s3fs_cors_admin_form() {
  $config = _s3fs_get_config();
  $form = array();
  $form['s3fs_cors_origin'] = array(
    '#type' => 'textfield',
    '#title' => t('CORS Origin'),
    '#description' => t('Please enter the URL from which your users access this website, e.g. <i>www.example.com</i>.
      You may optionally specifiy up to one wildcard, e.g. <i>*.example.com</i>.<br>
      Upon submitting this form, if this field is filled, your S3 bucket will be configured to allow CORS
      requests from the specified origin. If the field is empty, your bucket\'s CORS config will be deleted.'),
    '#default_value' => !empty($config['cors_origin']) ? $config['cors_origin'] : '',
  );
  $form = system_settings_form($form);
  $form['#submit'][] = '_s3fs_cors_admin_form_submit';
  $form['actions']['submit']['#value'] = 'Apply CORS Config';
  return $form;
}