Browse Source

Merge pull request #44 from ajstanley/6.x

Change the way we checked for ISLANDORACM datastream to take some strain
pull/45/merge
Ben Woodhead 13 years ago
parent
commit
42b6ad36a6
  1. 9
      api/fedora_utils.inc

9
api/fedora_utils.inc

@ -6,7 +6,6 @@
* @file * @file
* Base utilities used by the Islandora fedora module. * Base utilities used by the Islandora fedora module.
*/ */
if (!function_exists('str_getcsv')) { if (!function_exists('str_getcsv')) {
/** /**
@ -98,7 +97,6 @@ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $p
global $user; global $user;
// Check if we are inside Drupal and there is a valid user. // Check if we are inside Drupal and there is a valid user.
// If the user is not valid for a Fedora call curl will throw an exception. // If the user is not valid for a Fedora call curl will throw an exception.
if ((!isset($user)) || $user->uid == 0) { if ((!isset($user)) || $user->uid == 0) {
$fedora_user = 'anonymous'; $fedora_user = 'anonymous';
@ -133,7 +131,6 @@ function do_curl_ext($url, $return_to_variable = 1, $number_of_post_vars = 0, $p
$error_string = curl_error($ch); $error_string = curl_error($ch);
return array($ret_val, $error_code, $error_string); return array($ret_val, $error_code, $error_string);
} }
else { else {
if (function_exists(drupal_set_message)) { if (function_exists(drupal_set_message)) {
drupal_set_message(t('No curl support.'), 'error'); drupal_set_message(t('No curl support.'), 'error');
@ -162,7 +159,6 @@ function risearch_available() {
return ($response != NULL) ? ($response[1] == 0) : FALSE; return ($response != NULL) ? ($response[1] == 0) : FALSE;
} }
/** /**
* Returns a UTF-8-encoded transcripiton of the string given in $in_str. * Returns a UTF-8-encoded transcripiton of the string given in $in_str.
* @param string $in_str * @param string $in_str
@ -264,7 +260,7 @@ function get_collections_as_option_array() {
/** /**
* Function: get_content_models_as_option_array * Function: get_content_models_as_option_array
* *
* Description: Returns an associative array of all collection objects in Fedora instance * Description: Returns an associative array of all available content models in Fedora instance
* *
* @return array * @return array
*/ */
@ -298,7 +294,8 @@ function get_content_models_as_option_array() {
$item = new fedora_item($parts[0]); $item = new fedora_item($parts[0]);
$nameparts = explode(':', $parts[0]); $nameparts = explode(':', $parts[0]);
if (!$restricted || in_array($nameparts[0], $allowed)) if (!$restricted || in_array($nameparts[0], $allowed))
if ($item->get_datastream_dissemination('ISLANDORACM')) { $datastreams = array_keys($item->get_datastreams_list_as_array());
if (in_array('ISLANDORACM', $datastreams)) {
$options[$parts[0]] = $parts[1] . ' ~ ' . $parts[0]; $options[$parts[0]] = $parts[1] . ' ~ ' . $parts[0];
} }
} }

Loading…
Cancel
Save