|
|
@ -36,15 +36,9 @@ class CalendarController extends ControllerBase { |
|
|
|
|
|
|
|
|
|
|
|
public function calendarTitle($ebundle) { |
|
|
|
public function calendarTitle($ebundle) { |
|
|
|
$bundle = ebundle_split($ebundle, 'bundle'); |
|
|
|
$bundle = ebundle_split($ebundle, 'bundle'); |
|
|
|
$titlePrefix = $bundle; |
|
|
|
$type = ebundle_split($ebundle, 'type'); |
|
|
|
$entityTypeManager = \Drupal::service('entity_type.manager'); |
|
|
|
$bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo($type); |
|
|
|
$contentTypes = $entityTypeManager->getStorage('node_type')->loadMultiple(); |
|
|
|
$titlePrefix = isset($bundles[$bundle]) ? $bundles[$bundle]['label'] : $bundle; |
|
|
|
foreach ($contentTypes as $contentType) { |
|
|
|
|
|
|
|
if($contentType->id() == $bundle) { |
|
|
|
|
|
|
|
$titlePrefix = $contentType->label(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return t('@bundle Calendar', array('@bundle' => ucwords($titlePrefix))); |
|
|
|
return t('@bundle Calendar', array('@bundle' => ucwords($titlePrefix))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|