From 56337c25ec4d873cb0afe0e085884ec5b29418b9 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 10:24:49 -0400 Subject: [PATCH 1/4] ISLANDORA-171 Interim update. --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 0644d6c2..30d5b34b 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -430,7 +430,7 @@ class CollectionClass { $tabset['view_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', - '#title' => t('Members'), + '#title' => t($this->pid), '#content' => $collection_items ); $tabset['add_tab'] = array( From ac7f71d04572a31d69fb0cb0e2b0fcf283aa6b57 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 10:47:59 -0400 Subject: [PATCH 2/4] ISLANDORA-194 Add permission check to purge object form. --- fedora_repository.module | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index 818fc4ac..623217ef 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -236,7 +236,12 @@ function fedora_repository_ingest_form(&$form_state, $collection_pid, $collectio function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { global $base_url; - // $form['#redirect'] = "fedora/repository/$collectionPid/"; + if (!user_access('purge objects and datastreams')) { + return NULL; + } + if ($pid == NULL) { + return NULL; + } $form['pid'] = array( '#type' => 'hidden', '#value' => "$pid" From 767699a07b01490a83d3464cdcab5eae3ef1bc6d Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 11:31:29 -0400 Subject: [PATCH 3/4] ISLANDORA-171 Don't show Add tab if the add object form is empty. --- CollectionClass.inc | 5 ++--- formClass.inc | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 30d5b34b..2f7d248c 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -436,12 +436,11 @@ class CollectionClass { $tabset['add_tab'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', - '#title' => t('Add / Edit'), + '#title' => t('Add'), '#selected' => $show_ingest_tab, // This will be the content of the tab. '#content' => $add_to_collection, ); - return $tabset; } @@ -464,7 +463,7 @@ class CollectionClass { } } else { - $ingestObject = ' '; + $ingestObject = ''; } return $ingestObject; diff --git a/formClass.inc b/formClass.inc index b3f1d710..6fe8efe3 100644 --- a/formClass.inc +++ b/formClass.inc @@ -707,8 +707,10 @@ class formClass { '#default_value' => variable_get('feed_item_length', 'teaser'), '#weight' => '-1', '#description' => t('Datastream IDs defined by the content model.'), - ); - $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids); + ); + + $form['stream_id']['#options'] = array_combine($unused_dsids, $unused_dsids); + } else { $form['stream_id'] = array( From 146b5f979c1c4eb73a63a47692f2a56f7910db4a Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 15:40:53 -0400 Subject: [PATCH 4/4] ISLANDORA-171 Code cleanup --- CollectionClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index 2f7d248c..84d67dae 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -430,7 +430,7 @@ class CollectionClass { $tabset['view_tab'] = array( // $collection_fieldset = array ( '#type' => 'tabpage', - '#title' => t($this->pid), + '#title' => 'View', '#content' => $collection_items ); $tabset['add_tab'] = array(