function _key_update_key_provider in Key 7.3
Update the key provider plugin.
Parameters
array $config: The key configuration.
1 call to _key_update_key_provider()
- key_config_form in includes/
key.admin.inc - Form constructor for the key configuration form.
File
- includes/
key.admin.inc, line 618 - Administrative functionality for managing key configurations.
Code
function _key_update_key_provider(&$form_state, &$config) {
$key_provider = key_get_plugin('key_provider', $form_state['values']['key_provider']);
$original_key = isset($form_state['storage']['original_key']) ? $form_state['storage']['original_key'] : NULL;
// If the original key's plugin ID matches the existing one.
if ($original_key['key_provider'] == $key_provider['name']) {
// Use the configuration from the original key's plugin.
$plugin_config = $original_key['key_provider_settings'];
}
elseif ($default_configuration_function = ctools_plugin_get_function($key_provider, 'default configuration')) {
// Use the plugin's default configuration.
$plugin_config = call_user_func($default_configuration_function);
}
else {
$plugin_config = array();
}
$config['key_provider'] = $form_state['values']['key_provider'];
$config['key_provider_settings'] = $plugin_config;
$form_state['values']['key_provider_settings'] = $plugin_config;
$form_state['values']['key_provider_settings'] = $plugin_config;
}