function theme_taxonomy_manager_tree_checkbox in Taxonomy Manager 6
Same name and namespace in other branches
- 5 taxonomy_manager.module \theme_taxonomy_manager_tree_checkbox()
- 6.2 taxonomy_manager.module \theme_taxonomy_manager_tree_checkbox()
- 7 taxonomy_manager.module \theme_taxonomy_manager_tree_checkbox()
themes a checkbox, where a label can optional contain a link
1 theme call to theme_taxonomy_manager_tree_checkbox()
- 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 893 - Taxonomy Manager
Code
function theme_taxonomy_manager_tree_checkbox($element) {
_form_set_class($element, array(
'form-checkbox',
));
$checkbox = '<input ';
$checkbox .= 'type="checkbox" ';
$checkbox .= 'name="' . $element['#name'] . '" ';
$checkbox .= 'id="' . $element['#id'] . '" ';
$checkbox .= 'value="' . $element['#return_value'] . '" ';
$checkbox .= $element['#value'] ? ' checked="checked" ' : ' ';
$checkbox .= drupal_attributes($element['#attributes']) . ' />';
$title = $element['#title'];
if ($element['#link']) {
$attr = array();
$attr["class"] = "term-data-link";
if (isset($element['#extra_info'])) {
$attr["title"] = $element['#extra_info'];
}
$title = $title = l($title, $element['#link'], array(
'attributes' => $attr,
));
}
else {
$title = check_plain($title);
}
if (!is_null($title)) {
$checkbox = '<label class="option">' . $checkbox . ' ' . $title . '</label>';
}
unset($element['#title']);
return theme('form_element', $element, $checkbox);
}