Browse Source

Coding standards corrections

Minor coding standards fixes to pass Travis tests
pull/574/head
DiegoPino 10 years ago
parent
commit
f34e1eae72
  1. 16
      includes/breadcrumb.inc

16
includes/breadcrumb.inc

@ -78,8 +78,7 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository,
} }
else { else {
$query = <<<EOQ
$query= <<<EOQ
PREFIX islandora-rels-ext: <http://islandora.ca/ontology/relsext#> PREFIX islandora-rels-ext: <http://islandora.ca/ontology/relsext#>
PREFIX fedora-rels-ext: <info:fedora/fedora-system:def/relations-external#> PREFIX fedora-rels-ext: <info:fedora/fedora-system:def/relations-external#>
SELECT DISTINCT ?object ?label SELECT DISTINCT ?object ?label
@ -100,19 +99,15 @@ EOQ;
return "FILTER($filter)"; return "FILTER($filter)";
}; };
$query_filters[] = "sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOfCollection>) || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOf>)"; $query_filters[] = "sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOfCollection>) || sameTerm(?collection_predicate, <fedora-rels-ext:isMemberOf>)";
$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)),
)); ));
$query = format_string($query, array( $query = format_string($query, array(
'!pid' => $pid, '!pid' => $pid,
)); ));
$results = $repository->ri->sparqlQuery($query,'unlimited'); $results = $repository->ri->sparqlQuery($query, 'unlimited');
if (count($results) > 0 && $context['level'] > 0) { if (count($results) > 0 && $context['level'] > 0) {
$parent = $results[0]['object']['value']; $parent = $results[0]['object']['value'];
@ -123,12 +118,9 @@ EOQ;
} }
$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),
array(
l($this_label, "islandora/object/$pid"), l($this_label, "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

Loading…
Cancel
Save