Browse Source

Merge branch '7.x' of github.com:Islandora/islandora into 7.x

pull/120/head
rwincewicz 13 years ago
parent
commit
31941f1d31
  1. 1
      islandora.module
  2. 4
      islandora_basic_collection/islandora-basic-collection-grid.tpl.php
  3. 32
      islandora_basic_collection/islandora-basic-collection-wrapper.tpl.php
  4. 4
      islandora_basic_collection/islandora-basic-collection.tpl.php
  5. 2
      islandora_basic_collection/islandora_basic_collection.info
  6. 37
      islandora_basic_collection/islandora_basic_collection.module

1
islandora.module

@ -543,6 +543,7 @@ function islandora_view_object($object_id = NULL) {
drupal_set_message(t('there was an error loading the view for islandora object %s', array('%s' => $object_id)), 'error'); drupal_set_message(t('there was an error loading the view for islandora object %s', array('%s' => $object_id)), 'error');
return ""; return "";
} }
arsort($arr);
drupal_alter('islandora_display',$arr); drupal_alter('islandora_display',$arr);
$output = ""; $output = "";
foreach ($arr as $key => $value) { foreach ($arr as $key => $value) {

4
islandora_basic_collection/islandora-basic-collection-grid.tpl.php

@ -21,17 +21,15 @@
* along with the program. If not, see <http ://www.gnu.org/licenses/>. * along with the program. If not, see <http ://www.gnu.org/licenses/>.
*/ */
?> ?>
<?php drupal_set_title('grid_view'); ?>
<div class="islandora-basic-collection-wrapper"> <div class="islandora-basic-collection-wrapper">
<div class="islandora-basic-collection clearfix"> <div class="islandora-basic-collection clearfix">
<?php print($variables['pager']); ?>
<?php foreach($associated_objects_array as $key => $value): ?> <?php foreach($associated_objects_array as $key => $value): ?>
<dl class="islandora-basic-collection-object <?php print $value['class']; ?>"> <dl class="islandora-basic-collection-object <?php print $value['class']; ?>">
<dt class="islandora-basic-collection-thumb"><?php print $value['thumb_link']; ?></dt> <dt class="islandora-basic-collection-thumb"><?php print $value['thumb_link']; ?></dt>
<dd class="islandora-basic-collection-caption"><?php print $value['title_link']; ?></dd> <dd class="islandora-basic-collection-caption"><?php print $value['title_link']; ?></dd>
</dl> </dl>
<?php endforeach; ?> <?php endforeach; ?>
<?php print($variables['pager']); ?>
</div> </div>
</div> </div>

32
islandora_basic_collection/islandora-basic-collection-wrapper.tpl.php

@ -0,0 +1,32 @@
<?php
/*
* islandora-basic-collection-wrapper.tpl.php
*
*
*
* This file is part of Islandora.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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 drupal_set_title($islandora_object->label); ?>
<div class="islandora-basic-collection-wrapper">
<div class="islandora-basic-collection clearfix">
<?php print($collection_pager); ?>
<?php print ($collection_content); ?>
<?php print($collection_pager); ?>
</div>
</div>

4
islandora_basic_collection/islandora-basic-collection.tpl.php

@ -24,14 +24,12 @@
<?php drupal_set_title($islandora_object->label); ?> <?php drupal_set_title($islandora_object->label); ?>
<div class="islandora-basic-collection-wrapper"> <div class="islandora-basic-collection-wrapper">
<div class="islandora-basic-collection clearfix"> <div class="islandora-basic-collection clearfix">
<?php print($variables['pager']); ?>
<?php foreach($associated_objects_array as $key => $value): ?> <?php foreach($associated_objects_array as $key => $value): ?>
<dl class="islandora-basic-collection-object <?php print $value['class']; ?>"> <dl class="islandora-basic-collection-object <?php print $value['class']; ?>">
<dt class="islandora-basic-collection-thumb"><?php print $value['thumb_link']; ?></dt> <dt class="islandora-basic-collection-thumb"><?php print $value['thumb_link']; ?></dt>
<dd class="islandora-basic-collection-caption"><?php print $value['title_link']; ?></dd> <dd class="islandora-basic-collection-caption"><?php print $value['title_link']; ?></dd>
</dl> </dl>
<?php endforeach; ?> <?php endforeach; ?>
<?php print($variables['pager']); ?>
</div> </div>
</div> </div>

2
islandora_basic_collection/islandora_basic_collection.info

@ -4,4 +4,4 @@ dependencies[] = islandora
package = Islandora package = Islandora
core = 7.x core = 7.x
stylesheets[all][] = css/islandora_basic_collection.base.css stylesheets[all][] = css/islandora_basic_collection.base.css
stylesheets[all][] = css/islandora_basic_collection.theme.css stylesheets[all][] = css/islandora_basic_collection.theme.css

37
islandora_basic_collection/islandora_basic_collection.module

@ -200,6 +200,10 @@ function islandora_basic_collection_theme($existing, $type, $theme, $path) {
'islandora_basic_collection_grid' => array( 'islandora_basic_collection_grid' => array(
'template' => 'islandora-basic-collection-grid', 'template' => 'islandora-basic-collection-grid',
'pattern' => 'islandora_basic_collection_grid__', 'pattern' => 'islandora_basic_collection_grid__',
'variables' => array('islandora_object' => NULL, 'collection_results' => NULL),
),
'islandora_basic_collection_wrapper' => array(
'template' => 'islandora-basic-collection-wrapper',
'variables' => array('islandora_object' => NULL), 'variables' => array('islandora_object' => NULL),
), ),
'islandora_basic_collection_management_form_table' => array( 'islandora_basic_collection_management_form_table' => array(
@ -242,13 +246,7 @@ function islandora_basic_collection_islandora_view_object($object, $user) {
$models = $object->models; $models = $object->models;
foreach ($object->models as $model) { foreach ($object->models as $model) {
if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) { if (isset($cmodel_list[$model][ISLANDORA_VIEW_HOOK]) && $cmodel_list[$model][ISLANDORA_VIEW_HOOK] == TRUE) {
$display = (empty($_GET['display'])) ? 'list' : $_GET['display']; $output = theme('islandora_basic_collection_wrapper', array('islandora_object' => $object,));
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 array('Collection View' => $output);
} }
} }
@ -264,6 +262,24 @@ function islandora_basic_collection_preprocess_islandora_basic_collection_grid(&
islandora_basic_collection_preprocess_islandora_basic_collection($variables); islandora_basic_collection_preprocess_islandora_basic_collection($variables);
} }
function islandora_basic_collection_preprocess_islandora_basic_collection_wrapper(&$variables) {
$page_number = (empty($_GET['page'])) ? 0 : $_GET['page'];
$page_size = (empty($_GET['pagesize'])) ? variable_get('islandora_basic_collection_page_size', '10') : $_GET['pagesize'];
$islandora_object = $variables['islandora_object'];
$results = islandora_basic_collection_get_objects($islandora_object, $page_number, $page_size);
$total_count = count($results);
pager_default_initialize($total_count, $page_size);
$variables['collection_pager'] = theme('pager', array('quantity' => $total_count));
$display = (empty($_GET['display'])) ? 'list' : $_GET['display'];
if ($display == 'grid') {
$collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results));
}
else {
$collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results));
}
$variables['collection_content'] = $collection_content;
}
/** /**
* *
* @global type $base_url * @global type $base_url
@ -285,12 +301,8 @@ function islandora_basic_collection_preprocess_islandora_basic_collection(&$vari
} }
$page_number = (empty($_GET['page'])) ? 0 : $_GET['page']; $page_number = (empty($_GET['page'])) ? 0 : $_GET['page'];
$page_size = (empty($_GET['pagesize'])) ? variable_get('islandora_basic_collection_page_size', '10') : $_GET['pagesize']; $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); $results = $variables['collection_results'];//islandora_basic_collection_get_objects($islandora_object, $page_number, $page_size);
$total_count = count($results); $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_dublin_core'] = $dc_object;
$variables['islandora_object_label'] = $islandora_object->label; $variables['islandora_object_label'] = $islandora_object->label;
$variables['theme_hook_suggestions'][] = 'islandora_basic_collection__' . str_replace(':', '_', $islandora_object->id); $variables['theme_hook_suggestions'][] = 'islandora_basic_collection__' . str_replace(':', '_', $islandora_object->id);
@ -336,6 +348,7 @@ function islandora_basic_collection_preprocess_islandora_basic_collection(&$vari
$thumbnail_img = '<img src="' . $base_path . $object_url . '/datastream/TN/view"' . '/>'; $thumbnail_img = '<img src="' . $base_path . $object_url . '/datastream/TN/view"' . '/>';
} }
else { else {
//TODO: change this default image url
$thumbnail_img = '<img src="http://codesprint-centos.islandora.ca/islandora/object/islandora%3A52/datastream/TN"' . '/>'; $thumbnail_img = '<img src="http://codesprint-centos.islandora.ca/islandora/object/islandora%3A52/datastream/TN"' . '/>';
} }
$associated_objects_array[$pid]['thumbnail'] = $thumbnail_img; $associated_objects_array[$pid]['thumbnail'] = $thumbnail_img;

Loading…
Cancel
Save