From c1615e48750eaf2d1ab8efa6c5af732be8acd2ea Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 7 May 2012 20:36:36 -0300 Subject: [PATCH] Use Drupal functions in XSLT to generate URLs. Also, use imagecache_external! --- fedora_repository.module | 10 ++++++++++ formClass.inc | 4 ++-- xsl/sparql_to_html.xsl | 28 ++++++++++++++++------------ 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 6371c52e..8642de9c 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -2458,3 +2458,13 @@ function fedora_repository_render_image($pid, $dsid, $imagecache_preset = 'fedor return _fedora_repository_render_image($tn_path, $imagecache_preset); } + +/** + * Convenience function used in XSLT callback... + * + * @param $string string + * A string containing some markup to convert to a domnode. + */ +function fedora_repository_string_to_domnode($string) { + return DOMDocument::loadXML($string); +} diff --git a/formClass.inc b/formClass.inc index 7dc1ca6f..40b2cb4e 100644 --- a/formClass.inc +++ b/formClass.inc @@ -330,8 +330,8 @@ class formClass { '#default_value' => variable_get('fedora_repository_use_imagecache_external_in_collection_view', FALSE), '#description' => t('If enabled, the default collection list view (or ' . 'anywhere the function "@function" is used) will try to use ' . - 'imagecache_external, defaulting to the "@preset" preset. Note that ' . - 'this means it will NOT (currently) work with collections rendered via "@xsl".', + 'imagecache_external, defaulting to the "@preset" preset. XSLTs may ' . + 'be updated to use this function.', array( '@function' => '_fedora_repository_render_image()', '@preset' => 'fedora_repository_collection_thumbnail', diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index c5974403..0c9c5bcc 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -1,11 +1,14 @@ - - - + + + + + + fedora_repository_collection_thumbnail + - @@ -42,7 +45,7 @@
  • - + <Prev @@ -53,7 +56,7 @@
  • - + Next> @@ -64,7 +67,7 @@
  • - + <Prev   @@ -72,7 +75,7 @@
  • - + Next> @@ -101,12 +104,12 @@ - + - + @@ -116,10 +119,11 @@ - + +