|
|
@ -77,37 +77,50 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
$query_string = 'select $parentObject $title $content from <#ri> |
|
|
|
|
|
|
|
where ( |
|
|
|
$query = <<<EOQ |
|
|
|
<info:fedora/' . $pid . '> <fedora-model:label> $title |
|
|
|
PREFIX islandora-rels-ext: <http://islandora.ca/ontology/relsext#> |
|
|
|
and $parentObject <fedora-model:hasModel> $content |
|
|
|
PREFIX fedora-rels-ext: <info:fedora/fedora-system:def/relations-external#> |
|
|
|
and ( |
|
|
|
SELECT DISTINCT ?object ?label |
|
|
|
<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject |
|
|
|
FROM <#ri> |
|
|
|
or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject |
|
|
|
WHERE { |
|
|
|
or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject |
|
|
|
<info:fedora/!pid> ?collection_predicate ?object; |
|
|
|
) |
|
|
|
<fedora-model:label> ?label . |
|
|
|
and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active> |
|
|
|
?object <fedora-model:state> <fedora-model:Active> |
|
|
|
) |
|
|
|
. |
|
|
|
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0> |
|
|
|
!optionals |
|
|
|
minus $parentObject <mulgara:is> <info:fedora/' . $pid . '> |
|
|
|
!filters |
|
|
|
order by $title desc'; |
|
|
|
} |
|
|
|
$results = $repository->ri->itqlQuery($query_string); |
|
|
|
EOQ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query_optionals = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_optionals', 'view'); |
|
|
|
|
|
|
|
$query_filters = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_filters'); |
|
|
|
|
|
|
|
$filter_map = function ($filter) { |
|
|
|
|
|
|
|
return "FILTER($filter)"; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
$query_filters[] = "sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOfCollection>) || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOf>)"; |
|
|
|
|
|
|
|
$query = format_string($query, array( |
|
|
|
|
|
|
|
'!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '', |
|
|
|
|
|
|
|
'!filters' => implode(' ', array_map($filter_map, $query_filters)), |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
$query = format_string($query, array( |
|
|
|
|
|
|
|
'!pid' => $pid, |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$results = $repository->ri->sparqlQuery($query, 'unlimited'); |
|
|
|
|
|
|
|
|
|
|
|
if (count($results) > 0 && $context['level'] > 0) { |
|
|
|
if (count($results) > 0 && $context['level'] > 0) { |
|
|
|
$parent = $results[0]['parentObject']['value']; |
|
|
|
$parent = $results[0]['object']['value']; |
|
|
|
$this_title = $results[0]['title']['value']; |
|
|
|
$this_label = $results[0]['label']['value']; |
|
|
|
|
|
|
|
|
|
|
|
if (empty($this_title)) { |
|
|
|
if (empty($this_label)) { |
|
|
|
$this_title = t('-'); |
|
|
|
$this_label = t('-'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$context['level']--; |
|
|
|
$context['level']--; |
|
|
|
return array_merge( |
|
|
|
return array_merge(islandora_get_breadcrumbs_recursive($parent, $repository, $context), array( |
|
|
|
islandora_get_breadcrumbs_recursive($parent, $repository, $context), |
|
|
|
l($this_label, "islandora/object/$pid"), |
|
|
|
array( |
|
|
|
)); |
|
|
|
l($this_title, "islandora/object/$pid"), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
// Add an non-link, as we don't know how to get back to the root, and |
|
|
|
// Add an non-link, as we don't know how to get back to the root, and |
|
|
|