function theme_date_text_parts in Date 7
Same name and namespace in other branches
- 8 date.theme \theme_date_text_parts()
- 6.2 date/date_admin.inc \theme_date_text_parts()
- 6 date/date_admin.inc \theme_date_text_parts()
- 7.3 date.theme \theme_date_text_parts()
- 7.2 date.theme \theme_date_text_parts()
Display the text/select options for date parts in a table for easier readability.
1 theme call to theme_date_text_parts()
File
- ./
date.theme, line 306 - Theme functions.
Code
function theme_date_text_parts($vars) {
$element = $vars['element'];
$names = date_granularity_names();
$rows = array();
foreach ($names as $key => $part) {
if ($element[$key]['#type'] == 'hidden') {
$rows[] = drupal_render($element[$key]);
}
else {
$rows[] = array(
$names[$key],
drupal_render($element[$key][0]),
drupal_render($element[$key][1]),
);
}
}
if ($element['year']['#type'] == 'hidden') {
return implode($rows) . drupal_render_children($element);
}
else {
$header = array(
t('Input Type'),
t('Select list'),
t('Text field'),
);
return theme('table', array(
'header' => $header,
'rows' => $rows,
)) . drupal_render_children($element);
}
}