You are here

function flag_expand_link_option in Flag 7.2

Same name and namespace in other branches
  1. 6.2 includes/flag.admin.inc \flag_expand_link_option()

FormAPI after_build function to add descriptions to radio buttons.

1 string reference to 'flag_expand_link_option'
flag_form in includes/flag.admin.inc
Add/Edit flag page.

File

includes/flag.admin.inc, line 625
Contains administrative pages for creating, editing, and deleting flags.

Code

function flag_expand_link_option($element) {
  $element['#attached'] = array(
    'js' => array(
      drupal_get_path('module', 'flag') . '/theme/flag-admin.js',
    ),
  );
  foreach (element_children($element) as $key) {

    // Add a description to the link option.
    if (isset($element['#option_descriptions'][$key])) {
      $element[$key]['#description'] = $element['#option_descriptions'][$key];
    }
  }
  $element['#attributes']['class'] = array(
    'flag-link-options',
  );
  return $element;
}