Browse Source

Filled out purge/delete datastream callback

pull/108/merge
rwincewicz 13 years ago
parent
commit
8835a21b3d
  1. 6
      islandora-object-edit.tpl.php
  2. 2
      islandora.info
  3. 20
      islandora.module
  4. 2
      islandora_basic_collection/islandora_basic_collection.info
  5. 2
      islandora_basic_collection/islandora_basic_collection.module
  6. 2
      islandora_basic_image/islandora_basic_image.info
  7. 2
      islandora_basic_image/islandora_basic_image.module

6
islandora-object-edit.tpl.php

@ -47,12 +47,12 @@
//dsm($object); //dsm($object);
drupal_set_title($islandora_object->label); drupal_set_title($islandora_object->label);
$islandora_datastreams = $variables['islandora_datastreams'];
print($islandora_object->label . ' ' . $islandora_object->id); print($islandora_object->label . ' ' . $islandora_object->id);
print('this is the edit template'); print('this is the edit template');
print ('<h3>datastreams</h3>'); print ('<h3>datastreams</h3>');
foreach ($islandora_object as $ds) { foreach ($islandora_datastreams as $key => $ds) {
print $ds->label . '<br>'; print $key. '<br />';
//do something //do something
} }
?> ?>

2
islandora.info

@ -3,3 +3,5 @@ description = "View and manage Fedora objects"
package = Islandora package = Islandora
version = 7.x-dev version = 7.x-dev
core = 7.x core = 7.x
stylesheets[all][] = css/islandora.base.css
stylesheets[all][] = css/islandora.theme.css

20
islandora.module

@ -303,7 +303,7 @@ function islandora_islandora_edit_object($fedora_object) {
$supported_models = islandora_get_types(); $supported_models = islandora_get_types();
$output = ""; $output = "";
foreach ($fedora_object->models as $model) { foreach ($fedora_object->models as $model) {
if ($supported_models[$model][ISLANDORA_EDIT_HOOK] == TRUE) {//another module is handling the view if (isset($supported_models[$model][ISLANDORA_EDIT_HOOK]) && $supported_models[$model][ISLANDORA_EDIT_HOOK] == TRUE) {//another module is handling the view
return; return;
} }
} }
@ -424,9 +424,16 @@ function islandora_islandora_view_object($object) {
$object_models = $object->models; $object_models = $object->models;
$combined_list = array_intersect($supported_models, $object->models); $combined_list = array_intersect($supported_models, $object->models);
$output = ""; $output = "";
<<<<<<< HEAD
if (empty($combined_list)) { if (empty($combined_list)) {
$output = theme('islandora_default', array('islandora_object' => $object)); $output = theme('islandora_default', array('islandora_object' => $object));
return array('Default Output' => $output); return array('Default Output' => $output);
=======
foreach ($object->models as $model) {
if (isset($supported_models[$model][ISLANDORA_VIEW_HOOK]) && $supported_models[$model][ISLANDORA_VIEW_HOOK] == TRUE) {//another module is handling the view
return;
}
>>>>>>> a364874a78dd45f202ba5ef18292bf77f6bf591e
} }
} }
@ -519,5 +526,14 @@ function islandora_preprocess_islandora_default(&$variables) {
} }
function islandora_preprocess_islandora_default_edit(&$variables) { function islandora_preprocess_islandora_default_edit(&$variables) {
//$islandora_object = $variables['islandora_object']; $islandora_object = $variables['islandora_object'];
global $base_url;
$datastreams = array();
foreach ($islandora_object as $ds) {
$datastreams['download_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/download';
$datastreams['view_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/view';
$datastreams['delete_url'] = $base_url . '/islandora/object/' . $islandora_object->id . 'datastream/' . $ds->id .'/delete';
$variables['islandora_datastreams'][$ds->id] = $datastreams;
}
} }

2
islandora_basic_collection/islandora_basic_collection.info

@ -3,3 +3,5 @@ description = "A default Islandora Repository module to handle simple collection
dependencies[] = islandora dependencies[] = islandora
package = Islandora package = Islandora
core = 7.x core = 7.x
stylesheets[all][] = css/islandora_basic_collection.base.css
stylesheets[all][] = css/islandora_basic_collection.theme.css

2
islandora_basic_collection/islandora_basic_collection.module

@ -72,7 +72,7 @@ function islandora_basic_collection_islandora_view_object($object, $user, $page_
$cmodel_list = islandora_basic_collection_islandora_get_types(); $cmodel_list = islandora_basic_collection_islandora_get_types();
$models = $object->models; $models = $object->models;
foreach ($object->models as $model) { foreach ($object->models as $model) {
if ($cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) { if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) {
$output = theme('islandora_basic_collection', array('islandora_object' => $object)); $output = theme('islandora_basic_collection', array('islandora_object' => $object));
return array('Basic Collection Output' => $output); return array('Basic Collection Output' => $output);
} }

2
islandora_basic_image/islandora_basic_image.info

@ -3,3 +3,5 @@ description = "A default Islandora Repository module to handle images"
dependencies[] = islandora dependencies[] = islandora
package = Islandora package = Islandora
core = 7.x core = 7.x
stylesheets[all][] = css/islandora_basic_image.base.css
stylesheets[all][] = css/islandora_basic_image.theme.css

2
islandora_basic_image/islandora_basic_image.module

@ -75,7 +75,7 @@ function islandora_basic_image_islandora_view_object($object, $user, $page_numbe
$cmodel_list = islandora_basic_image_islandora_get_types(); $cmodel_list = islandora_basic_image_islandora_get_types();
$models = $object->models; $models = $object->models;
foreach ($object->models as $model) { foreach ($object->models as $model) {
if ($cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) { if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) {
$output = theme('islandora_basic_image', array('islandora_object' => $object)); $output = theme('islandora_basic_image', array('islandora_object' => $object));
return array('Basic Image Output' => $output); return array('Basic Image Output' => $output);
} }

Loading…
Cancel
Save