');
-foreach ($islandora_datastreams as $dsid => $ds) {
- print (l($ds['label'],$ds['view_url']));
- print (' ' . l('download', $ds['download_url']));
- print (' ' . l('delete', $ds['delete_url']));
- print (' ');
+//print($islandora_object->label . ' ' . $islandora_object->id);
-}
-print (drupal_render($variables['add_datastream_form']));
-print (l(t('Edit Metadata'),$variables['islandora_editmetadata_url']));
+print ($variables['datastream_table']);
?>
diff --git a/islandora-object.tpl.php b/islandora-object.tpl.php
index 06b11cab..4a50d07f 100644
--- a/islandora-object.tpl.php
+++ b/islandora-object.tpl.php
@@ -27,15 +27,46 @@
* this is a template for objects that do not have a module to registered to build their display.
*
* islandora_object is a fedora tuque Object
- * $object->label
- * $object->id
+ * $object->label - The label for this object.
+ * $object->id - The identifier of the object.
+ * $object->state - The state of this object.
+ * $object->createdDate - The date the object was ingested.
+ * $object->lastModifiedDate - The date teh object was last mofified.
+ *
* to get the contents of a datastream
- * $object['dsid']->content
+ * $object['dsid']->content
+ *
+ * to test if a datastream exists isset($object['dsid'])
+ *
+ * to iterate over datastreams:
+ * foreach($object as $ds) {
+ * $ds->label, etc
+ * }
+ *
+ * each $ds in the above loop has the following properties:
+ * $ds->label - The label for this datastream.
+ * $ds->id - The identifier of the datastream.
+ * $ds->controlGroup - The control group of the datastream. This
+ * property is read-only. This will return one of: "X", "M", "R", or "E".
+ * $ds->versionable - This defines if the datastream will be versioned
+ * or not. This is boolean.
+ * $ds->state - The state of the datastream. This will be one
+ * of: "A", "I", "D".
+ * $ds->mimetype - The mimetype of the datastrem.
+ * $ds->format - The format of the datastream
+ * $ds->size - The size of the datastream
+ * $ds->checksum - The checksum of the datastream
+ * $ds->checksumType - The type of checksum for the datastream.
+ * $ds->createdDate->format("Y-m-d") - The created date with an option to use a format of your choice
+ * $ds->content - The content of the datastream
+ * $ds->url - The URL. This is only valid for R and E datastreams.
*
* $dublin_core is a Dublin_Core object
* which is an array of elements, such as dc.title
* and each element has an array of values. dc.title can have none, one or many titles
* this is the case for all dc elements.
+ *
+ *
*
* we can get a list of datastreams by doing
* foreach ($object as $ds){
@@ -44,30 +75,7 @@
*
*/
-//dsm($object);
drupal_set_title($islandora_object->label);
-// $dublin_core = $variables['islandora_dublin_core'];
-// print($islandora_object->label . ' ' . $islandora_object->id);
-// print ('
\ No newline at end of file
diff --git a/islandora_basic_collection/islandora-basic-collection.tpl.php b/islandora_basic_collection/islandora-basic-collection.tpl.php
index da5de757..92c9ec5f 100644
--- a/islandora_basic_collection/islandora-basic-collection.tpl.php
+++ b/islandora_basic_collection/islandora-basic-collection.tpl.php
@@ -25,11 +25,13 @@
+
$value): ?>
+
\ No newline at end of file
diff --git a/islandora_basic_collection/islandora_basic_collection.module b/islandora_basic_collection/islandora_basic_collection.module
index ecebc374..b8c14825 100644
--- a/islandora_basic_collection/islandora_basic_collection.module
+++ b/islandora_basic_collection/islandora_basic_collection.module
@@ -176,6 +176,11 @@ function islandora_basic_collection_theme($existing, $type, $theme, $path) {
//an example template would be named islandora-basic-image--islandora-27.tpl.phps
'variables' => array('islandora_object' => NULL),
),
+ 'islandora_basic_collection_grid' => array(
+ 'template' => 'islandora-basic-collection-grid',
+ 'pattern' => 'islandora_basic_collection_grid__',
+ 'variables' => array('islandora_object' => NULL),
+ ),
'islandora_basic_collection_management_form_table' => array(
'arguments' => array('element' => NULL),
'file' => 'includes/CollectionManagerTable.inc',
@@ -210,21 +215,35 @@ function islandora_basic_collection_islandora_get_types() {
* @return string
* themed html
*/
-function islandora_basic_collection_islandora_view_object($object, $user, $page_number, $page_size) {
+function islandora_basic_collection_islandora_view_object($object, $user) {
//global $user;
$cmodel_list = islandora_basic_collection_islandora_get_types();
$models = $object->models;
foreach ($object->models as $model) {
if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) {
- $output = theme('islandora_basic_collection', array('islandora_object' => $object));
- return array('' => $output);
+ $display = (empty($_GET['display'])) ? 'list' : $_GET['display'];
+ if($display == 'grid'){
+ $output = theme('islandora_basic_collection_grid', array('islandora_object' => $object));
+ } else {
+ $output = theme('islandora_basic_collection', array('islandora_object' => $object));
+ }
+ return array('Collection View' => $output);
}
}
return NULL;
}
/**
- *
+ * list view preprocess
+ * currently just calls normal view preprocess as variables are the same
+ * @param type $variables
+ */
+function islandora_basic_collection_preprocess_islandora_basic_collection_grid(&$variables){
+ islandora_basic_collection_preprocess_islandora_basic_collection($variables);
+}
+
+/**
+ *
* @global type $base_url
* @param array $variables
* an array of variables that will be passed to the theme function
@@ -242,7 +261,14 @@ function islandora_basic_collection_preprocess_islandora_basic_collection(&$vari
} catch (Exception $e) {
drupal_set_message(t('Error retrieving object %s %t', array('%s' => $islandora_object->id, '%t' => $e->getMessage())), 'error');
}
- $variables['islandora_associated_objects'] = islandora_basic_collection_get_objects($islandora_object);
+ $page_number = (empty($_GET['page'])) ? 0 : $_GET['page'];
+ $page_size = (empty($_GET['pagesize'])) ? variable_get('islandora_basic_collection_page_size', '10') : $_GET['pagesize'];
+ $results = islandora_basic_collection_get_objects($islandora_object, $page_number, $page_size);
+ $total_count = count($results);
+ pager_default_initialize($total_count, $page_size);
+
+ $pager = theme('pager', array('quantity' => $total_count));
+ $variables['pager'] = $pager;
$variables['islandora_dublin_core'] = $dc_object;
$variables['islandora_object_label'] = $islandora_object->label;
$variables['theme_hook_suggestions'][] = 'islandora_basic_collection__' . str_replace(':', '_', $islandora_object->id);
@@ -260,8 +286,11 @@ function islandora_basic_collection_preprocess_islandora_basic_collection(&$vari
}
$associated_objects_array = array();
- foreach ($variables['islandora_associated_objects'] as $key => $value) {
- $pid = $variables['islandora_associated_objects'][$key]['object']['value'];
+ $start = $page_size * ($page_number);
+ $end = min($start + $page_size, $total_count);
+
+ for ($i = $start; $i < $end; $i++) {
+ $pid = $results[$i]['object']['value'];
$fc_object = islandora_basic_collection_get_object($pid);
if (!isset($fc_object)) {
continue; //null object so don't show in collection view;
@@ -276,7 +305,7 @@ function islandora_basic_collection_preprocess_islandora_basic_collection(&$vari
}
$object_url = 'islandora/object/' . $pid;
$thumbnail_img = '';
- $title = $variables['islandora_associated_objects'][$key]['title']['value'];
+ $title = $results[$i]['title']['value'];
$associated_objects_array[$pid]['pid'] = $pid;
$associated_objects_array[$pid]['path'] = $object_url;
$associated_objects_array[$pid]['title'] = $title;
@@ -307,7 +336,7 @@ function islandora_basic_collection_get_object($object_id) {
return $fedora_object;
}
-function islandora_basic_collection_get_objects($object) {
+function islandora_basic_collection_get_objects($object, $page_number = 1, $page_size = 5) {
$query = 'select $object $title $content from <#ri>
where ($object $title
and $object $content
@@ -316,8 +345,6 @@ function islandora_basic_collection_get_objects($object) {
and $object )
minus $content
order by $title';
- $page_number = (empty($_GET['page'])) ? '1' : $_GET['page'];
- $page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize'];
module_load_include('inc', 'islandora', 'RestConnection');
$query_array = array('query' => $query, 'type' => 'itql', 'pid' => $object->id, 'page_size' => $page_size, 'page_number' => $page_number);
drupal_alter('islandora_basic_collection_query', $query_array);
diff --git a/islandora_basic_image/admin/islandora_basic_image.admin.inc b/islandora_basic_image/admin/islandora_basic_image.admin.inc
index d31dbef0..2e6652f3 100644
--- a/islandora_basic_image/admin/islandora_basic_image.admin.inc
+++ b/islandora_basic_image/admin/islandora_basic_image.admin.inc
@@ -5,7 +5,7 @@ function islandora_basic_image_admin() {
$form['islandora_basic_image_use_for_default_tab'] = array(
'#type' => 'checkbox',
'#title' => t('Provide the view for the default tab'),
- '#default_value' => variable_get('islandora_basic_image_use_for_default_tab', 'TRUE'),
+ '#default_value' => variable_get('islandora_basic_image_use_for_default_tab', TRUE),
'#description' => t('Should this module provide the view for the default view tab. If you are seeing unexpected content
on a view tab you may have multiple modules configured to provide content for the default tab.'),
'#weight' => -10
diff --git a/islandora_basic_image/css/islandora_basic_image.theme.css b/islandora_basic_image/css/islandora_basic_image.theme.css
index e7b31c4d..93a8db89 100644
--- a/islandora_basic_image/css/islandora_basic_image.theme.css
+++ b/islandora_basic_image/css/islandora_basic_image.theme.css
@@ -56,6 +56,7 @@ body.two-sidebars .islandora-basic-image-sidebar {
width: 60%;
padding: 0 20px 0 0;
float: left; /* LTR */
+ margin-top: 1em;
}
body.no-sidebars .islandora-basic-image-sidebar {
diff --git a/islandora_basic_image/islandora-basic-image.tpl.php b/islandora_basic_image/islandora-basic-image.tpl.php
index a1a61da5..44228a7c 100644
--- a/islandora_basic_image/islandora-basic-image.tpl.php
+++ b/islandora_basic_image/islandora-basic-image.tpl.php
@@ -31,6 +31,14 @@
+