function theme_calendar_stripe_legend in Calendar 5.2
Same name and namespace in other branches
- 5 calendar.theme \theme_calendar_stripe_legend()
- 6.2 theme/theme.inc \theme_calendar_stripe_legend()
- 6.2 calendar_multiday/theme/theme.inc \theme_calendar_stripe_legend()
- 7.3 theme/theme.inc \theme_calendar_stripe_legend()
- 7 theme/theme.inc \theme_calendar_stripe_legend()
- 7 calendar_multiday/theme/theme.inc \theme_calendar_stripe_legend()
- 7.2 theme/theme.inc \theme_calendar_stripe_legend()
- 7.2 calendar_multiday/theme/theme.inc \theme_calendar_stripe_legend()
Format a node stripe legend
1 theme call to theme_calendar_stripe_legend()
- calendar_block in ./
calendar.module - implementation of hook_block()
File
- ./
calendar.theme, line 429
Code
function theme_calendar_stripe_legend() {
if (empty($GLOBALS['calendar_stripes'])) {
return '';
}
$view = $GLOBALS['current_view'];
$header = array(
array(
'class' => 'calendar-legend',
'data' => t('Item'),
),
array(
'class' => 'calendar-legend',
'data' => t('Key'),
),
);
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
$rows[] = array(
$label,
'<div style="background-color:' . $stripe . ';color:' . $stripe . '" class="stripe" title="Key: ' . $label . '"> </div>',
);
}
$output = theme('table', $header, $rows, array(
'class' => 'mini calendar-legend',
));
return $output;
}