function theme_availability_calendar_key in Availability Calendars 7.4
Same name and namespace in other branches
- 7.5 availability_calendar.theme.inc \theme_availability_calendar_key()
- 7.3 availability_calendar.theme.inc \theme_availability_calendar_key()
Themes the key for our calendars.
Parameters
array $variables:
Return value
string
1 theme call to theme_availability_calendar_key()
File
- ./
availability_calendar.theme.inc, line 397
Code
function theme_availability_calendar_key($variables) {
$caption = '';
$rows = array();
$states_to_show = isset($variables['states_to_show']) ? $variables['states_to_show'] : array();
$states = availability_calendar_get_states(array_filter($states_to_show));
foreach ($states as $state) {
$rows[] = array(
// Use the same classes here as in the calendar, so it styles the same.
array(
'data' => '<div>' . check_plain(t($state['label'])) . '</div>',
'class' => $state['css_class'],
'no_striping' => TRUE,
),
);
}
$key = theme('table', array(
'caption' => $caption,
'rows' => $rows,
'sticky' => FALSE,
));
return '<div class="cal-key">' . $key . '</div>';
}