diff --git a/admin/islandora.admin.inc b/admin/islandora.admin.inc index 8194520e..e22fa433 100644 --- a/admin/islandora.admin.inc +++ b/admin/islandora.admin.inc @@ -11,8 +11,7 @@ function islandora_repository_admin($form, &$form_state) { 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'))); - drupal_set_message(check_plain($message)); + IslandoraTuque::getError(); return; } diff --git a/includes/tuque.inc b/includes/tuque.inc index d87c5845..37a6a013 100644 --- a/includes/tuque.inc +++ b/includes/tuque.inc @@ -1,15 +1,15 @@ connection = new RepositoryConnection($url, $user_string, $pass_string); - $this->connection->reuseConnection = TRUE; - $this->api = new FedoraApi($this->connection); - $this->cache = new SimpleCache(); - $this->repository = new FedoraRepository($this->api, $this->cache); + if(self::exists()) { + $this->connection = new RepositoryConnection($url, $user_string, $pass_string); + $this->connection->reuseConnection = TRUE; + $this->api = new FedoraApi($this->connection); + $this->cache = new SimpleCache(); + $this->repository = new FedoraRepository($this->api, $this->cache); + } } static function exists() { return class_exists('RepositoryConnection'); } + + static function getError() { + $islandora_doc_link = l(t('Islandora documentation'), 'https://wiki.duraspace.org/display/ISLANDORA/Islandora'); + $tuque_link = l(t('Tuque Fedora API'), 'http://github.com/islandora/tuque'); + $message = t('Islandora requires the !tuque_url. Please install in /sites/all/libraries/tuque before continuing. See the !islandora_url.', array( '!tuque_url' => $tuque_link, '!islandora_url' => $islandora_doc_link)); + drupal_set_message($message, 'error', FALSE); + } } diff --git a/islandora.module b/islandora.module index 1a6f33ca..7ed87813 100644 --- a/islandora.module +++ b/islandora.module @@ -434,13 +434,18 @@ function islandora_object_load($object_id) { $islandora_tuque = new IslandoraTuque(); } - try { - $fedora_object = $islandora_tuque->repository->getObject($object_id); - } catch (Exception $e) { + if(IslandoraTuque::exists()) { + try { + $fedora_object = $islandora_tuque->repository->getObject($object_id); + } catch (Exception $e) { + return NULL; + } + return $fedora_object; + } + else { + IslandoraTuque::getError(); return NULL; } - - return $fedora_object; } function islandora_ingest_access_callback($object, $perm) { diff --git a/islandora_basic_collection/css/islandora_basic_collection.base.css b/islandora_basic_collection/css/islandora_basic_collection.base.css index 13dd8637..12e2e5b6 100644 --- a/islandora_basic_collection/css/islandora_basic_collection.base.css +++ b/islandora_basic_collection/css/islandora_basic_collection.base.css @@ -1,8 +1,51 @@ /* Document : islandora_basic_collection.base.css Created on : May 23, 2012, 11:22:04 AM - Description: - Purpose of the stylesheet follows. + Description: Base css, for structural layout, + positioning, and to generally make things function in + the most basic form. */ +/* List - Displays lists using a dt on the left and dd on the right */ +.islandora-basic-collection-list-item { + clear: both; + width: 100%; +} + +.islandora-basic-collection-list-item dl dt { + clear: left; + float: left; + padding: 3px 0 0; + text-align: center; + width: 100px; +} + +.islandora-basic-collection-list-item dl dd { + margin: 0 0 0 130px; +} + +/* Grid - Displays grid using dl formatted inline */ +.islandora-basic-collection-grid dl +{ + width: 20%; + min-width: 100px; + min-height: 180px; + display: -moz-inline-stack; + display: inline-block; + vertical-align: top; + margin: 1.5em 2%; + zoom: 1; + *display: inline; + _height: 180px; +} + +.islandora-basic-collection-grid dd +{ + margin: 0; + padding: 0; +} + +.islandora-basic-collection-display-switch { + float: right; +} diff --git a/islandora_basic_collection/css/islandora_basic_collection.theme.css b/islandora_basic_collection/css/islandora_basic_collection.theme.css index e814f526..cb204041 100644 --- a/islandora_basic_collection/css/islandora_basic_collection.theme.css +++ b/islandora_basic_collection/css/islandora_basic_collection.theme.css @@ -1,86 +1,46 @@ /* Document : islandora_basic_collection.theme Created on : May 23, 2012, 11:23:56 AM - Description: - Purpose of the stylesheet follows. + Description: Theme css, like margins, padding, borders, colors, etc */ +/* Make flexible and assure content doesn't go off the page */ .islandora-basic-collection { overflow: hidden; width: 100%; margin: 0 auto; } -.islandora-basic-collection-object { - margin: 1.5em auto 3em; -} - -.islandora-basic-collection-grid dl.islandora-basic-collection-object -{ - width: 20%; - min-width: 100px; - min-height: 180px; - display: -moz-inline-stack; - display: inline-block; - vertical-align: top; - margin: 1.5em 2%; - zoom: 1; - *display: inline; - _height: 180px; -} - -.islandora-basic-collection-grid .islandora-basic-collection-object dt img { - max-width: 100%; - *width: 100%; +/* Round borders on images */ +.islandora-basic-collection-object dt img { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } -.islandora-basic-collection-grid .islandora-basic-collection-object dd -{ - margin: 0; - padding: 0; +/* Set space between objects */ +.islandora-basic-collection-object { + margin: 1.5em auto; } -/* to be moved to admin when it is added */ -#islandora-collection-deletion-form table th.select-all, -#islandora-collection-migrate-form table th.select-all { - width: 20px; +/* Set space between dd items */ +.islandora-basic-collection-object dd { + padding-top: 2px; + padding-bottom: 2px; } -/* the base css for lists is set in islandora, just adding details */ - -dl.islandora-basic-collection-thumb -{ - float: left; - width: 15%; - margin: 0; -} +/* LIST VIEW */ -.islandora-basic-collection-thumb dt, -.islandora-basic-collection-thumb dd -{ - margin: 0; +/* Borders to seperate collection objects */ +.islandora-basic-collection-list-item { + padding-bottom: 1.5em; + border-bottom: 1px solid #ddd; } -dl.islandora-basic-collection-fields -{ - float: right; - width: 83%; - border-top: 0px solid #ddd; - padding-left: 10px; -} - -.islandora-basic-collection-fields dt, -.islandora-basic-collection-fields dd -{ - border-top: 1px solid #ddd; -} -.islandora-basic-collection-fields dt.first, -.islandora-basic-collection-fields dd.first -{ - border-top: 1px solid #ddd; +/* to be moved to admin when it is added */ +#islandora-collection-deletion-form table th.select-all, +#islandora-collection-migrate-form table th.select-all { + width: 20px; } diff --git a/islandora_basic_collection/includes/delete_collection.inc b/islandora_basic_collection/includes/delete_collection.inc index 6e4a4bb8..f7f26a03 100644 --- a/islandora_basic_collection/includes/delete_collection.inc +++ b/islandora_basic_collection/includes/delete_collection.inc @@ -21,7 +21,7 @@ function islandora_collection_deletion_form($form, &$form_state, $object) { $submit_text_message = ($table) ? "Delete selected objects" : "Delete collection"; $form = array(); - + $form['collection_delete']['titlebox'] = array( '#type' => 'item', '#title' => t("Delete objects from @collection_pid", array('@collection_pid' => $pid)), @@ -113,7 +113,7 @@ function islandora_collection_deletion_form_submit($form, &$form_state) { * @param string $pid */ function delete_root_collection($object) { - + $pid = $object->id; try { $object->repository->purgeObject($object->id); } catch (RepositoryException $e) { diff --git a/islandora_basic_collection/includes/manage_policies.inc b/islandora_basic_collection/includes/manage_policies.inc index 1fa3e68f..c5742303 100644 --- a/islandora_basic_collection/includes/manage_policies.inc +++ b/islandora_basic_collection/includes/manage_policies.inc @@ -27,8 +27,9 @@ function islandora_manage_policies_form($form, &$form_state, $collection_object) $item = $repository->getObject($content_model); $cm_name = $item->Label; $cm_options[$content_model] = $cm_name; + } catch (RepositoryException $e) { + } - catch(RepositoryException $e) {} } } @@ -71,36 +72,43 @@ function islandora_manage_policies_form($form, &$form_state, $collection_object) '#title' => t("Manage collection policy for @collection_title", array('@collection_title' => $collection_object->label)), ); - $form ['manage_collection_policy']['add']['content_model_to_add'] = array( - '#title' => "Choose content model", - '#type' => 'select', - '#options' => $new_options, - '#description' => t("Choose content model to add to this collection policy."), - ); + if (count($new_content_models) > 0) { + $form ['manage_collection_policy']['add']['content_model_to_add'] = array( + '#title' => "Choose content model", + '#type' => 'select', + '#options' => $new_options, + '#description' => t("Choose content model to add to this collection policy."), + ); - $form ['manage_collection_policy']['add']['new_cp_namespace'] = array( - '#title' => "Choose namespace", - '#type' => 'textfield', - '#size' => 15, - '#default_value' => $namespace, - '#description' => t("Choose namespace for objects in this collection associated with this content model"), - ); + $form['manage_collection_policy']['add']['new_cp_namespace'] = array( + '#title' => "Choose namespace", + '#type' => 'textfield', + '#size' => 15, + '#default_value' => $namespace, + '#description' => t("Choose namespace for objects in this collection associated with this content model"), + ); - $form['parent_collection'] = array( - '#type' => 'hidden', - '#value' => $collection_object->id, - ); + $form['parent_collection'] = array( + '#type' => 'hidden', + '#value' => $collection_object->id, + ); - $form['collection_pid'] = array( - '#type' => 'hidden', - '#value' => $collection_object->id, - ); + $form['collection_pid'] = array( + '#type' => 'hidden', + '#value' => $collection_object->id, + ); - $form['manage_collection_policy']['add']['submit'] = array( - '#type' => 'submit', - '#value' => t('Add content model to collection policy'), - '#id' => 'add_cm' - ); + $form['manage_collection_policy']['add']['submit'] = array( + '#type' => 'submit', + '#value' => t('Add content model to collection policy'), + '#id' => 'add_cm' + ); + } + else { + $form['manage_collection_policy']['no_content_models'] = array( + '#markup' => t('No content models available to add!'), + ); + } if (count($current_models_in_policy) > 0) { $form['manage_collection_policy']['remove'] = array( @@ -140,7 +148,7 @@ 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); - + $policy = $collection_object->getDatastream(variable_get('Islandora_Collection_Policy_DSID', 'COLLECTION_POLICY')); $collection_policy = ' diff --git a/islandora_basic_collection/islandora_basic_collection.install b/islandora_basic_collection/islandora_basic_collection.install index eb9f1efe..724b76f4 100644 --- a/islandora_basic_collection/islandora_basic_collection.install +++ b/islandora_basic_collection/islandora_basic_collection.install @@ -1,5 +1,18 @@ 'Tuque', + 'description' => 'The Islandora Collection solution pack requires the Tuque library.', + 'severity' => REQUIREMENT_ERROR, + )); + } + } +} + /** * @file * islandora_basic_collection.install diff --git a/islandora_basic_collection/theme/islandora-basic-collection-grid.tpl.php b/islandora_basic_collection/theme/islandora-basic-collection-grid.tpl.php index 5635ebc9..c1489dde 100644 --- a/islandora_basic_collection/theme/islandora-basic-collection-grid.tpl.php +++ b/islandora_basic_collection/theme/islandora-basic-collection-grid.tpl.php @@ -23,7 +23,7 @@ ?> -
+
$value): ?>
diff --git a/islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php b/islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php index 15bdfb72..355da7cf 100644 --- a/islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php +++ b/islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php @@ -24,11 +24,10 @@ label); ?>
-
- - - - - -
+
+ + + + +
\ No newline at end of file diff --git a/islandora_basic_collection/theme/islandora-basic-collection.tpl.php b/islandora_basic_collection/theme/islandora-basic-collection.tpl.php index 3fb1a4c2..33ad0462 100644 --- a/islandora_basic_collection/theme/islandora-basic-collection.tpl.php +++ b/islandora_basic_collection/theme/islandora-basic-collection.tpl.php @@ -23,31 +23,24 @@ ?> label); ?> -
+
-
-
-
-
-
-
\ No newline at end of file diff --git a/islandora_basic_collection/theme/islandora_basic_collection.theme.inc b/islandora_basic_collection/theme/islandora_basic_collection.theme.inc index 1e134d9c..cc5dae16 100644 --- a/islandora_basic_collection/theme/islandora_basic_collection.theme.inc +++ b/islandora_basic_collection/theme/islandora_basic_collection.theme.inc @@ -22,18 +22,23 @@ function islandora_basic_collection_preprocess_islandora_basic_collection_wrappe $query_params = drupal_get_query_parameters($_GET); global $base_url; if ($display == 'grid') { + $query_params['display'] = 'list'; $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-list'), - 'query' => array('display' => 'list'))); - $grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-grid', 'islandora-view-active')), - 'query' => array('display' => 'grid'))); + 'query' => $query_params)); + unset($query_params['display']); + $query_params['display'] = 'grid'; + $grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-grid', 'active')), + 'query' => $query_params)); $collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results)); } else { + $query_params['display'] = 'list'; + $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-list', 'active')), + 'query' => $query_params)); + unset($query_params['display']); $query_params['display'] = 'grid'; - $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-list', 'islandora-view-active')), - 'query' => array('display' => 'list'))); $grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-grid'), - 'query' => array('display' => 'grid'))); + 'query' => $query_params)); $collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results)); } $variables['list_link'] = $list_link; diff --git a/islandora_basic_image/css/islandora_basic_image.theme.css b/islandora_basic_image/css/islandora_basic_image.theme.css index 93a8db89..f62b37bf 100644 --- a/islandora_basic_image/css/islandora_basic_image.theme.css +++ b/islandora_basic_image/css/islandora_basic_image.theme.css @@ -1,14 +1,22 @@ /* Document : islandora_basic_collection.theme Created on : May 23, 2012, 11:23:56 AM - Description: - Purpose of the stylesheet follows. + Description: The basic image page is a simple flexible layout page + that breaks down to two columns when 2 sidebars are visible */ -.islandora-basic-image-content, -.islandora-basic-image-sidebar { - display: inline; - position: relative; +.islandora-basic-image-content { + background-color: #F2F2F2; + border: 1px solid #ddd; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding: 15px; +} + +.islandora-basic-image-content img { + margin: 0; + display: block; } .islandora-basic-image-metadata { @@ -42,9 +50,6 @@ dl.islandora-basic-image-fields { border-top:0; } -.islandora-basic-image-sidebar, -.islandora-basic-image-sidebar, -body.one-sidebar .islandora-basic-image-sidebar, body.two-sidebars .islandora-basic-image-sidebar { clear: both; width: 100%; @@ -53,15 +58,17 @@ body.two-sidebars .islandora-basic-image-sidebar { @media all and (min-width: 768px) { body.no-sidebars .islandora-basic-image-content { - width: 60%; - padding: 0 20px 0 0; + width: 65%; float: left; /* LTR */ - margin-top: 1em; + } + + body.no-sidebars .islandora-basic-image-sidebar { + padding-left: 20px; } body.no-sidebars .islandora-basic-image-sidebar { float: right; /* LTR */ - width: 40%; + width: 35%; clear: none; } diff --git a/islandora_basic_image/islandora_basic_image.install b/islandora_basic_image/islandora_basic_image.install index 2ab629d9..3f2c2e28 100644 --- a/islandora_basic_image/islandora_basic_image.install +++ b/islandora_basic_image/islandora_basic_image.install @@ -5,6 +5,19 @@ * islandora-basic-image.install */ +function islandora_basic_image_requirements($phase) { + if($phase == 'install') { + module_load_include('inc', 'islandora', 'includes/tuque'); + if(!IslandoraTuque::exists()) { + return array(array( + 'title' => 'Tuque', + 'description' => 'The Islandora Collection solution pack requires the Tuque library.', + 'severity' => REQUIREMENT_ERROR, + )); + } + } +} + /** * Implements hook_install */ diff --git a/islandora_basic_image/theme/islandora-basic-image.tpl.php b/islandora_basic_image/theme/islandora-basic-image.tpl.php index 1cce0bfa..561c8a63 100644 --- a/islandora_basic_image/theme/islandora-basic-image.tpl.php +++ b/islandora_basic_image/theme/islandora-basic-image.tpl.php @@ -26,22 +26,24 @@
-
- - TRUE)); ?> +
+ +
+ + TRUE)); ?> - + +
-
-

+

- +
-

In Collections

+

In Collections

    $value): ?>
  • @@ -50,7 +52,7 @@
- +