@ -2,17 +2,21 @@
/**
/**
* @file
* @file
*
* This administration form for this module.
* islandora.admin.inc: This file contains the general islandora admin form and
* callback functions.
*/
*/
/**
/**
* 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
* @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');
module_load_include('inc', 'islandora', 'includes/utilities');
drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css');
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 ($info) {
if ($dc) {
if ($dc) {
$confirmation_message = '< img src = "' . url('misc/watchdog-ok.png') . '" / > '
$confirmation_message = theme_image(array('path' => 'misc/watchdog-ok.png', 'attributes' => array()));
. t('Successfully connected to Fedora Server (Version !version).', array('!version' => $info['repositoryVersion']));
$confirmation_message .= t('Successfully connected to Fedora Server (Version !version).', array(
'!version' => $info['repositoryVersion']));
}
}
else {
else {
$confirmation_message = '< img src = "' . url('misc/watchdog-warning.png') . '" / > '
$confirmation_message = theme_image(array('path' => 'misc/watchdog-warning.png', 'attributes' => array()));
. 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 .= t('Unable to authenticate when connecting to to Fedora Server (Version !version). Please configure the !filter.',
array('!version' => $info['repositoryVersion'], '!filter' => 'Drupal Filter'));
}
}
}
}
else {
else {
$confirmation_message = '< img src = "' . url('misc/watchdog-error.png') . '" / > '
$confirmation_message = theme_image(array('path' => 'misc/watchdog-error.png', 'attributes' => array()));
. t('Unable to connect to Fedora server at !islandora_url', array('!islandora_url' => $url));
$confirmation_message .= t('Unable to connect to Fedora server at !islandora_url', array(
'!islandora_url' => $url));
}
}
$form['islandora_tabs'] = array(
$form['islandora_tabs'] = array(
@ -69,7 +76,7 @@ function islandora_repository_admin($form, &$form_state) {
'#title' => t('General Configuarion'),
'#title' => t('General Configuarion'),
);
);
// ajax wrapper for url checking
// Ajax wrapper for url checking.
$form['islandora_tabs']['islandora_general']['wrapper'] = array(
$form['islandora_tabs']['islandora_general']['wrapper'] = array(
'#prefix' => '< div id = "islandora-url" > ',
'#prefix' => '< div id = "islandora-url" > ',
'#suffix' => '< / div > ',
'#suffix' => '< / div > ',
@ -116,7 +123,7 @@ function islandora_repository_admin($form, &$form_state) {
'#weight' => -1,
'#weight' => -1,
'#type' => 'checkbox',
'#type' => 'checkbox',
'#title' => t('Enforce namespace restrictions'),
'#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),
'#default_value' => variable_get('islandora_namespace_restriction_enforced', FALSE),
'#ajax' => array(
'#ajax' => array(
'callback' => 'islandora_update_namespace_div',
'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) {
function islandora_update_url_div(array $form, array $form_state) {
unset($form_state['submit_handlers']);
$form_state['rebuild'] = TRUE;
return $form['islandora_tabs']['islandora_general']['wrapper'];
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) {
function islandora_update_namespace_div(array $form, array $form_state) {
unset($form_state['submit_handlers']);
$form_state['rebuild'] = TRUE;
return $form['islandora_tabs']['islandora_namespace']['wrapper'];
return $form['islandora_tabs']['islandora_namespace']['wrapper'];
}
}