You are here

function theme_checkbox_tree_level in Taxonomy Term Reference Tree Widget 7.2

Same name and namespace in other branches
  1. 8 term_reference_tree.module \theme_checkbox_tree_level()
  2. 7 term_reference_tree.widget.inc \theme_checkbox_tree_level()

This function prints a list item with a checkbox and an unordered list of all the elements inside it.

1 theme call to theme_checkbox_tree_level()
term_reference_tree_element_info in ./term_reference_tree.module
Implements hook_element_info().

File

./term_reference_tree.widget.inc, line 412

Code

function theme_checkbox_tree_level($variables) {
  $element = $variables['element'];
  $sm = '';
  if (array_key_exists('#level_start_minimized', $element) && $element['#level_start_minimized']) {
    $collapsed = $sm = " style='display: none;'";
  }
  $max_choices = 0;
  if (array_key_exists('#max_choices', $element)) {
    $max_choices = $element['#max_choices'];
  }
  $output = "<ul class='term-reference-tree-level '{$sm}>";
  $children = element_children($element);
  foreach ($children as $child) {
    $output .= "<li>";
    $output .= drupal_render($element[$child]);
    $output .= "</li>";
  }
  $output .= "</ul>";
  return $output;
}