You are here

function theme_date_combo in Date 7.3

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

Returns HTML for a start/end date combination on form.

File

./date.theme, line 418
Theme functions.

Code

function theme_date_combo($variables) {
  $element = $variables['element'];
  $field = field_info_field($element['#field_name']);
  $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);

  // Group start/end items together in fieldset.
  $fieldset = array(
    '#title' => field_filter_xss(t($element['#title'])) . ($element['#delta'] > 0 ? ' ' . intval($element['#delta'] + 1) : ''),
    '#value' => '',
    '#description' => !empty($element['#description']) ? $element['#description'] : '',
    '#attributes' => array(
      'class' => array(
        'date-combo',
      ),
    ),
    '#children' => $element['#children'],
  );

  // Add marker to required date fields.
  if ($element['#required']) {
    $fieldset['#title'] .= " " . theme('form_required_marker');
  }
  return theme('fieldset', array(
    'element' => $fieldset,
  ));
}