Skip to content

Commit

Permalink
#68: skip call to php function for direct links until logic is more c…
Browse files Browse the repository at this point in the history
…omplicated
  • Loading branch information
ctgraham committed Oct 27, 2021
1 parent a09eeea commit 68d3e43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions theme/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function template_preprocess_islandora_manuscript_ead_display(&$variables) {
);
$variables['xslt_parameters']['']['call_query_link'] = variable_get('islandora_manuscript_query_enable', true) ? 'true' : 'false';
$variables['xslt_parameters']['']['call_direct_link'] = variable_get('islandora_manuscript_direct_enable', false) ? 'true' : false;
$variables['xslt_parameters']['']['direct_link_prefix'] = variable_get('islandora_manuscript_component_xlink_prefix', '');
$variables['doc'] = $doc = new DOMDocument();
$doc->loadXML($variables['object']['EAD']->content);

Expand Down Expand Up @@ -163,6 +164,7 @@ function template_process_islandora_manuscript_ead_display(&$variables) {

/**
* Callback used in XSLT to build a direct URL.
* N.b.: unused, but reserved for future use if logic becomes more complex than a simple prefix
*
* @param DOMAttribute[] $xlink
* An array containing a single DOMAttribute (this is how XSLTProcessor
Expand Down
5 changes: 5 additions & 0 deletions transforms/ead_to_html.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<xsl:param name="call_query_link" />
<xsl:param name="call_direct_link" />
<xsl:param name="direct_link_prefix" />

<xsl:template match="/">
<div class="ead">
Expand Down Expand Up @@ -203,7 +204,11 @@
<xsl:for-each select="ead:dao[@xlink:href]">
<xsl:variable name="direct_url">
<xsl:if test="$call_direct_link = 'true'">
<!--
N.b.: unused but reserved for future use if logic becomes more complex than a simple prefix
<xsl:value-of select="php:function('islandora_manuscript_build_direct_url', @xlink:href)" />
-->
<xsl:value-of select="$direct_link_prefix" /><xsl:value-of select="@xlink:href" />
</xsl:if>
</xsl:variable>
<li>
Expand Down

0 comments on commit 68d3e43

Please sign in to comment.