Browse Source

Merge branch '7.x' of github.com:Islandora/islandora into 7.x

Conflicts:
	includes/utilities.inc
	islandora_basic_collection/includes/child_collection.inc
	islandora_basic_collection/includes/manage_policies.inc
pull/123/merge
jonathangreen 13 years ago
parent
commit
257addf6cf
  1. 15
      admin/islandora.admin.inc
  2. 24
      includes/utilities.inc
  3. 1
      islandora.info
  4. 2
      islandora_basic_collection/includes/manage_policies.inc
  5. 1
      islandora_basic_collection/islandora_basic_collection.info
  6. 1
      islandora_basic_image/islandora_basic_image.info

15
admin/islandora.admin.inc

@ -8,6 +8,7 @@
function islandora_repository_admin($form, &$form_state) {
module_load_include('inc', 'islandora', 'includes/tuque');
module_load_include('inc', 'islandora', 'includes/utilities');
if (!IslandoraTuque::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')));
@ -24,16 +25,10 @@ function islandora_repository_admin($form, &$form_state) {
$url = variable_get('islandora_base_url', 'http://localhost:8080/fedora');
}
$connection = new IslandoraTuque(NULL, $url);
try {
$info = $connection->api->a->describeRepository();
$connected = TRUE;
}
catch (RepositoryException $e) {
$connected = FALSE;
}
if($connected) {
// Connect to Fedora
$info = islandora_describe_repository($url);
if($info) {
$confirmation_message = '<img src="' . url('misc/watchdog-ok.png') . '"/>'
. t('Successfully connected to Fedora Server (Version !version).', array('!version' => $info['repositoryVersion']));
}

24
includes/utilities.inc

@ -66,11 +66,33 @@ function islandora_validate_pid($pid) {
* @param type $dsid
* @return boolean
*/
function islandora_validadte_dsid($dsid) {
function islandora_validate_dsid($dsid) {
$valid = FALSE;
if (strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid))) {
$valid = TRUE;
}
return $valid;
}
/* Helper function to describe a Fedora repository.
*
* Can be used to check if Fedora is available.
*
* @param $url
* A url to a Fedora repository.
* @return
* Returns an array describing the repository. Returns FALSE if Fedora is down
* or if the url is incorrect.
*/
function islandora_describe_repository($url) {
$connection = new IslandoraTuque(NULL, $url);
try {
$info = $connection->api->a->describeRepository();
return $info;
}
catch (RepositoryException $e) {
return FALSE;
}
}

1
islandora.info

@ -3,5 +3,6 @@ description = "View and manage Fedora objects"
package = Islandora
version = 7.x-dev
core = 7.x
configure = admin/islandora/configure
stylesheets[all][] = css/islandora.base.css
stylesheets[all][] = css/islandora.theme.css

2
islandora_basic_collection/includes/manage_policies.inc

@ -137,6 +137,7 @@ function islandora_manage_policies_form_validate($form, &$form_state) {
* @param array $form_state
*/
function islandora_manage_policies_form_submit($form, &$form_state) {
module_load_include('module', 'islandora', 'islandora');
$collection_pid = $form_state['values']['parent_collection'];
$collection_object = islandora_object_load($collection_pid);
@ -166,6 +167,7 @@ function islandora_manage_policies_form_submit($form, &$form_state) {
$cp_namespace = $form_state['values']['new_cp_namespace'];
$cp_content_model = $form_state['values']['content_model_to_add'];
$content_model_object = islandora_object_load($cp_content_model);
$content_model_datastream = $content_model_object->getDatastream(variable_get('Islandora_Content_Model_DSID', 'ISLANDORACM'));

1
islandora_basic_collection/islandora_basic_collection.info

@ -3,5 +3,6 @@ description = "A default Islandora Repository module to handle simple collection
dependencies[] = islandora
package = Islandora
core = 7.x
configure = admin/islandora/basic_collection
stylesheets[all][] = css/islandora_basic_collection.base.css
stylesheets[all][] = css/islandora_basic_collection.theme.css

1
islandora_basic_image/islandora_basic_image.info

@ -3,5 +3,6 @@ description = "A default Islandora Repository module to handle images"
dependencies[] = islandora
package = Islandora
core = 7.x
configure = admin/islandora/basic_image
stylesheets[all][] = css/islandora_basic_image.base.css
stylesheets[all][] = css/islandora_basic_image.theme.css
Loading…
Cancel
Save