arteleku_skin/templates/islandora-basic-collection-grid.tpl.php

239 lines
10 KiB
PHP
Raw Normal View History

2017-12-15 01:06:00 +01:00
<?php
/**
* @file
* Render a bunch of objects in a list or grid view.
*/
$parent_collections = islandora_get_parents_from_rels_ext($islandora_object);
global $language;
$lan=$language->language;
?>
<div class="islandora islandora-arteleku-collection">
<div class="islandora-arteleku-collection-grid clearfix">
<div class="panel-pane pane-title-line panel-no-margin">
<div class="pane-content">
<div class="islandora islandora-basic-collection">
<div class="islandora-basic-collection clearfix">
<?php $rows = array(); ?>
<?php //dpm($variables); ?>
<?php foreach($associated_objects_array as $key => $value): ?>
<?php //dpm($associated_objects_array_mods[$key]); ?>
<?php //dpm($associated_objects_array[$key]);
//dpm($parent_collections);
?>
<?php if (!isset($associated_objects_array_mods[$key]["pid"])): ?>
<dd class="islandora-basic-collection-caption"><h1><?php //print $value['title_link']; ?></h1></dd>
<?php $rows[] = array(array('data'=>"<h3>{$value['title_link']}</h3>",'class'=> array("title-cell"))); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php
$table_element = array(
'#theme' => 'table',
'#header' => array('title' => t('Title')),
'#rows' => $rows,
'#empty' =>t('Your table is empty'),
'#sticky' => false,
'#attributes' => array('id' => 'islandora-collection-table')
);
if (count($rows)>0) :
echo "<div class=\"pane-title\"><h3>".t('Collections')."</h3></div>";
print drupal_render($table_element);
endif;
?>
</div>
</div>
</div>
</div>
<div class="pane-title page-title">
<h3>
<?php //dpm($variables['islandora_dublin_core']->dc);
if (isset($variables['islandora_dublin_core']->dc)) : $dc_array = $variables['islandora_dublin_core']->dc;
endif;
?>
<?php if (isset($parent_collections[0])): ?>
<?php print l($parent_collections[0]->label, "islandora/object/{$parent_collections[0]->id}"); ?>
<?php echo "/"; ?>
<?php //if(isset($dc_array['dc:title'][0])) : echo $dc_array['dc:title'][0]; endif;?>
<?php if(isset($mods_array['titleInfo'])) : echo $mods_array['titleInfo']; endif;?>
<?php endif; ?>
</br>
<div class = "pane-content listado-lineas metadata-record clearfix">
<?php $row_field = 0; ?>
<?php //dpm($mods_array) ?>
</br>
<h2><?php if(isset($mods_array['titleInfo'])) : echo $mods_array['titleInfo']; endif;?></h2>
<h3><?php if(isset($mods_array['originInfo'])) : echo $mods_array['originInfo']; endif;?></h3>
</br>
<div class="pane-subcontent-left" style="float:left;width:100%;">
<!--div class="pane-subcontent-left" style="float:left;width:35%;"-->
<?php $row_field = 0; ?>
<div class="panel-pane" style="display:none;">
<h3><?php if(isset($mods_array['name'])) : echo $mods_array['name']; endif;?></h3>
</div>
<h3><?php //if(isset($mods_array['originInfo'])) : echo $mods_array['originInfo']; endif;?></h3>
<?php if (isset($mods_array)): ?>
<div class="panel-pane">
<fieldset class="collapsible islandora-pdf-metadata pane-title">
<legend style="display:none;"><h3><span class="fieldset-legend"><?php print t('Full metadata record'); ?></span></h3></legend>
<div class="fieldset-wrapper">
<div class = "pane-content listado-lineas metadata-record">
<dl class="islandora-inline-metadata islandora-pdf-fields">
<?php foreach ($mods_array as $key => $value): ?>
<dt class="<?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print $key; ?>
</dt>
<dd class="<?php print $row_field == 0 ? ' first' : ''; ?>">
<?php print str_replace('- http://artxibo.arteleku.net/autoridades/ - autoridades - http://artxibo.arteleku.net/ - arteleku','',$value); ?>
</dd>
<?php $row_field++; ?>
<?php endforeach; ?>
</dl>
</div>
</div>
</fieldset></div>
<?php endif; ?>
</div>
<div class="pane-subcontent-right" style="float:right;width:65%;">
<div class="panel-pane" style="display:none;">
<h3 style="text-align:justify;"><?php // if(isset($dc_array['dc:description'][0])) : echo $dc_array['dc:description'][0]; endif;?></h3>
<h3><?php if(isset($mods_array['abstract'])) : echo $mods_array['abstract']; endif;?></h3>
<h3><?php if(isset($mods_array['note'])) : echo $mods_array['note']; endif;?></h3>
<h3><?php if(isset($mods_array['accessCondition'])) : echo $mods_array['accessCondition']; endif;?></h3>
</div>
</div>
<?php if (isset($parent_collections)): ?>
<!--h3>Pertenece a:</h3-->
<?php /*echo "<ul>"; ?>
<?php foreach ($parent_collections as $collection): ?>
<?php echo "<li style='margin-left:50px;'>"; ?>
<?php print l($collection->label, "islandora/object/{$collection->id}"); ?>
<?php echo "</li>"; ?>
<?php //echo " / "; ?>
<?php //if(isset($dc_array['dc:title'][0])) : echo $dc_array['dc:title'][0]; endif;?>
<?php endforeach; ?>
<?php echo "</ul>";*/ ?>
<?php endif; ?>
</div>
</br>
<?php //print $mods_array['titleInfo']; ?>
</h3>
</div>
<div class="panel-pane pane-title-line panel-no-margin">
<div class="pane-title"><h3><?php //print $islandora_object_label?><?php echo t('Content');?></h3></div>
<div class="pane-content">
<?php $rows = array() ?>
<?php foreach($associated_objects_array_mods as $key => $value):
//dpm($associated_objects_array_mods[$key]["mods_array"]["typeOfResource"]);
//dpm($associated_objects_array_mods[$key]["mods_array"]);
//dpm($associated_objects_array_mods[$key]["pid"]);
$pid = $associated_objects_array_mods[$key]["pid"];
$object = islandora_object_load($pid);
//dpm($object->relationships->get());
//dpm($object->relationships->get('info:fedora/fedora-system:def/model#', 'hasModel'));
//dpm($object["dsid"]);
if (!$object) {
drupal_set_message("Fedora Object isn't in the repo!");
}
//dpm($object['models']);
isset($associated_objects_array_mods[$key]["mods_array"]["typeOfResource"])? $type=$associated_objects_array_mods[$key]["mods_array"]["typeOfResource"] : $type='Unknown';
if (isset($associated_objects_array_mods[$key]["mods_array"]["part"])) :
$part=$associated_objects_array_mods[$key]["mods_array"]["part"];
$part = explode(' ',trim($part));
//$num = 'n.'.$part[0];
$num = $part[0];
else:
$num='';
endif;
/* Path */
isset($associated_objects_array_mods[$key]["path"]) ? $url = "/".$associated_objects_array_mods[$key]["path"] : $url = "/";
/* Abstract */
isset($value['mods_array']['abstract'])? $ab = views_trim_text(array('max_length'=> 150, 'word_boundary'=>true, 'ellipsis'=>true),$value['mods_array']['abstract']) : $ab ="";
/* Name part */
if (isset($value['mods_array']['name'])):
//dpm(explode(',',$value['mods_array']['name']));
//if (count(explode(',',$value['mods_array']['name']))>1) :
// $name=t('Various');
//else :
$name = $value['mods_array']['name'];
//endif;
else : $name = t('Anonimous');
endif;
/* Origin */
isset($value['mods_array']['originInfo'])? $date = $value['mods_array']['originInfo'] : $date = t('No date');
if (!isset($value['title_link'])) :
$value['title_link']="<a href=\"$url\">Sin titulo</a>";
endif;
if (!isset($associated_objects_array_mods[$key]["mods_array"])):
$value['title_link']="<a href=\"$url\">Objeto sin MODS (eliminar!)</a>";
endif;
// http://artxibo.arteleku.net/es/islandora/object/arteleku%3A3886/datastream/OBJ/download
$link_download = "";
if ($type!="mixed material"):
$link_download='<a href="'.$url.'/datastream/OBJ/download"><div class="artxibo-icon download"></div></a>';
endif;
$rows[] = array(
'<div class="artxibo-icon '.str_replace(' ','-',$type).'" title="'.$type.'"></div>',
array('data' => "<h3>{$value['title_link']}</h3>", 'class' => array("title-cell")),
//$name,
$num,
$ab,
$date,
$link_download
);
//$nums[] = array ($num);
endforeach;
/* cargamos el MODS para descarga */
//http://artxibo.arteleku.net/es/islandora/object/arteleku%3A3893/datastream/MODS/download
/*$rows[] = array(
"<div class=\"artxibo-icon datastream\" title=\"datastream\"></div>",
array('data' => "<h3>MODS</h3>", 'class' => array("title-cell")),
"",
"",
"",
"<a href='/".current_path()."/datastream/MODS/download'><div class=\"artxibo-icon download\"></div></a>"
);*/
?>
<?php
$table_element = array(
'#theme' => 'table',
//'#header' => $header,
'#header' => array('type'=>t(''), 'title' => t('Title'), 'part' => t(''), 'abstract' => t('Abstract'), 'date' => t('Origin'), 'download' => t('')),
'#rows' => $rows,
'#empty' =>t('Your table is empty'),
'#sticky' => false,
'#attributes' => array('id' => 'islandora-collection-table')
);
print drupal_render($table_element);
?>
<?php
$block = module_invoke('islandora_related', 'block_view', 'related_list');
print $block['content'];
?>
</div>
</div>
</div>
</div>