function theme_calendar_stripe_legend in Calendar 7
Same name in this branch
- 7 theme/theme.inc \theme_calendar_stripe_legend()
- 7 calendar_multiday/theme/theme.inc \theme_calendar_stripe_legend()
Same name and namespace in other branches
- 5.2 calendar.theme \theme_calendar_stripe_legend()
- 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.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_view in ./
calendar.module - implementation of hook_block_view()
File
- calendar_multiday/
theme/ theme.inc, line 861 - Theme functions for the Calendar module.
Code
function theme_calendar_stripe_legend() {
if (empty($GLOBALS['calendar_stripes'])) {
return '';
}
$header = array(
array(
'class' => 'calendar-legend',
'data' => t('Item'),
),
array(
'class' => 'calendar-legend',
'data' => t('Key'),
),
);
$rows = array();
$output = '';
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
if ($stripe) {
$rows[] = array(
$label,
'<div style="background-color:' . $stripe . ';color:' . $stripe . '" class="stripe" title="Key: ' . $label . '"> </div>',
);
}
}
if (!empty($rows)) {
$variables = array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'class' => 'mini calendar-legend',
),
);
$output .= theme('table', $variables);
}
return $output;
}