You are here

function theme_date_select in Date 7.3

Same name and namespace in other branches
  1. 8 date_api/theme/theme.inc \theme_date_select()
  2. 5.2 date_api_elements.inc \theme_date_select()
  3. 6.2 theme/theme.inc \theme_date_select()
  4. 6 date_api_elements.inc \theme_date_select()
  5. 7 date_api/theme/theme.inc \theme_date_select()
  6. 7.2 date_api/theme/theme.inc \theme_date_select()

Returns HTML for a date select element.

1 theme call to theme_date_select()
_date_field_widget_settings_form in ./date_admin.inc
Helper function for date_field_widget_settings_form().

File

date_api/theme/theme.inc, line 26
Theme files for Date API.

Code

function theme_date_select($variables) {
  $element = $variables['element'];
  $attributes = !empty($element['#wrapper_attributes']) ? $element['#wrapper_attributes'] : array(
    'class' => array(),
  );
  $attributes['class'][] = 'container-inline-date';
  $wrapper_attributes = array(
    'class' => array(
      'date-padding',
    ),
  );
  $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>';
}