Browse Source

Merge pull request #575 from DiegoPino/7.x

Restored isPartOf, order by, added comp. predicate
pull/589/head
Nick Ruest 10 years ago
parent
commit
ef5df7edff
  1. 7
      includes/breadcrumb.inc

7
includes/breadcrumb.inc

@ -91,6 +91,7 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository,
!optionals !optionals
!filters !filters
} }
!order
EOQ; EOQ;
$query_optionals = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_optionals', 'view'); $query_optionals = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_optionals', 'view');
@ -98,10 +99,14 @@ EOQ;
$filter_map = function ($filter) { $filter_map = function ($filter) {
return "FILTER($filter)"; return "FILTER($filter)";
}; };
$query_filters[] = "sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOfCollection>) || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOf>)"; $collection_predicate_filters = "sameTerm(?collection_predicate, <fedora-rels-ext:isPartOf>)";
$collection_predicate_filters .= " || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOfCollection>) || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOf>)";
$query_filters[] = $collection_predicate_filters;
$query_order = "ORDER BY DESC(?label)";
$query = format_string($query, array( $query = format_string($query, array(
'!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '', '!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '',
'!filters' => implode(' ', array_map($filter_map, $query_filters)), '!filters' => implode(' ', array_map($filter_map, $query_filters)),
'!order' => $query_order,
)); ));
$query = format_string($query, array( $query = format_string($query, array(
'!pid' => $pid, '!pid' => $pid,

Loading…
Cancel
Save