protected function Calendar::renderLabel in Calendar 8.2
File
- src/
Plugin/ views/ style/ Calendar.php, line 174
Class
- Calendar
- Views style plugin for the Calendar module.
Namespace
Drupal\calendar\Plugin\views\styleCode
protected function renderLabel($rowentity) {
$entity_type = $this
->getBaseEntityType();
$entity_id = $rowentity
->Id();
if ($this->options['multi_allday_style'] === "1") {
$view_mode = $this->options['multi_allday_viewmode'];
$entity = \Drupal::entityTypeManager()
->getStorage($entity_type)
->load($entity_id);
$view_builder = \Drupal::entityTypeManager()
->getViewBuilder($entity_type);
$pre_render = $view_builder
->view($entity, $view_mode);
return render($pre_render);
}
else {
if ($this->options['multi_allday_title'] === "1") {
switch ($entity_type) {
case 'user':
$link = Link::createFromRoute($rowentity
->getTitle(), 'entity.user.canonical', [
'user' => $entity_id,
]);
break;
default:
$link = Link::createFromRoute($rowentity
->getTitle(), 'entity.node.canonical', [
'node' => $entity_id,
]);
}
return $link;
}
else {
return $rowentity
->getTitle();
}
}
}