function theme_calendar_ical_field in Calendar 5.2
Views field theme for an ical field.
Used for table and list views.
For non-calendar views that use fields, the field needs a value from the imported node that matches the kind of field in the view. Most possible Views fields make no sense here and will return nothing.
File
- ./
calendar_ical.module, line 389 - Adds ical functionality to Calendar.
Code
function theme_calendar_ical_field($fieldname, $fields, $field, $node, $view, $type) {
static $datefield;
// Find the first date field in the view to attach the ical date to.
// There may be more than one date field in the view and we only
// want to put the ical field in one place.
if (empty($datefield)) {
$calendar_fields = calendar_fields();
foreach ($view->field as $viewfield) {
if (in_array($viewfield['field'], array_keys($calendar_fields))) {
$datefield = $viewfield['queryname'];
break;
}
}
}
// Check plain may leave html entities in the title.
$node->title = html_entity_decode(check_plain($node->title), ENT - QUOTES);
$node->teaser = check_markup($node->teaser);
// Fix some common html entities that may not get decoded correctly.
// You can add more of them in this array.
$replace = array(
''' => "'",
);
foreach (array(
'title',
'teaser',
) as $key) {
$node->{$key} = strtr($node->{$key}, $replace);
}
if ($fieldname == $datefield) {
return theme('calendar_date_combo', $field, $node, '', $view);
}
switch ($field['fullname']) {
case 'node.title':
return l($node->title, $node->url);
case 'node.teaser':
case 'node.body':
return $node->teaser;
case 'node.type':
return $node->label;
}
return;
}