You are here

function theme_taxonomy_manager_tree_radio in Taxonomy Manager 6

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \theme_taxonomy_manager_tree_radio()
  2. 7 taxonomy_manager.module \theme_taxonomy_manager_tree_radio()

themes a radio, where a label can optional contain a link

1 theme call to theme_taxonomy_manager_tree_radio()
taxonomy_manager_tree_build_form in ./taxonomy_manager.module
recursive function for building nested form array with checkboxes and weight forms for each term

File

./taxonomy_manager.module, line 927
Taxonomy Manager

Code

function theme_taxonomy_manager_tree_radio($element) {
  _form_set_class($element, array(
    'form-radio',
  ));
  $output = '<input ';
  $output .= 'type="radio" ';
  $output .= 'name="' . $element['#parents'][0] . "[" . $element['#parents'][1] . "]" . '" ';

  //TODO check this
  $output .= 'id="' . $element['#id'] . '" ';
  $output .= 'value="' . $element['#return_value'] . '" ';
  $checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
  $output .= $element['#value'] ? ' checked="checked" ' : ' ';
  $output .= drupal_attributes($element['#attributes']) . ' />';
  $title = $element['#title'];
  if ($element['#link']) {
    $title = l($title, $element['#link'], array(
      'attributes' => array(
        "class" => "term-data-link",
      ),
    ));
  }
  else {
    $title = check_plain($title);
  }
  if (!is_null($title)) {
    $output = '<label class="option">' . $output . ' ' . $title . '</label>';
  }
  unset($element['#title']);
  return theme('form_element', $element, $output);
}