function calendar_node_stripe in Calendar 5
Same name and namespace in other branches
- 5.2 calendar.module \calendar_node_stripe()
- 6.2 calendar.module \calendar_node_stripe()
- 7 calendar.module \calendar_node_stripe()
- 7.2 calendar.module \calendar_node_stripe()
create a stripe id from a combination of the field and content types and store value for legend formula tries to create a unique id for each possible combination
Parameters
$node - the node object:
$query_name - the views queryname for this date field:
$delta - the delta for this field, used to distinguish fields that appear more than once in the calendar:
$label - the label to give this stripe.:
1 call to calendar_node_stripe()
- calendar_get_nodes in ./
calendar.module - The workhorse function that takes the beginning array of items and alters it to an array of calendar nodes that the theme can handle.
File
- ./
calendar.module, line 1324 - Adds calendar filtering and displays to Views.
Code
function calendar_node_stripe($view, $node, $query_name, $delta, $stripe = NULL, $label = '') {
$type_names = node_get_types('names');
if (!$label) {
$label = $view->field[$delta]['label'] . ' (' . $type_names[$node->type] . ')';
}
if (!$stripe) {
$i = 1;
foreach ($type_names as $k => $v) {
if ($k == $node->type) {
break;
}
$i++;
}
$stripe = intval(20 * $delta + $i);
}
$GLOBALS['calendar_stripe_labels'][$stripe] = $label;
return $stripe;
}