From 59b1ace0cb65874cc3fc91723fc3d8337f4bcd30 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 18 Jan 2013 14:37:40 +0100 Subject: [PATCH 1/3] Display admin form status icons when clean urls are off. The icon for the status of the repository was not displaying when clean urls was turned off. Image files can't be referenced with through the query "q" paramter. --- admin/islandora.admin.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/admin/islandora.admin.inc b/admin/islandora.admin.inc index 3e6ba3fb..30cb1941 100644 --- a/admin/islandora.admin.inc +++ b/admin/islandora.admin.inc @@ -47,17 +47,20 @@ function islandora_repository_admin($form, &$form_state) { if ($info) { if ($dc) { - $confirmation_message = '' - . t('Successfully connected to Fedora Server (Version !version).', array('!version' => $info['repositoryVersion'])); + $confirmation_message = theme_image(array('path' => 'misc/watchdog-ok.png', 'attributes' => array())); + $confirmation_message .= t('Successfully connected to Fedora Server (Version !version).', array( + '!version' => $info['repositoryVersion'])); } else { - $confirmation_message = '' - . t('Unable to authenticate when connecting to to Fedora Server (Version !version). Please configure the !filter.', array('!version' => $info['repositoryVersion'], '!filter' => 'Drupal Filter')); + $confirmation_message = theme_image(array('path' => 'misc/watchdog-warning.png', 'attributes' => array())); + $confirmation_message .= t('Unable to authenticate when connecting to to Fedora Server (Version !version). Please configure the !filter.', + array('!version' => $info['repositoryVersion'], '!filter' => 'Drupal Filter')); } } else { - $confirmation_message = ' ' - . t('Unable to connect to Fedora server at !islandora_url', array('!islandora_url' => $url)); + $confirmation_message = theme_image(array('path' => 'misc/watchdog-error.png', 'attributes' => array())); + $confirmation_message .= t('Unable to connect to Fedora server at !islandora_url', array( + '!islandora_url' => $url)); } $form['islandora_tabs'] = array( From 65764f0e754b6059afc112140ba7d6c43f52c692 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 18 Jan 2013 14:39:35 +0100 Subject: [PATCH 2/3] Standards compliance. --- admin/islandora.admin.inc | 46 ++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/admin/islandora.admin.inc b/admin/islandora.admin.inc index 30cb1941..d3bccd5a 100644 --- a/admin/islandora.admin.inc +++ b/admin/islandora.admin.inc @@ -2,17 +2,21 @@ /** * @file - * - * islandora.admin.inc: This file contains the general islandora admin form and - * callback functions. + * This administration form for this module. */ /** - * Create admin form + * The administration form for the fedora repository connection. + * + * @param array $form + * The Drupal form definition. + * @param array $form_state + * The Drupal form state. * * @return array + * The Drupal form definition. */ -function islandora_repository_admin($form, &$form_state) { +function islandora_repository_admin(array $form, array &$form_state) { module_load_include('inc', 'islandora', 'includes/utilities'); drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css'); @@ -72,7 +76,7 @@ function islandora_repository_admin($form, &$form_state) { '#title' => t('General Configuarion'), ); - // ajax wrapper for url checking + // Ajax wrapper for url checking. $form['islandora_tabs']['islandora_general']['wrapper'] = array( '#prefix' => '
', '#suffix' => '
', @@ -119,7 +123,7 @@ function islandora_repository_admin($form, &$form_state) { '#weight' => -1, '#type' => 'checkbox', '#title' => t('Enforce namespace restrictions'), - '#description' => t('Allow administrator to restrict user\'s access to the PID namepaces listed below'), + '#description' => t("Allow administrator to restrict user's access to the PID namepaces listed below"), '#default_value' => variable_get('islandora_namespace_restriction_enforced', FALSE), '#ajax' => array( 'callback' => 'islandora_update_namespace_div', @@ -151,19 +155,31 @@ function islandora_repository_admin($form, &$form_state) { } /** - * Checks url validity and refreshes requestHandler dropdown list + * Get the element to render for the AJAX event that triggered this callback. + * + * @param array $form + * The Drupal form definition. + * @param array $form_state + * The Drupal form state. + * + * @return array + * The form element to render. */ -function islandora_update_url_div($form, $form_state) { - unset($form_state['submit_handlers']); - $form_state['rebuild'] = TRUE; +function islandora_update_url_div(array $form, array $form_state) { return $form['islandora_tabs']['islandora_general']['wrapper']; } /** - * Checks url validity and refreshes requestHandler dropdown list + * Get the element to render for the AJAX event that triggered this callback. + * + * @param array $form + * The Drupal form definition. + * @param array $form_state + * The Drupal form state. + * + * @return array + * The form element to render. */ -function islandora_update_namespace_div($form, $form_state) { - unset($form_state['submit_handlers']); - $form_state['rebuild'] = TRUE; +function islandora_update_namespace_div(array $form, array $form_state) { return $form['islandora_tabs']['islandora_namespace']['wrapper']; } From 90a624621fce1d99c67f96fb236a5d9de40e4fad Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Fri, 18 Jan 2013 14:41:05 +0100 Subject: [PATCH 3/3] Follow file naming/placement conventions --- admin/islandora.admin.inc => includes/admin.form.inc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename admin/islandora.admin.inc => includes/admin.form.inc (100%) diff --git a/admin/islandora.admin.inc b/includes/admin.form.inc similarity index 100% rename from admin/islandora.admin.inc rename to includes/admin.form.inc