Browse Source

cleaned up code a bit and removed references to cmr namespace

pull/105/merge
Paul Pound 13 years ago
parent
commit
5b5e85e343
  1. 23
      fedora_repository/fedora_repository.module

23
fedora_repository/fedora_repository.module

@ -3,6 +3,7 @@
/* /*
* @file fedora_repository.module * @file fedora_repository.module
* *
* an Islandora module to handle legacy contentModels (with ISLANDORACM streams)
* *
* *
* This file is part of Islandora. * This file is part of Islandora.
@ -22,7 +23,6 @@
*/ */
/** /**
* called by theme function and populates a render array for a table view. * called by theme function and populates a render array for a table view.
* @param array $metadata * @param array $metadata
@ -69,37 +69,35 @@ function theme_fedora_repository_view_object($variables) {
/** /**
* *
* @global object $user * @global object $user
* @param ActiveMongo $object * @param Object $object
* A tuque fedora object
* @param string $render_array * @param string $render_array
* @return type * @return type
*/ */
function fedora_repository_list_datastreams($object, &$render_array) { function fedora_repository_list_datastreams($object, &$render_array) {
module_load_include('inc', 'CmrAPIDrupal', 'cmr');
global $user; global $user;
$api = new CmrAPIDrupal($user);
$datastreams = $object->datastreams; $datastreams = $object->datastreams;
if (!isset($datastreams)) { if (!isset($datastreams)) {
return $render_array; return $render_array;
} }
foreach ($datastreams as $datastream) { foreach ($datastreams as $datastream) {
foreach ($datastream as $key => $value) { foreach ($datastream as $key => $value) {
if ($key == 'cmr:data') { if ($key == 'islandora:bookCmodel') {
$d = new CmrDatastream();
$d->find($value);
if (isset($d)) {
// $id = $d->getID()->id; // $id = $d->getID()->id;
$render_array[(string)$d->getID()] = array('type' => 'markup', '#markup' => '<div class = "cmr-external-link">'.l($d->label, $d->path,array('html'=>TRUE)).'</div>'); $render_array[(string)$d->getID()] = array('type' => 'markup', '#markup' => '<div class = "cmr-external-link">'.l($d->label, $d->path,array('html'=>TRUE)).'</div>');
} }
} }
if($key = 'cmr:metaData'){ if($key = 'islandora:iaBookCModel'){
$d = new CmrDatastream(); $d = new datastream();
$d->find($value); $d->find($value);
if(isset($d)){ if(isset($d)){
//@TODO: do something here //@TODO: do something here
} }
} }
} }
}
} }
/** /**
@ -123,7 +121,7 @@ function fedora_repository_theme() {
* @return array * @return array
*/ */
function fedora_repository_get_types() { function fedora_repository_get_types() {
return array('islandora:pdfCModel'); return array('islandora:bookCModel','islandora:isBookCModel');
} }
/** /**
@ -144,7 +142,6 @@ function fedora_repository_islandora_view_object($object, $user, $page_number, $
return NULL; return NULL;
} }
$output = theme('fedora_repository_view_object', array('object' => $object)); $output = theme('fedora_repository_view_object', array('object' => $object));
//$api = new CmrAPIDrupal($user);
//pager_default_initialize($results['count'], $page_size); //pager_default_initialize($results['count'], $page_size);
//$pager = theme('pager', array('quantity' => $results['count'])); //$pager = theme('pager', array('quantity' => $results['count']));

Loading…
Cancel
Save