You are here

function key_provider_file_settings_form in Key 7

Same name and namespace in other branches
  1. 7.2 plugins/key_provider/file.inc \key_provider_file_settings_form()

Settings form for the File key provider.

1 string reference to 'key_provider_file_settings_form'
file.inc in plugins/key_provider/file.inc

File

plugins/key_provider/file.inc, line 48

Code

function key_provider_file_settings_form($defaults) {
  $form = array();
  $form['location'] = array(
    '#type' => 'textfield',
    '#title' => t('File location'),
    '#description' => t('The location of the file in which the key will be stored. The path may be absolute (e.g., %abs), relative to the Drupal directory (e.g., %rel), or defined using a stream wrapper (e.g., %str).', array(
      '%abs' => '/etc/keys/foobar.key',
      '%rel' => '../keys/foobar.key',
      '%str' => 'private://keys/foobar.key',
    )),
    '#default_value' => isset($defaults['location']) ? $defaults['location'] : '',
    '#required' => TRUE,
  );
  $form['method'] = array(
    '#type' => 'select',
    '#title' => t('Method'),
    '#description' => t('If the selected method is “File contents”, the contents of the file will be used as entered. If “MD5 hash” is selected, an MD5 hash of the file contents will be used as the key.'),
    '#options' => array(
      'file_contents' => t('File contents'),
      'md5' => t('MD5 hash'),
    ),
    '#default_value' => isset($defaults['provider']) ? $defaults['provider'] : 'file_contents',
  );
  return $form;
}