Commit 4f53b6fd authored by Mark Jordan's avatar Mark Jordan
Browse files

Initial commit.

parents
This diff is collapsed.
# Islandora OAI Filter
Filters out `dc:identifier` elements that contain `content.lib.sfu.ca`.
name = Islandora OAI Filter
description = Module that modifies outgoing OAI-PMH records.
version = 7.x-dev
core = 7.x
dependencies[] = islandora
dependencies[] = islandora_oai
<?php
function islandora_oai_filter_islandora_oai_record_alter(&$oai_record, &$params) {
if ($params['metadata_prefix'] == 'oai_dc') {
$day = date("l");
$dom = new DOMDocument;
$dom->preserveWhiteSpace = FALSE;
$dom->formatOutput = TRUE;
$dom->loadXML($oai_record);
// Get all identifiers
$identifiers = $dom->getElementsByTagName('identifier');
foreach ($identifiers as $identifier) {
if (preg_match('/content\.lib\.sfu\.ca/', $identifier->nodeValue)) {
$dom->documentElement->removeChild($identifier);
}
}
$oai_record = $dom->saveXML($dom->documentElement);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment