You are here

function _key_process_key_select in Key 7.3

Process function to expand the key element.

Parameters

array $element: The element to process.

Return value

array The processed element.

1 string reference to '_key_process_key_select'
key_element_info in ./key.module
Implements hook_element_info().

File

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

Code

function _key_process_key_select($element) {
  $options = key_get_key_names_as_options($element['#key_filters'], TRUE);
  $element['#options'] = $options;

  // Prefix the default description with a information about keys.
  if ($element['#key_description']) {
    $original_description = isset($element['#description']) ? $element['#description'] : '';
    $key_description = t('Choose an available key. If the desired key is not listed, <a href="@link">create a new key</a>.', array(
      '@link' => '/' . KEY_MENU_PATH . '/add',
    ));
    $element['#description'] = $key_description . ' ' . $original_description;
  }
  return $element;
}