|
|
@ -7,13 +7,26 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
function islandora_repository_admin() { |
|
|
|
function islandora_repository_admin() { |
|
|
|
if (!user_access('administer site configuration')) { |
|
|
|
module_load_include('inc', 'islandora', 'RestConnection'); |
|
|
|
drupal_set_message(t('You must be a site administrator to edit the Fedora collections list.'), 'error'); |
|
|
|
|
|
|
|
|
|
|
|
if (!RestConnection::exists()) { |
|
|
|
|
|
|
|
$message = t('This module requires the !url. Please install sites all libraries folder before continuing.', array('!url' => l(t('Tuque Fedora API'), 'http://github.com/islandora/tuque'))); |
|
|
|
|
|
|
|
drupal_set_message(check_plain($message)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$form = array(); |
|
|
|
$form = array(); |
|
|
|
$form['islandora_repository_pid'] = array( |
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_tabs'] = array( |
|
|
|
|
|
|
|
'#type' => 'vertical_tabs', |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_tabs']['islandora_general'] = array( |
|
|
|
|
|
|
|
'#type' => 'fieldset', |
|
|
|
|
|
|
|
'#title' => t('General Configuarion'), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_tabs']['islandora_general']['islandora_repository_pid'] = array( |
|
|
|
'#type' => 'textfield', |
|
|
|
'#type' => 'textfield', |
|
|
|
'#title' => t('Root Collection PID'), |
|
|
|
'#title' => t('Root Collection PID'), |
|
|
|
'#default_value' => variable_get('islandora_repository_pid', 'islandora:root'), |
|
|
|
'#default_value' => variable_get('islandora_repository_pid', 'islandora:root'), |
|
|
@ -22,7 +35,7 @@ |
|
|
|
'#weight' => -18 |
|
|
|
'#weight' => -18 |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_base_url'] = array( |
|
|
|
$form['islandora_tabs']['islandora_general']['islandora_base_url'] = array( |
|
|
|
'#type' => 'textfield', |
|
|
|
'#type' => 'textfield', |
|
|
|
'#title' => t('Fedora base URL'), |
|
|
|
'#title' => t('Fedora base URL'), |
|
|
|
'#default_value' => variable_get('islandora_base_url', 'http://localhost:8080/fedora'), |
|
|
|
'#default_value' => variable_get('islandora_base_url', 'http://localhost:8080/fedora'), |
|
|
@ -32,23 +45,20 @@ |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php |
|
|
|
// will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php |
|
|
|
$form['islandora_namespace'] = array( |
|
|
|
$form['islandora_tabs']['islandora_namespace'] = array( |
|
|
|
'#type' => 'fieldset', |
|
|
|
'#type' => 'fieldset', |
|
|
|
|
|
|
|
'#title' => t('Namespaces'), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_namespace']['islandora_namespace_restriction_enforced'] = array( |
|
|
|
$form['islandora_tabs']['islandora_namespace']['islandora_namespace_restriction_enforced'] = array( |
|
|
|
'#weight' => -1, |
|
|
|
'#weight' => -1, |
|
|
|
'#type' => 'radios', |
|
|
|
'#type' => 'checkbox', |
|
|
|
'#title' => t('Enforce namespace restrictions'), |
|
|
|
'#title' => t('Enforce namespace restrictions'), |
|
|
|
'#options' => array( |
|
|
|
|
|
|
|
TRUE => t('Enabled'), |
|
|
|
|
|
|
|
FALSE => t('Disabled') |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
'#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), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$form['islandora_namespace']['islandora_pids_allowed'] = array( |
|
|
|
$form['islandora_tabs']['islandora_namespace']['islandora_pids_allowed'] = array( |
|
|
|
'#type' => 'textfield', |
|
|
|
'#type' => 'textfield', |
|
|
|
'#title' => t('PID namespaces allowed in this Drupal install'), |
|
|
|
'#title' => t('PID namespaces allowed in this Drupal install'), |
|
|
|
'#default_value' => variable_get('islandora_pids_allowed', 'default: demo: changeme: ilives: islandora-book: books: newspapers: '), |
|
|
|
'#default_value' => variable_get('islandora_pids_allowed', 'default: demo: changeme: ilives: islandora-book: books: newspapers: '), |
|
|
@ -56,6 +66,5 @@ |
|
|
|
'#weight' => 0, |
|
|
|
'#weight' => 0, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return system_settings_form($form); |
|
|
|
return system_settings_form($form); |
|
|
|
} |
|
|
|
} |