function calendar_week_header in Calendar 7
Same name and namespace in other branches
- 5.2 calendar.inc \calendar_week_header()
- 5 calendar_api.inc \calendar_week_header()
- 6.2 calendar.module \calendar_week_header()
- 7.3 calendar.module \calendar_week_header()
- 7.2 calendar.module \calendar_week_header()
Formats the weekday information into table header format
Return value
array with weekday table header data
5 calls to calendar_week_header()
- calendar_build_calendar in includes/
calendar.inc - Build calendar
- calendar_build_calendar in calendar_multiday/
includes/ calendar.inc - Build calendar
- calendar_build_mini_month in calendar_multiday/
includes/ calendar.inc - Build one month.
- calendar_build_month in includes/
calendar.inc - Build one month.
- calendar_build_month in calendar_multiday/
includes/ calendar.inc - Build one month.
File
- ./
calendar.module, line 513 - Adds calendar filtering and displays to Views.
Code
function calendar_week_header($view) {
$len = isset($view->date_info->style_name_size) ? $view->date_info->style_name_size : (!empty($view->date_info->mini) ? 1 : 3);
$with_week = !empty($view->date_info->style_with_weekno);
// create week header
$untranslated_days = calendar_untranslated_days();
if ($len == 99) {
$translated_days = date_week_days_ordered(date_week_days(TRUE));
}
else {
$translated_days = date_week_days_ordered(date_week_days_abbr(TRUE));
}
if ($with_week) {
$row[] = array(
'header' => TRUE,
'class' => "days week",
'data' => ' ',
);
}
foreach ($untranslated_days as $delta => $day) {
$label = $len < 3 ? drupal_substr($translated_days[$delta], 0, $len) : $translated_days[$delta];
$row[] = array(
'header' => TRUE,
'class' => "days " . $day,
'data' => $label,
);
}
return $row;
}