Browse Source

updated template files islandora module now iterates over multiple arrays

pull/108/merge
Paul Pound 13 years ago
parent
commit
2e375f7d21
  1. 1
      islandora-object.tpl.php
  2. 14
      islandora.module
  3. 17
      islandora_basic_image/islandora-basic-image.tpl.php
  4. 2
      islandora_basic_image/islandora_basic_image.module

1
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 ('<h3>datastreams</h3>');

14
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 .'<br />'.$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);
}
}

17
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 <http ://www.gnu.org/licenses/>.
*/
?>
<?php
$object = $variables['islandora_object'];
$image_url = $variables['islandora_image_url'];
print($object->label);
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 '<strong>' . ($key) . '</strong>: ';
print($v) . '<br />';
}
}
}
}
}
print('<img src = "' . $image_url . '"/>');
?>

2
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){

Loading…
Cancel
Save