|
|
@ -130,7 +130,6 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
$content_path = implode('/', $url_components); |
|
|
|
$content_path = implode('/', $url_components); |
|
|
|
$iiif_base_id = $request_host . '/' . $content_path; |
|
|
|
$iiif_base_id = $request_host . '/' . $content_path; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @see https://iiif.io/api/presentation/2.1/#manifest |
|
|
|
// @see https://iiif.io/api/presentation/2.1/#manifest |
|
|
|
$json += [ |
|
|
|
$json += [ |
|
|
|
'@type' => 'sc:Manifest', |
|
|
|
'@type' => 'sc:Manifest', |
|
|
@ -272,13 +271,17 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getEntityTitle(string $content_path): string { |
|
|
|
public function getEntityTitle(string $content_path): string { |
|
|
|
$entity_title = $this->t('IIIF Manifest'); |
|
|
|
$entity_title = $this->t('IIIF Manifest'); |
|
|
|
$params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); |
|
|
|
try { |
|
|
|
if (isset($params['node'])) { |
|
|
|
$params = \Drupal\Core\Url::fromUserInput($content_path)->getRouteParameters(); |
|
|
|
$node = \Drupal\node\Entity\Node::load($params['node']); |
|
|
|
if (isset($params['node'])) { |
|
|
|
$entity_title = $node->getTitle(); |
|
|
|
$node = \Drupal\node\Entity\Node::load($params['node']); |
|
|
|
} elseif (isset($params['media'])) { |
|
|
|
$entity_title = $node->getTitle(); |
|
|
|
$media = \Drupal\media\Entity\Media::load($params['media']); |
|
|
|
} elseif (isset($params['media'])) { |
|
|
|
$entity_title = $media->getName(); |
|
|
|
$media = \Drupal\media\Entity\Media::load($params['media']); |
|
|
|
|
|
|
|
$entity_title = $media->getName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (\InvalidArgumentException $e) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return $entity_title; |
|
|
|
return $entity_title; |
|
|
|
} |
|
|
|
} |
|
|
|