You are here

function s3fs_form_system_file_system_settings_alter in S3 File System 7.3

Same name and namespace in other branches
  1. 7.2 s3fs.module \s3fs_form_system_file_system_settings_alter()

Implements hook_form_FORM_ID_alter().

Disables the "file system path" fields from the system module's file_system_settings form when s3fs is taking them over. They do have an effect if the user makes use of the s3fs-copy-local drush commands, but we don't want users to think of these fields as being meaningful once s3fs has already taken over.

File

./s3fs.module, line 184
Hook implementations and other primary functionality for S3 File System.

Code

function s3fs_form_system_file_system_settings_alter(&$form, &$form_state, $form_id) {
  $config = _s3fs_get_config();
  if (!empty($config['use_s3_for_public'])) {
    $form['file_public_path']['#attributes'] = array(
      'disabled' => 'disabled',
    );
    $form['file_public_path']['#description'] = 'S3 File System has taken control of the public:// filesystem, making this setting irrelevant for typical use.';
  }
  if (!empty($config['use_s3_for_private'])) {
    $form['file_private_path']['#attributes'] = array(
      'disabled' => 'disabled',
    );
    $form['file_private_path']['#description'] = 'S3 File System has taken control of the private:// filesystem, making this setting irrelevant for typical use.';
  }
}