From 8e3e02634c0a1fc34e128057881ea3768ac69532 Mon Sep 17 00:00:00 2001 From: William Panting Date: Wed, 11 Apr 2012 17:15:40 -0300 Subject: [PATCH 1/3] object details tab is now diableable --- fedora_repository.module | 20 +++++++++++++------- formClass.inc | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 42eb4c49..96918dc8 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1027,13 +1027,19 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); - $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == TRUE) { - foreach ($cmodels_tabs as &$cmodel_tab) { - if (is_array($cmodel_tab)) { - $cmodel_tab['#selected'] = FALSE; - } - } + + if(variable_get('fedora_repository_show_object_details_tab', FALSE)) {//can disable showing the object details tab in admin UI + $object_details = $obj->showFieldSets(); + if ($object_details['fedora_object_details']['#selected'] == TRUE) { + foreach ($cmodels_tabs as &$cmodel_tab) { + if (is_array($cmodel_tab)) { + $cmodel_tab['#selected'] = FALSE; + } + } + } + } + else { + $object_details = array(); } $hook_tabs = module_invoke_all('islandora_tabs', $content_models, $pid); diff --git a/formClass.inc b/formClass.inc index 293a83ec..d107c047 100644 --- a/formClass.inc +++ b/formClass.inc @@ -301,6 +301,22 @@ class formClass { '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); + + $form['tabs'] = array(//have tabs options (like disable) + '#type' => 'fieldset', + '#title' => t('Tabs Configuration'), + '#description' => t('Configure the tabs avaialble when viewing Fedora objects.'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $form['tabs']['fedora_repository_show_object_details_tab'] = array(//when checked show object details tab + '#type' => 'checkbox', + '#title' => t('Show Object Details Tab'), + '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), + '#description' => t("When enabled, the 'Object Details' tab will be visible when visiting objects if the user has the correct permissions."), + ); + $form['advanced'] = array( '#type' => 'fieldset', '#title' => t('Advanced configuration options'), From a691d23b8366ec33f02a2f3a7ecbf2f40645aaf5 Mon Sep 17 00:00:00 2001 From: William Panting Date: Thu, 12 Apr 2012 09:38:34 -0300 Subject: [PATCH 2/3] acted on comments from jonathangreen --- fedora_repository.module | 3 ++- formClass.inc | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 96918dc8..f477e9f5 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1028,7 +1028,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU // Add a 'manage object' tab for all objects, where detailed list of content is shown. $obj = new FedoraObjectDetailedContent($pid); - if(variable_get('fedora_repository_show_object_details_tab', FALSE)) {//can disable showing the object details tab in admin UI + //can disable showing the object details tab in admin UI + if (variable_get('fedora_repository_show_object_details_tab', TRUE)) { $object_details = $obj->showFieldSets(); if ($object_details['fedora_object_details']['#selected'] == TRUE) { foreach ($cmodels_tabs as &$cmodel_tab) { diff --git a/formClass.inc b/formClass.inc index d107c047..8f936f24 100644 --- a/formClass.inc +++ b/formClass.inc @@ -301,16 +301,16 @@ class formClass { '#default_value' => variable_get('fedora_repository_title', 'Digital Repository'), '#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'), ); - - $form['tabs'] = array(//have tabs options (like disable) + //have tabs options (like disable) + $form['tabs'] = array( '#type' => 'fieldset', '#title' => t('Tabs Configuration'), '#description' => t('Configure the tabs avaialble when viewing Fedora objects.'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); - - $form['tabs']['fedora_repository_show_object_details_tab'] = array(//when checked show object details tab + //when checked show object details tab + $form['tabs']['fedora_repository_show_object_details_tab'] = array( '#type' => 'checkbox', '#title' => t('Show Object Details Tab'), '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), From 45209b87fc813bac6113a098b4e4b4334a87453c Mon Sep 17 00:00:00 2001 From: William Panting Date: Thu, 12 Apr 2012 09:43:47 -0300 Subject: [PATCH 3/3] changed text for object details toggle as David Wilcox asked --- formClass.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 8f936f24..0fa07e98 100644 --- a/formClass.inc +++ b/formClass.inc @@ -314,7 +314,7 @@ class formClass { '#type' => 'checkbox', '#title' => t('Show Object Details Tab'), '#default_value' => variable_get('fedora_repository_show_object_details_tab', TRUE), - '#description' => t("When enabled, the 'Object Details' tab will be visible when visiting objects if the user has the correct permissions."), + '#description' => t("When enabled, the 'Object Details' tab will be visible to users with the correct permissions when viewing an object in the repository"), ); $form['advanced'] = array(