You are here

function key_get_plugins_as_options in Key 7.3

Gets all key plugins of the requested type as options, for use in forms.

Parameters

string $type: The type of plugin.

bool $all: A flag indicating whether to include plugins with unmet dependencies.

bool $reset: A flag indicating whether to clear the plugin cache. Otherwise, stale data may be returned if plugin properties have changed.

Return value

array An array of key plugins, with ids for keys and labels for values.

2 calls to key_get_plugins_as_options()
key_config_form in includes/key.admin.inc
Form constructor for the key configuration form.
_drush_key_list in drush/key_list.inc
Get a list of available keys.

File

./key.module, line 299
Main Key functionality and hook implementations.

Code

function key_get_plugins_as_options($type, $all = TRUE, $reset = FALSE) {
  $plugins = key_get_plugins($type, $all, $reset);
  $options = array();
  foreach ($plugins as $id => $plugin) {
    $options[$id] = $plugin['label'];
  }
  return $options;
}