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.
59 lines
1.5 KiB
59 lines
1.5 KiB
8 years ago
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @file
|
||
8 years ago
|
* Contains islandora.module..
|
||
8 years ago
|
*/
|
||
|
|
||
|
use Drupal\Core\Routing\RouteMatchInterface;
|
||
|
|
||
|
/**
|
||
|
* Implements hook_help().
|
||
|
*/
|
||
8 years ago
|
function islandora_help($route_name, RouteMatchInterface $route_match) {
|
||
8 years ago
|
switch ($route_name) {
|
||
8 years ago
|
// Main module help for the islandora module.
|
||
|
case 'help.page.islandora':
|
||
8 years ago
|
$output = '';
|
||
|
$output .= '<h3>' . t('About') . '</h3>';
|
||
|
$output .= '<p>' . t('') . '</p>';
|
||
|
return $output;
|
||
|
|
||
|
default:
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Implements hook_theme().
|
||
|
*/
|
||
8 years ago
|
function islandora_theme() {
|
||
8 years ago
|
$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().
|
||
|
*/
|
||
8 years ago
|
function islandora_theme_suggestions_fedora_resource(array $variables) {
|
||
8 years ago
|
$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;
|
||
|
}
|