You are here

function _key_create_plugin_form_state in Key 7.3

Creates a form state for a plugin.

Parameters

string $type: The plugin type ID.

array $form_state: The form state to copy values from.

Return value

array A copy of the form state with values from the plugin.

4 calls to _key_create_plugin_form_state()
key_config_form in includes/key.admin.inc
Form constructor for the key configuration form.
key_config_form_submit in includes/key.admin.inc
Form submission handler for key_config_form().
key_config_form_validate in includes/key.admin.inc
Form validate handler for key_config_form().
_drush_key_save in drush/key_save.inc
Save a key.

File

includes/key.admin.inc, line 726
Administrative functionality for managing key configurations.

Code

function _key_create_plugin_form_state($type, $form_state) {

  // Copy the form state.
  $plugin_form_state = $form_state;

  // Clear the values, except for this plugin type's settings.
  $plugin_form_state['values'] = isset($form_state['values'][$type . '_settings']) ? $form_state['values'][$type . '_settings'] : array();
  return $plugin_form_state;
}