function theme_date_popup in Date 7.3
Same name and namespace in other branches
- 5.2 date_popup/date_popup.module \theme_date_popup()
- 6.2 date_popup/date_popup.module \theme_date_popup()
- 6 date_popup/date_popup.module \theme_date_popup()
- 7 date_popup/date_popup.module \theme_date_popup()
- 7.2 date_popup/date_popup.module \theme_date_popup()
Format a date popup element.
Use a class that will float date and time next to each other.
File
- date_popup/
date_popup.module, line 828 - A module to enable jQuery calendar and time entry popups.
Code
function theme_date_popup($vars) {
$element = $vars['element'];
$attributes = !empty($element['#wrapper_attributes']) ? $element['#wrapper_attributes'] : array(
'class' => array(),
);
$attributes['class'][] = 'container-inline-date';
// If there is no description, the floating date elements need some extra
// padding below them.
$wrapper_attributes = array(
'class' => array(
'date-padding',
),
);
if (empty($element['date']['#description'])) {
$wrapper_attributes['class'][] = 'clearfix';
}
// Add an wrapper to mimic the way a single value field works, for ease in
// using #states.
if (isset($element['#children'])) {
$element['#children'] = '<div id="' . $element['#id'] . '" ' . drupal_attributes($wrapper_attributes) . '>' . $element['#children'] . '</div>';
}
return '<div ' . drupal_attributes($attributes) . '>' . theme('form_element', $element) . '</div>';
}