PHP code example of islandora / islandora_mirador

1. Go to this page and download the library: Download islandora/islandora_mirador library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

islandora / islandora_mirador example snippets


/**
 * @IslandoraMiradorPlugin(
 *   id = "machineName",
 *   label = @Translation("Plugin label"),
 *   description = @Translation("Description of the plugin .")
 * )
 */


function mymodule_preprocess_mirador(&$variables) {
  $variables['window_config']['allowClose'] = FALSE;
}

      $block = \Drupal::service('plugin.manager.block')->createInstance($viewer . '_block', [
        'iiif_manifest_url' => "/node/$manifest_nid/manifest-single",
        'thumbnail_navigation_position' => 'hidden',
        'window_config' => [
          'allowClose' => FALSE,
          'allowMaximize' => FALSE,
          'allowTopMenuButton' => FALSE,
          'allowWindowSideBar' => FALSE,
          'hideWindowTitle' => TRUE,
          'panels' => [
            'info' => FALSE,
            'attribution' => FALSE,
            '	  canvas' => FALSE,
            'annotations' => FALSE,
            'search' => FALSE,
          ],
        ],
        'workspace_config' => [
          'allowNewWindows' => FALSE,
          'isWorkspaceAddVisible' => FALSE,
          'workspaceControlPanel' => [
            'enable' => FALSE,
          ],

        ],
      ]);