function theme_availability_calendars_key in Availability Calendars 6.2
Same name and namespace in other branches
- 7.2 availability_calendars.page.inc \theme_availability_calendars_key()
Themes the key for our calendars.
Return value
string
2 theme calls to theme_availability_calendars_key()
- availability_calendars_block_view in ./
availability_calendars.module - Implements D7 hook_block_view().
- theme_availability_calendars_node in ./
availability_calendars.page.inc - Themes the given number of months of the calendar for the given node.
File
- ./
availability_calendars.page.inc, line 217
Code
function theme_availability_calendars_key() {
// @todo: use caption instead of a non-related div tag (key-title)
//use all the same classes for cells and table, so it styles the same as the calendars
$keytitle = t('Key');
$headers = array(
t('Availability'),
);
$rows = array();
$states = availability_calendars_get_states();
foreach ($states as $class => $state) {
$rows[] = array(
array(
'data' => '<span>' . check_plain(t($state['label'])) . '</span>',
'class' => "{$class} keystatus",
),
);
}
$rows[] = array(
array(
'data' => '<span>' . t('Current Day') . '</span>',
'class' => 'caltoday keystatus',
),
);
$key = theme('table', $headers, $rows, array(
'class' => 'cal',
), $keytitle);
return '<div class="calmonth-wrapper key-wrapper">' . $key . '</div>';
}