1 date.theme.inc theme_date_text_parts($variables)

Returns HTML for the text/select options for date parts in a table.

Related topics

File

core/modules/date/date.theme.inc, line 411
Theme and preprocess functions for output by Date module.

Code

function theme_date_text_parts($variables) {
  $element = $variables['element'];
  $rows = array();
  foreach (date_granularity_names() as $key => $part) {
    if ($element[$key]['#type'] == 'hidden') {
      $rows[] = backdrop_render($element[$key]);
    }
    else {
      $rows[] = array(
        $part,
        backdrop_render($element[$key][0]),
        backdrop_render($element[$key][1]),
      );
    }
  }
  if ($element['year']['#type'] == 'hidden') {
    return implode($rows) . backdrop_render_children($element);
  }
  else {
    $header = array(t('Date part'), t('Select list'), t('Text field'));
    return theme('table', array('header' => $header, 'rows' => $rows)) . backdrop_render_children($element);
  }
}