function calendar_week_header in Calendar 5.2
Same name and namespace in other branches
- 5 calendar_api.inc \calendar_week_header()
- 6.2 calendar.module \calendar_week_header()
- 7.3 calendar.module \calendar_week_header()
- 7 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
2 calls to calendar_week_header()
- calendar_build_calendar in ./
calendar.inc - Build calendar
- calendar_build_month in ./
calendar.inc - Build one month.
File
- ./
calendar.inc, line 387 - All the code used while processing a calendar is stored in this file and is included only when needed.
Code
function calendar_week_header($mini = FALSE, $with_week = TRUE, $len = 1) {
// 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 = $mini ? drupal_substr($translated_days[$delta], 0, $len) : $translated_days[$delta];
$row[] = array(
'header' => TRUE,
'class' => "days " . $day,
'data' => $label,
);
}
return $row;
}