system_file_system_settings

Versions
5 – 7
system_file_system_settings()

Form builder; Configure the site file handling.

See also

system_settings_form()

Related topics

Code

modules/system/system.admin.inc, line 1525

<?php
function system_file_system_settings() {

  $form['file_public_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Public file system path'),
    '#default_value' => file_directory_path(),
    '#maxlength' => 255,
    '#description' => t('A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'),
    '#after_build' => array('system_check_directory'),
  );

  $form['file_private_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Private file system path'),
    '#default_value' => file_directory_path('private'),
    '#maxlength' => 255,
    '#description' => t('A local file system path where private files will be stored. This directory must exist and be writable by Drupal. This directory should not be accessible over the web.'),
    '#after_build' => array('system_check_directory'),
  );

  $form['file_temporary_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Temporary directory'),
    '#default_value' => file_directory_path('temporary'),
    '#maxlength' => 255,
    '#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web.'),
    '#after_build' => array('system_check_directory'),
  );
  $wrappers = file_get_stream_wrappers();
  $options = array(
    'public' => $wrappers['public']['description'],
    'private' => $wrappers['private']['description']
  );
  $form['file_default_scheme'] = array(
    '#type' => 'radios',
    '#title' => t('Default download method'),
    '#default_value' => 'public',
    '#options' => $options,
    '#description' => t('This setting is used as the preferred download method. The use of public files is more efficient, but does not provide any access control.'),
  );

  return system_settings_form($form, TRUE);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.