|
|
|
@ -83,7 +83,7 @@ function islandora_basic_image_theme() {
|
|
|
|
|
), |
|
|
|
|
'islandora_basic_image_view_object' => array( |
|
|
|
|
'template' => 'islandora-basic-image-view-object', |
|
|
|
|
'variables' => array('objects' => NULL), |
|
|
|
|
'variables' => array('object' => NULL), |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -97,6 +97,8 @@ function islandora_basic_image_islandora_get_types() {
|
|
|
|
|
return array('info:fedora/islandora:imgageCModel', 'info:fedora/islandora:sp_basic_image'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* this modules implentation of view_object will handle objects of type islandora:basicImageCModel and info:fedora/islandora:sp_basic_image |
|
|
|
|
* as registered in its return types |
|
|
|
@ -116,9 +118,26 @@ function islandora_basic_image_islandora_view_object($object, $user, $page_numbe
|
|
|
|
|
if (empty($combined_list)) { |
|
|
|
|
return NULL;//we don't handle any of this objects cmodels |
|
|
|
|
} |
|
|
|
|
$output = theme('islandora_basic_image_view_object', array('objects' => $object)); |
|
|
|
|
$output = theme('islandora_basic_image_view_object', array('object' => $object)); |
|
|
|
|
|
|
|
|
|
return $output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function islandora_preprocess_islandora_basic_image_view_object(&$variables){ |
|
|
|
|
$object = $variables['object']; |
|
|
|
|
try{ |
|
|
|
|
$dc = $object['DC']->content; |
|
|
|
|
$dc_xml = simplexml_load_string($dc); |
|
|
|
|
$dc_json = json_decode(json_encode((array)simplexml_load_string($dc)),1); |
|
|
|
|
}catch(Exception $e){ |
|
|
|
|
drupal_set_message(t('Error retrieving object %s %t', array('%s' => $object->id,'%t'=>$e->getMessage())),'error'); |
|
|
|
|
} |
|
|
|
|
$variables['dc'] = $dc_json; |
|
|
|
|
$variables['label'] = $object->label; |
|
|
|
|
global $base_url; |
|
|
|
|
$variables['image_url'] = $base_url.'islandora/object/'.$object->id.'/datastream/OBJ/view'; |
|
|
|
|
$variables['thumbnail_url'] = $base_url.'islandora/object/'.$object->id.'datastream/TN/view'; |
|
|
|
|
//return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
?> |
|
|
|
|