You are here

function encrypt_file_key_settings_form in Encrypt 7.3

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

Settings form for our key provider.

1 string reference to 'encrypt_file_key_settings_form'
encrypt_file_encrypt_key_providers in plugins/key_providers/file.inc
Implements MODULE_FILENAME_encrypt_key_providers().

File

plugins/key_providers/file.inc, line 50
Plugin definition for the File key provider.

Code

function encrypt_file_key_settings_form($defaults) {
  $form = array();
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to Key File'),
    '#description' => t('Filepath may be absolute (e.g. %abs) or relative to the Drupal directory (e.g. %rel).', array(
      '%abs' => '/var/www',
      '%rel' => '../../keys',
    )),
    '#default_value' => isset($defaults['path']) ? $defaults['path'] : '',
    '#element_validate' => array(
      'encrypt_file_key_path_validate',
    ),
    '#required' => TRUE,
    '#field_suffix' => '/' . ENCRYPT_FILE_NAME,
  );
  $form['method'] = array(
    '#type' => 'select',
    '#title' => t('Method'),
    '#options' => array(
      'file_contents' => t('File Contents'),
      'md5' => t('MD5'),
    ),
    '#default_value' => isset($defaults['method']) ? $defaults['method'] : 'file_contents',
  );
  return $form;
}