diff --git a/RestConnection.inc b/RestConnection.inc index 24e65f83..bd1de7e6 100644 --- a/RestConnection.inc +++ b/RestConnection.inc @@ -42,8 +42,15 @@ class RestConnection { public $repository = NULL; function RestConnection($user) { + if(!isset($user) || $user->uid == 0){ + $user_string = 'anonymous'; + $pass_string = 'anonymous'; + } else { + $user_string = $user->name; + $pass_string = $user->pass; + } $url = variable_get('islandora_base_url', 'http://localhost:8080/fedora'); - $this->connection = new RepositoryConnection($url, $user->name, $user->pass); + $this->connection = new RepositoryConnection($url, $user_string, $pass_string); $this->connection->reuseConnection = TRUE; $this->api = new FedoraApi($this->connection); $this->cache = new SimpleCache(); diff --git a/islandora-object-edit.tpl.php b/islandora-object-edit.tpl.php index 180dc6d7..33674e6c 100644 --- a/islandora-object-edit.tpl.php +++ b/islandora-object-edit.tpl.php @@ -1,7 +1,7 @@ $islandora_object->id, '%t' => $e->getMessage())), 'error'); } $variables['islandora_dublin_core'] = $dc_object; + //create a nicer array for themers + //TODO: give this a better home + $dc_array = array(); + foreach ($dc_object as $element) { + if (!empty($element)) { + foreach ($element as $key => $value) { + foreach ($value as $v) { + if (!empty($v)) { + $dc_array[] = array($key => $v); + } + } + } + } + } + $variables['dc_array'] = $dc_array; $variables['islandora_object_label'] = $islandora_object->label; $variables['theme_hook_suggestions'][] = 'islandora_basic_image__' . str_replace(':', '_', $islandora_object->id); global $base_url;