From c6beca5ae8b1fea0453f23b5885f21befb526479 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Wed, 4 Sep 2013 09:17:07 -0300 Subject: [PATCH 01/44] allow mulitple mime types for viewers --- includes/solution_packs.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index 7cf0351a..337f76c4 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -679,11 +679,17 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL, $model = function islandora_get_viewers($mimetype = NULL, $content_model = NULL) { $viewers = array(); $defined_viewers = module_invoke_all('islandora_viewer_info'); + + if(!is_array($mimetype)) { + $mimetype = array($mimetype); + } + // Filter viewers by MIME type. foreach ($defined_viewers as $key => $value) { $value['mimetype'] = isset($value['mimetype']) ? $value['mimetype'] : array(); $value['model'] = isset($value['model']) ? $value['model'] : array(); - if (in_array($mimetype, $value['mimetype']) OR in_array($content_model, $value['model'])) { + if (array_intersect($mimetype, $value['mimetype']) OR in_array($content_model, $value['model'])) { + //if (in_array($mimetype, $value['mimetype']) OR in_array($content_model, $value['model'])) { $viewers[$key] = $value; } } From f486133fbbe72869ee50fe86eb965a85091cab25 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Wed, 12 Feb 2014 10:44:56 -0400 Subject: [PATCH 02/44] remove comment --- includes/solution_packs.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index 30cc8576..6f4b4ae3 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -256,7 +256,7 @@ function islandora_solution_pack_form_submit(array $form, array &$form_state) { * the batch. * @param array $not_checked * The object that will bot be install. - * + * * @return array * An array defining a batch which can be passed on to batch_set(). */ @@ -735,7 +735,6 @@ function islandora_get_viewers($mimetype = NULL, $content_model = NULL) { $value['mimetype'] = isset($value['mimetype']) ? $value['mimetype'] : array(); $value['model'] = isset($value['model']) ? $value['model'] : array(); if (array_intersect($mimetype, $value['mimetype']) OR in_array($content_model, $value['model'])) { - //if (in_array($mimetype, $value['mimetype']) OR in_array($content_model, $value['model'])) { $viewers[$key] = $value; } } From 3bdd909e15d5f3b340d3d97aff8fac0426782d21 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Wed, 12 Feb 2014 10:49:42 -0400 Subject: [PATCH 03/44] docs update for array of mime types --- includes/solution_packs.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index 6f4b4ae3..0ff7d253 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -712,9 +712,8 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL, $model = * given, than any viewer that supports either the give $mimetype or $model will * be listed. * - * @param string $mimetype - * Specify a mimetype to return only viewers that support this certain - * mimetype. + * @param array $mimetype + * List of mimetypes that the view supports. * @param string $content_model * Specify a content model to return only viewers that support the content * model. @@ -722,7 +721,7 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL, $model = * @return array * Viewer definitions, or FALSE if none are found. */ -function islandora_get_viewers($mimetype = NULL, $content_model = NULL) { +function islandora_get_viewers($mimetype = array(), $content_model = NULL) { $viewers = array(); $defined_viewers = module_invoke_all('islandora_viewer_info'); From ecb4f09766176fcc0564916f9f046afdf09adea2 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Wed, 12 Feb 2014 10:50:43 -0400 Subject: [PATCH 04/44] spelling --- includes/solution_packs.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index 0ff7d253..d875bc69 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -713,7 +713,7 @@ function islandora_viewers_form($variable_id = NULL, $mimetype = NULL, $model = * be listed. * * @param array $mimetype - * List of mimetypes that the view supports. + * List of mimetypes that the viewer supports. * @param string $content_model * Specify a content model to return only viewers that support the content * model. From 656d2b13058ada19e0a9a7dd670a0826dcf4370e Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Thu, 13 Feb 2014 14:58:37 -0400 Subject: [PATCH 05/44] cs fixes --- includes/solution_packs.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/solution_packs.inc b/includes/solution_packs.inc index d875bc69..0209ecbd 100644 --- a/includes/solution_packs.inc +++ b/includes/solution_packs.inc @@ -725,7 +725,7 @@ function islandora_get_viewers($mimetype = array(), $content_model = NULL) { $viewers = array(); $defined_viewers = module_invoke_all('islandora_viewer_info'); - if(!is_array($mimetype)) { + if (!is_array($mimetype)) { $mimetype = array($mimetype); } From b42d9c5920e3cea7ed315b1e1a3be67ea06b3a7d Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 25 Feb 2014 18:14:01 +0000 Subject: [PATCH 06/44] Change the default view to utilize the new metadata framework. --- includes/datastream.version.inc | 2 +- includes/manage_deleted_objects.inc | 8 +++---- theme/islandora-object.tpl.php | 36 ++++++++++++----------------- theme/theme.inc | 7 ++++++ 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/includes/datastream.version.inc b/includes/datastream.version.inc index 8c02aaad..ecef019d 100644 --- a/includes/datastream.version.inc +++ b/includes/datastream.version.inc @@ -234,7 +234,7 @@ function islandora_revert_datastream_version_form_submit(array $form, array &$fo /** * Gets Audit datastream values from foxml. * - * @param String $pid + * @param string $pid * PID of parent object * * @return array diff --git a/includes/manage_deleted_objects.inc b/includes/manage_deleted_objects.inc index 2708efe3..a6b5e96e 100644 --- a/includes/manage_deleted_objects.inc +++ b/includes/manage_deleted_objects.inc @@ -287,7 +287,7 @@ function islandora_get_contentmodels_with_deleted_members() { /** * Restores deleted object. * - * @param String $pid + * @param string $pid * PID of object to be restored */ function islandora_restore_object_by_pid($pid) { @@ -298,7 +298,7 @@ function islandora_restore_object_by_pid($pid) { /** * Purges deleted object. * - * @param String $pid + * @param string $pid * PID of object to be restored */ function islandora_purge_object_by_pid($pid) { @@ -314,7 +314,7 @@ function islandora_purge_object_by_pid($pid) { * @param int $offset * offset to be added to search * - * @return String + * @return string * Sparql query */ function islandora_get_deleted_query($content_models, $offset = 0) { @@ -332,7 +332,7 @@ function islandora_get_deleted_query($content_models, $offset = 0) { $unions .= "UNION {?subject fm:hasModel ; fm:state fm:Deleted; fm:hasModel ?object; - } + } "; } $optional = "OPTIONAL{?subject fm:label ?label}"; diff --git a/theme/islandora-object.tpl.php b/theme/islandora-object.tpl.php index 6fa306c3..fdd09607 100644 --- a/theme/islandora-object.tpl.php +++ b/theme/islandora-object.tpl.php @@ -60,7 +60,7 @@ ?>

- +
@@ -68,26 +68,10 @@
- +
+ +
+

+
    + +
  • label, "islandora/object/{$collection->id}"); ?>
  • + +
+
+ diff --git a/theme/theme.inc b/theme/theme.inc index b783cfa8..7e54fefd 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -109,6 +109,7 @@ function islandora_preprocess_islandora_default(&$variables) { $islandora_object = $variables['islandora_object']; module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/datastream'); + module_load_include('inc', 'islandora', 'includes/metadata'); $variables['parent_collections'] = islandora_get_parents_from_rels_ext($islandora_object); @@ -140,8 +141,14 @@ function islandora_preprocess_islandora_default(&$variables) { $dc_object = DublinCore::importFromXMLString($islandora_object['DC']->content); $dc_array = $dc_object->asArray(); } + // We should eventually remove the DC object and dc_array code as it only + // exists to not break legacy implementations. $variables['dc_array'] = isset($dc_array) ? $dc_array : array(); $variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; + + $variables['parent_collections'] = islandora_get_parents_from_rels_ext($islandora_object); + $variables['metadata'] = islandora_retrieve_metadata_markup($islandora_object, TRUE); + $variables['description'] = islandora_retrieve_description_markup($islandora_object); $variables['islandora_object_label'] = $islandora_object->label; if (isset($islandora_object['TN']) && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $islandora_object['TN'])) { $variables['islandora_thumbnail_url'] = url("islandora/object/{$islandora_object->id}/datastream/TN/view"); From f8b63e6110a168c76d0484524533dbffe5b6f28d Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 25 Feb 2014 18:20:19 +0000 Subject: [PATCH 07/44] Re-added a variable already defined. --- theme/theme.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/theme/theme.inc b/theme/theme.inc index 7e54fefd..feac06b2 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -146,7 +146,6 @@ function islandora_preprocess_islandora_default(&$variables) { $variables['dc_array'] = isset($dc_array) ? $dc_array : array(); $variables['islandora_dublin_core'] = isset($dc_object) ? $dc_object : NULL; - $variables['parent_collections'] = islandora_get_parents_from_rels_ext($islandora_object); $variables['metadata'] = islandora_retrieve_metadata_markup($islandora_object, TRUE); $variables['description'] = islandora_retrieve_description_markup($islandora_object); $variables['islandora_object_label'] = $islandora_object->label; From ee89aaaaa3a0ea18668ac4cc84aa9c97ec01ce77 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 25 Feb 2014 18:23:04 +0000 Subject: [PATCH 08/44] Add a class that may be needed. --- theme/islandora-dublin-core-display.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/islandora-dublin-core-display.tpl.php b/theme/islandora-dublin-core-display.tpl.php index 2c2a02ee..52c80607 100644 --- a/theme/islandora-dublin-core-display.tpl.php +++ b/theme/islandora-dublin-core-display.tpl.php @@ -17,7 +17,7 @@
>
-