You are here

function theme_date_combo in Date 7

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.3 date.theme \theme_date_combo()
  6. 7.2 date.theme \theme_date_combo()

Theme from/to date combination on form.

File

./date.theme, line 283
Theme functions.

Code

function theme_date_combo($vars) {
  $element = $vars['element'];
  $field = field_info_field($element['#field_name']);
  $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);
  if (!$field['settings']['todate']) {
    return $element['#children'];
  }

  // Group from/to items together in fieldset.
  $fieldset = array(
    '#title' => check_plain($instance['label']) . ' ' . ($element['#delta'] > 0 ? intval($element['#delta'] + 1) : ''),
    '#value' => '',
    '#description' => $element['#fieldset_description'],
    '#attributes' => array(),
    '#children' => $element['#children'],
  );
  return theme('fieldset', array(
    'element' => $fieldset,
  ));
}