Browse Source

Allow for the connection function to take a user and url much like the connection constructor.

pull/209/head
Nigel Banks 12 years ago
parent
commit
aafa625d37
  1. 2
      admin/islandora.admin.inc
  2. 4
      islandora.module

2
admin/islandora.admin.inc

@ -24,7 +24,7 @@ function islandora_repository_admin($form, &$form_state) {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
}
$connection = islandora_get_tuque_connection();
$connection = islandora_get_tuque_connection(NULL, $url);
if (!$connection) {
return;
}

4
islandora.module

@ -461,13 +461,13 @@ function islandora_default_islandora_view_object($object) {
* @return IslandoraTuque
* A IslandoraTuque instance
*/
function islandora_get_tuque_connection() {
function islandora_get_tuque_connection($user = NULL, $url = NULL) {
module_load_include('inc', 'islandora', 'includes/IslandoraTuque');
$tuque = &drupal_static(__FUNCTION__);
if (!$tuque) {
if (IslandoraTuque::exists()) {
try {
$tuque = new IslandoraTuque();
$tuque = new IslandoraTuque($user, $url);
} catch (Exception $e) {
drupal_set_message(t('Unable to connect to the repository %e', array('%e' => $e)), 'error');
}

Loading…
Cancel
Save