Browse Source

Merge https://github.com/Islandora/islandora into ISLANDORA-250

pull/105/head
Adam Vessey 14 years ago
parent
commit
237309380a
  1. 59
      ObjectHelper.inc
  2. 4
      fedora_repository.module
  3. 3
      formClass.inc

59
ObjectHelper.inc

@ -363,7 +363,7 @@ class ObjectHelper {
$ds_list = $item->get_datastreams_list_as_array(); $ds_list = $item->get_datastreams_list_as_array();
$output = $this->getFormattedDC($item); $output = $this->getFormattedDC($item);
$dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC'; $dsid = array_key_exists('QDC', $ds_list) ? 'QDC' : 'DC';
$path = drupal_get_path('module', 'fedora_repository');
//$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1)); //$baseUrl=substr($baseUrl, 0, (strpos($baseUrl, "/")-1));
if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) { if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) {
@ -374,7 +374,7 @@ class ObjectHelper {
if ($allow) { if ($allow) {
$output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' . $output .= '<br /><a title = "' . t('Edit Meta Data') . '" href="' . $base_url . '/fedora/repository/' . 'editmetadata/' . $pid . '/' .
$dsId . '"><img src="' . $base_url . '/' . $path . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>'; $dsid . '"><img src="' . $base_url . '/' . $path . '/images/edit.gif" alt="' . t('Edit Meta Data') . '" /></a>';
} }
} }
@ -850,34 +850,37 @@ class ObjectHelper {
module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_utils');
// Before executing the query, we hve a base case of accessing the top-level collection // Before executing the query, we hve a base case of accessing the top-level collection
global $base_url; global $base_url;
$query_string = 'select $parentObject $title $content from <#ri> if ($pid == variable_get('fedora_repository_pid', 'islandora:top')){
where (<info:fedora/' . $pid . '> <dc:title> $title
and $parentObject <fedora-model:hasModel> $content
and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject
or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject
or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject)
and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>
order by $title';
$query_string = htmlentities(urlencode($query_string));
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string;
$result = preg_split('/[\r\n]+/',do_curl($url));
array_shift($result); // throw away first line
$matches =str_getcsv(join("\n",$result));
if ($matches !== FALSE) {
$parent = preg_replace('/^info:fedora\//','',$matches[0]);
$breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid);
if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url); $breadcrumbs[] = l(t('Home'), $base_url);
} else {
$query_string = 'select $parentObject $title $content from <#ri>
} elseif ($level > 0) { where (<info:fedora/' . $pid . '> <dc:title> $title
$this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); and $parentObject <fedora-model:hasModel> $content
and (<info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOfCollection> $parentObject
or <info:fedora/' . $pid . '> <fedora-rels-ext:isMemberOf> $parentObject
or <info:fedora/' . $pid . '> <fedora-rels-ext:isPartOf> $parentObject)
and $parentObject <fedora-model:state> <info:fedora/fedora-system:def/model#Active>)
minus $content <mulgara:is> <info:fedora/fedora-system:FedoraObject-3.0>
order by $title';
$query_string = htmlentities(urlencode($query_string));
$url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch');
$url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string;
$result = preg_split('/[\r\n]+/',do_curl($url));
array_shift($result); // throw away first line
$matches =str_getcsv(join("\n",$result));
if ($matches !== FALSE) {
$parent = preg_replace('/^info:fedora\//','',$matches[0]);
$breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid);
if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) {
$breadcrumbs[] = l(t('Digital repository'), 'fedora/repository');
$breadcrumbs[] = l(t('Home'), $base_url);
} elseif ($level > 0) {
$this->getBreadcrumbs($parent, $breadcrumbs, $level - 1);
}
} }
} }
} }

4
fedora_repository.module

@ -22,9 +22,7 @@ function fedora_repository_admin() {
return $adminForm->createAdminForm(); return $adminForm->createAdminForm();
} }
function fedora_repository_admin_settings_submit($form, $form_values) {
drupal_set_message("Custom form handler.");
}
/** /**
* drupal hook * drupal hook

3
formClass.inc

@ -380,8 +380,7 @@ class formClass {
$form['#attributes'] = array('enctype' => "multipart/form-data"); $form['#attributes'] = array('enctype' => "multipart/form-data");
// Additional form handling for file uploads.
$form['#submit'][] = 'fedora_repository_admin_settings_submit';
return system_settings_form($form); return system_settings_form($form);
} }

Loading…
Cancel
Save