You are here

function stage_file_proxy_admin in Stage File Proxy 7

Page callback/form for admin interface.

1 string reference to 'stage_file_proxy_admin'
stage_file_proxy_menu in ./stage_file_proxy.module
Implements hook_menu().

File

./stage_file_proxy.module, line 130
Stage File Proxy Module.

Code

function stage_file_proxy_admin() {
  $form = array();
  $form['stage_file_proxy_origin'] = array(
    '#type' => 'textfield',
    '#title' => t('The origin website.'),
    '#default_value' => variable_get('stage_file_proxy_origin', ''),
    '#description' => t("The origin website. For example: 'http://example.com' with no trailing slash.\n      If the site is using HTTP Basic Authentication (the browser popup for username and password) you can\n      embed those in the url. Be sure to URL encode any special characters:<br/><br/>For example, setting a user\n      name of 'myusername' and password as, 'letme&in' the configuration would be the following: <br/><br/>\n      'http://myusername:letme%26in@example.com';"),
    '#required' => FALSE,
  );
  $form['stage_file_proxy_origin_dir'] = array(
    '#type' => 'textfield',
    '#title' => t('The origin directory.'),
    '#default_value' => variable_get('stage_file_proxy_origin_dir', variable_get('file_public_path', conf_path() . '/files')),
    '#description' => t('If this is set then Stage File Proxy will use a different path for the remote
      files. This is useful for multisite installations where the sites directory contains different names
      for each url. If this is not set, it defaults to the same path as the local site.'),
    '#required' => FALSE,
  );
  $form['stage_file_proxy_use_imagecache_root'] = array(
    '#type' => 'checkbox',
    '#title' => t('Imagecache Root.'),
    '#default_value' => variable_get('stage_file_proxy_use_imagecache_root', TRUE),
    '#description' => t("If this is true (default) then Stage File Proxy will look for /imagecache/ in\n      the URL and determine the original file and request that rather than the\n      processed file, then send a header to the browser to refresh the image and let\n      imagecache handle it. This will speed up future imagecache requests for the\n      same original file."),
    '#required' => FALSE,
  );
  $form['stage_file_proxy_hotlink'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hotlink.'),
    '#default_value' => variable_get('stage_file_proxy_hotlink', FALSE),
    '#description' => t("If this is true then Stage File Proxy will not transfer the remote file to the\n      local machine, it will just serve a 301 to the remote file and let the origin webserver handle it."),
    '#required' => FALSE,
  );
  $form['stage_file_proxy_excluded_extensions'] = array(
    '#type' => 'textfield',
    '#title' => t('Excluded Extensions.'),
    '#default_value' => variable_get('stage_file_proxy_excluded_extensions', ''),
    '#description' => t("A comma separated list of the extensions that will not be fetched by Stage File Proxy if Hotlinking is disabled. For example: 'mp3,ogg'"),
    '#required' => FALSE,
  );
  $form['stage_file_proxy_sslversion'] = array(
    '#type' => 'textfield',
    '#title' => t('SSL Version.'),
    '#default_value' => variable_get('stage_file_proxy_sslversion', 3),
    '#description' => t('CURL will try to figure out which ssl version to use, but if it fails to do that
      properly it can lead to getting an empty file and a 0 status code. The default is 3 which seems
      relatively common, but if you get 0 byte files you can try changing it to 2.'),
    '#size' => 2,
    '#maxlength' => 2,
    '#required' => FALSE,
  );
  $form['stage_file_proxy_headers'] = array(
    '#type' => 'textarea',
    '#title' => t('HTTP headers.'),
    '#default_value' => variable_get('stage_file_proxy_headers', ''),
    '#description' => t('When Stage File Proxy is configured to transfer the remote file to local machine, it will use this headers for HTTP request. Use format like "Referer|http://example.com/".'),
    '#required' => FALSE,
  );
  return system_settings_form($form);
}