Drupal modules for browsing and managing Fedora-based digital repositories.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

58 lines
1.5 KiB

<?php
/**
* @file
* Contains islandora.module..
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function islandora_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the islandora module.
case 'help.page.islandora':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function islandora_theme() {
$theme = [];
$theme['fedora_resource'] = [
'render element' => 'elements',
'file' => 'fedora_resource.page.inc',
'template' => 'fedora_resource',
];
$theme['fedora_resource_content_add_list'] = [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'fedora_resource.page.inc',
];
return $theme;
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function islandora_theme_suggestions_fedora_resource(array $variables) {
$suggestions = array();
$entity = $variables['elements']['#fedora_resource'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'fedora_resource__' . $sanitized_view_mode;
$suggestions[] = 'fedora_resource__' . $entity->bundle();
$suggestions[] = 'fedora_resource__' . $entity->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'fedora_resource__' . $entity->id();
$suggestions[] = 'fedora_resource__' . $entity->id() . '__' . $sanitized_view_mode;
return $suggestions;
}