You are here

function encrypt_get_enabled_configs_as_options in Encrypt 7.2

Same name and namespace in other branches
  1. 7.3 encrypt.module \encrypt_get_enabled_configs_as_options()

Get enabled configurations as options.

Useful for retrieving a list of enabled configurations to be used as #options in form elements such as select, checkboxes, and radios.

Parameters

bool $reset: A flag to force the configurations to be retrieved from the database.

Return value

array An array of key-value pairs. The key is the configuration's machine- readable name and the value is its human-friendly label.

File

./encrypt.module, line 295
Main Encrypt Drupal File.

Code

function encrypt_get_enabled_configs_as_options($reset = FALSE) {
  static $options = array();
  if (!$options || $reset) {
    $configs = encrypt_get_enabled_configs($reset);
    foreach ($configs as $key => $config) {
      $options[$key] = $config['label'];
    }
  }
  return $options;
}