This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:choose> | |
<xsl:when test="@type='uri' or substring(normalize-space(text()), 0, 5) = 'http'"> | |
<a href="{text()}"> | |
<xsl:value-of select="text()"/> | |
</a> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="text()"/> | |
</xsl:otherwise> | |
</xsl:choose> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function islandora_object_datastream_tokened_access_callback($perm, $object = NULL, $datastream = NULL) { | |
module_load_include('inc', 'islandora', 'includes/utilities'); | |
$token = filter_input(INPUT_GET, 'token', FILTER_SANITIZE_STRING); | |
$token_access = islandora_validate_object_token($object->id, $datastream->id, $token); | |
if(islandora_object_datastream_access_callback($perm, $object, $datastream) || $token_access) { // | |
return TRUE; | |
} | |
else { | |
return FALSE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avessey@vassardev:~/temp$ git clone git://github.com/Islandora/islandora_gsearch_extensions.git | |
Cloning into 'islandora_gsearch_extensions'... | |
remote: Counting objects: 6, done. | |
remote: Compressing objects: 100% (3/3), done. | |
remote: Total 6 (delta 0), reused 6 (delta 0) | |
Receiving objects: 100% (6/6), done. | |
avessey@vassardev:~/temp$ cd islandora_gsearch_extensions/ | |
avessey@vassardev:~/temp/islandora_gsearch_extensions$ javac -cp "/usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/lib/*:/usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes" ca/upei/roblib/DataStreamForXSLT.java | |
Note: ca/upei/roblib/DataStreamForXSLT.java uses unchecked or unsafe operations. | |
Note: Recompile with -Xlint:unchecked for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess(). | |
*/ | |
function your_theme_preprocess_islandora_basic_image(&$variables) { | |
mods_metadata($variables); | |
} | |
/* | |
* Use a MODS to HTML xslt for the metadata fieldset | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$results_sorted = array(); | |
foreach ($results as $key => $row) { | |
$results_sorted[$key] = $row['bucket']; | |
} | |
$results_sorted = array_map('strtolower', $results_sorted); | |
array_multisort($results_sorted, SORT_ASC, $results); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function yourthemename_preprocess_islandora_video(&$variables) { | |
$viewer_dsid = 'MP4'; | |
$object = $variables['object']; | |
$video_params = array( | |
'pid' => $object->id, | |
); | |
if (isset($object[$viewer_dsid]) && islandora_datastream_access(FEDORA_VIEW_OBJECTS, $object[$viewer_dsid])) { | |
$video_url = url("islandora/object/{$object->id}/datastream/$viewer_dsid/view"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function islandora_default_preprocess_page(&$vars) { | |
$front = (isset($vars['is_front']) ? $vars['is_front'] : FALSE); | |
$type = (isset($vars['node']->type) ? $vars['node']->type : NULL); | |
if(!$front) { | |
switch ($type) { | |
case 'collection': | |
case 'exhibit': | |
case 'formats': | |
case 'partners': | |
case 'places': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function <theme name>_preprocess_islandora_solr(&$vars) { | |
foreach($vars['results'] as &$doc) { | |
if(isset($doc['some key that only nodes have'])) { | |
$doc['thumbnail'] = 'static or node image'; | |
$doc['object_url'] = 'url for node'; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:if test="not(concat($prefix, local-name()) = $this_prefix)"> | |
<xsl:if test="not(normalize-space($textValue)='')"> | |
<field> | |
<xsl:attribute name="name"> | |
<xsl:value-of select="concat($prefix, local-name(), '_mdt')"/> | |
</xsl:attribute> | |
<xsl:value-of select="$textValue"/> | |
</field> | |
</xsl:if> | |
<xsl:if test="not(normalize-space($rawTextValue)='')"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function renderText($results) { | |
module_load_include('inc', 'islandora', 'includes/utilities'); | |
$facet_field = $this->facet_field; | |
$islandora_solr_query = self::$islandoraSolrQuery; | |
$soft_limit = self::$soft_limit; | |
$buckets = array(); | |
foreach ($results as $key => $values) { | |
$bucket = $values['bucket']; | |
if (variable_get('islandora_solr_facet_replace_pid', FALSE) && islandora_is_valid_pid($bucket)) { | |
if ($object = islandora_object_load($bucket)) { |
OlderNewer