function key_provider_file_build_configuration_form in Key 7.3
Build the plugin configuration form.
Return value
array The plugin configuration form.
1 string reference to 'key_provider_file_build_configuration_form'
File
- plugins/
key_provider/ file.inc, line 41
Code
function key_provider_file_build_configuration_form($form, &$form_state) {
$config = $form_state['storage']['key_config'];
$plugin_config = $form_state['storage']['key_config']['key_provider_settings'] + key_provider_file_default_configuration();
$form['file_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' => $plugin_config['file_location'],
'#required' => TRUE,
);
// If this is for an encryption key.
$key_type = key_get_plugin('key_type', $config['key_type']);
if ($key_type['group'] == 'encryption') {
// Add an option to indicate that the value is Base64-encoded.
$form['base64_encoded'] = array(
'#type' => 'checkbox',
'#title' => t('Base64-encoded'),
'#description' => t('Checking this will store the key with Base64 encoding.'),
'#default_value' => $plugin_config['base64_encoded'],
);
}
return $form;
}