From 2e375f7d21e130c58ce02f5d9294c71946c27aac Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Tue, 22 May 2012 14:39:27 -0300 Subject: [PATCH] updated template files islandora module now iterates over multiple arrays --- islandora-object.tpl.php | 1 + islandora.module | 14 ++++++++----- .../islandora-basic-image.tpl.php | 21 ++++++++++++++----- .../islandora_basic_image.module | 2 +- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/islandora-object.tpl.php b/islandora-object.tpl.php index 1f9d4f8b..44340afa 100644 --- a/islandora-object.tpl.php +++ b/islandora-object.tpl.php @@ -45,6 +45,7 @@ */ //dsm($object); +drupal_set_title($islandora_object->label); $dublin_core = $variables['islandora_dublin_core']; print($islandora_object->label . ' ' . $islandora_object->id); print ('

datastreams

'); diff --git a/islandora.module b/islandora.module index 042aa96c..6024653a 100644 --- a/islandora.module +++ b/islandora.module @@ -264,9 +264,6 @@ function islandora_view_object($object_id) { $page_number = (empty($_GET['page'])) ? '1' : $_GET['page']; $page_size = (empty($_GET['pagesize'])) ? '10' : $_GET['pagesize']; module_load_include('inc', 'islandora', 'RestConnection'); - //$user = new stdClass(); - //$user->name = 'fedoraAdmin'; - //$user->password = 'islandora'; global $user; try { $restConnection = new RestConnection($user); @@ -283,7 +280,12 @@ function islandora_view_object($object_id) { return ""; } //module_invoke_all(islandora_display($arr)), - return $arr[0]; //just an example as we could have more then one array element + $output = ""; + foreach($arr as $key => $value){ + $output .= $key .'
'.$value; //ir we have multiple modules handle one cmodel we need to iterate over multiple + } + //we could do another module invoke all here to build the edit tab with a default implemented in this module? + return $output; //just an example as we could have more then one array element } /** @@ -296,8 +298,10 @@ function islandora_islandora_view_object($object){ $supported_models = islandora_get_types(); $object_models = $object->models; $combined_list = array_intersect($supported_models, $object->models); + $output = ""; if (empty($combined_list)) { - return theme('islandora_default', array('islandora_object' => $object)); + $output = theme('islandora_default', array('islandora_object' => $object)); + return array ('Default Output' => $output); } } diff --git a/islandora_basic_image/islandora-basic-image.tpl.php b/islandora_basic_image/islandora-basic-image.tpl.php index ee381cd5..03576390 100644 --- a/islandora_basic_image/islandora-basic-image.tpl.php +++ b/islandora_basic_image/islandora-basic-image.tpl.php @@ -20,13 +20,24 @@ * You should have received a copy of the GNU General Public License * along with the program. If not, see . */ - - ?> -label); - print(''); + drupal_set_title($object->label); + foreach ($variables['islandora_dublin_core'] as $element) { + if (!empty($element)) { + foreach ($element as $key => $value) { + foreach ($value as $v) { + if (!empty($v)) { + print '' . ($key) . ': '; + print($v) . '
'; + } + } + } + } + } + print(''); ?> diff --git a/islandora_basic_image/islandora_basic_image.module b/islandora_basic_image/islandora_basic_image.module index bc15c5d2..92fe533a 100644 --- a/islandora_basic_image/islandora_basic_image.module +++ b/islandora_basic_image/islandora_basic_image.module @@ -120,7 +120,7 @@ function islandora_basic_image_islandora_view_object($object, $user, $page_numbe } $output = theme('islandora_basic_image', array('islandora_object' => $object)); - return $output; + return array('Basic Image Output' =>$output); } function islandora_preprocess_islandora_basic_image(&$variables){