@ -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');
@ -47,17 +51,20 @@ function islandora_repository_admin($form, &$form_state) {
if ($info) {
if ($dc) {
$confirmation_message = '< img src = "' . url('misc/watchdog-ok.png') . '" / > '
. 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 = '< img src = "' . url('misc/watchdog-warning.png') . '" / > '
. 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 = '< img src = "' . url('misc/watchdog-error.png') . '" / > '
. 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(
@ -69,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' => '< div id = "islandora-url" > ',
'#suffix' => '< / div > ',
@ -116,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',
@ -148,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'];
}