function theme_taxonomy_manager_tree_checkbox in Taxonomy Manager 5
Same name and namespace in other branches
- 6.2 taxonomy_manager.module \theme_taxonomy_manager_tree_checkbox()
- 6 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 2107 - 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']) {
$title = l($title, $element['#link'], array(
"class" => "term-data-link",
));
}
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);
}