Created
July 25, 2013 13:30
-
-
Save nhart/6079631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess(). | |
*/ | |
function your_theme_preprocess_islandora_basic_image(&$variables) { | |
mods_metadata($variables); | |
} | |
/* | |
* Use a MODS to HTML xslt for the metadata fieldset | |
*/ | |
function mods_metadata(&$variables) { | |
$object = $variables['islandora_object']; | |
if ($object['MODS']) { | |
$mods = new SimpleXMLElement($object['MODS']->content); | |
$path = drupal_get_path("theme", "your_theme"); | |
$xsl = simplexml_load_file("$path/xslt/your-mods.xsl"); | |
$proc = new XSLTProcessor; | |
$proc->importStyleSheet($xsl); | |
$mods_table_html = $proc->transformToXML($mods); | |
$form = array(); | |
$form['mods_table'] = array( | |
'#type' => 'markup', | |
'#markup' => $mods_table_html, | |
); | |
$variables['metadata_table'] = drupal_render($form); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment