Prepares a #type 'checkbox' render element for theme_input().
array $element: An associative array containing the properties of the element. Properties used: #title, #value, #return_value, #description, #required, #attributes, #checked.
array The $element with prepared variables ready for theme_input().
function form_pre_render_checkbox($element) {
$element['#attributes']['type'] = 'checkbox';
element_set_attributes($element, array(
'id',
'name',
'#return_value' => 'value',
));
// Unchecked checkbox has #value of integer 0.
if (!empty($element['#checked'])) {
$element['#attributes']['checked'] = 'checked';
}
_form_set_attributes($element, array(
'form-checkbox',
));
return $element;
}