https://github.com/diegopino */ 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 .= '
' . t('') . '
'; 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; } /** * Implements hook_rdf_namespaces(). */ function islandora_rdf_namespaces() { // Yes, it's amazing, rdf is not registered by default! return array( 'ldp' => 'http://www.w3.org/ns/ldp#', 'dc11' => 'http://purl.org/dc/elements/1.1/', 'nfo' => 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo/v1.1/', 'ebucore' => 'http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#', 'fedora' => 'http://fedora.info/definitions/v4/repository#', 'owl' => 'http://www.w3.org/2002/07/owl#', 'ore' => 'http://www.openarchives.org/ore/terms/', 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', ); }