|
|
@ -93,10 +93,17 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected $messenger; |
|
|
|
protected $messenger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Module Handler for running hooks. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @var \Drupal\Core\Extention\ModuleHandlerInterface |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected $moduleHandler; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@inheritdoc} |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function __construct(array $configuration, $plugin_id, $plugin_definition, SerializerInterface $serializer, Request $request, ImmutableConfig $iiif_config, EntityTypeManagerInterface $entity_type_manager, FileSystemInterface $file_system, Client $http_client, MessengerInterface $messenger) { |
|
|
|
public function __construct(array $configuration, $plugin_id, $plugin_definition, SerializerInterface $serializer, Request $request, ImmutableConfig $iiif_config, EntityTypeManagerInterface $entity_type_manager, FileSystemInterface $file_system, Client $http_client, MessengerInterface $messenger, ModuleHandlerInterface $moduleHandler) { |
|
|
|
parent::__construct($configuration, $plugin_id, $plugin_definition); |
|
|
|
parent::__construct($configuration, $plugin_id, $plugin_definition); |
|
|
|
|
|
|
|
|
|
|
|
$this->serializer = $serializer; |
|
|
|
$this->serializer = $serializer; |
|
|
@ -106,6 +113,7 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
$this->fileSystem = $file_system; |
|
|
|
$this->fileSystem = $file_system; |
|
|
|
$this->httpClient = $http_client; |
|
|
|
$this->httpClient = $http_client; |
|
|
|
$this->messenger = $messenger; |
|
|
|
$this->messenger = $messenger; |
|
|
|
|
|
|
|
$this->moduleHandler = $moduleHandler; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -122,10 +130,21 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
$container->get('entity_type.manager'), |
|
|
|
$container->get('entity_type.manager'), |
|
|
|
$container->get('file_system'), |
|
|
|
$container->get('file_system'), |
|
|
|
$container->get('http_client'), |
|
|
|
$container->get('http_client'), |
|
|
|
$container->get('messenger') |
|
|
|
$container->get('messenger'), |
|
|
|
|
|
|
|
$container->get('module_handler') |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Return the request property. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return \Symfony\Component\HttpFoundation\Request |
|
|
|
|
|
|
|
* The Symfony request object |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function getRequest() { |
|
|
|
|
|
|
|
return $this->request; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@inheritdoc} |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -172,6 +191,9 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
|
|
|
|
|
|
|
|
$content_type = 'json'; |
|
|
|
$content_type = 'json'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Give other modules a chance to alter the manifest. |
|
|
|
|
|
|
|
$this->moduleHandler->alter('islandora_iiif_manifest', $json, $this); |
|
|
|
|
|
|
|
|
|
|
|
return $this->serializer->serialize($json, $content_type, ['views_style_plugin' => $this]); |
|
|
|
return $this->serializer->serialize($json, $content_type, ['views_style_plugin' => $this]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -255,6 +277,13 @@ class IIIFManifest extends StylePluginBase { |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Give other modules a chance to alter the canvas. |
|
|
|
|
|
|
|
$alter_options = [ |
|
|
|
|
|
|
|
'options' => $this->options, |
|
|
|
|
|
|
|
'views_plugin' => $this, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
$this->moduleHandler->alter('islandora_iiif_manifest_canvas', $tmp_canvas, $row, $alter_options); |
|
|
|
|
|
|
|
|
|
|
|
$canvases[] = $tmp_canvas; |
|
|
|
$canvases[] = $tmp_canvas; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|