Browse Source

added a new link variable and moved template file to theme directory

pull/125/merge
Paul Pound 13 years ago
parent
commit
e3f4ea3659
  1. 3
      islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php
  2. 21
      islandora_basic_collection/theme/islandora_basic_collection.theme.inc
  3. 2
      islandora_basic_image/islandora_basic_image.module
  4. 0
      islandora_basic_image/theme/islandora-basic-image.tpl.php

3
islandora_basic_collection/theme/islandora-basic-collection-wrapper.tpl.php

@ -25,7 +25,8 @@
<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 ($switch_view_link) ?> <?php print ($grid_link); ?>
<?php print ($list_link); ?>
<?php print($collection_pager); ?> <?php print($collection_pager); ?>
<?php print ($collection_content); ?> <?php print ($collection_content); ?>
<?php print($collection_pager); ?> <?php print($collection_pager); ?>

21
islandora_basic_collection/theme/islandora_basic_collection.theme.inc

@ -20,23 +20,24 @@ function islandora_basic_collection_preprocess_islandora_basic_collection_wrappe
$display = (empty($_GET['display'])) ? variable_get('islandora_basic_collection_default_view', 'grid') : $_GET['display']; $display = (empty($_GET['display'])) ? variable_get('islandora_basic_collection_default_view', 'grid') : $_GET['display'];
$link_text = (empty($_GET['display'])) ? 'grid' : $_GET['display']; $link_text = (empty($_GET['display'])) ? 'grid' : $_GET['display'];
$query_params = drupal_get_query_parameters($_GET); $query_params = drupal_get_query_parameters($_GET);
global $base_url;
if ($display == 'grid') { if ($display == 'grid') {
$query_params['display'] = 'list'; $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-list'),
$link_text = 'List View'; 'query' => array('display' => 'list')));
$link_class = 'islandora-view-default'; $grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-grid', 'islandora-view-active')),
'query' => array('display' => 'grid')));
$collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results)); $collection_content = theme('islandora_basic_collection_grid', array('islandora_object' => $islandora_object, 'collection_results' => $results));
} }
else { else {
$query_params['display'] = 'grid'; $query_params['display'] = 'grid';
$link_text = 'Grid View'; $list_link = l('List View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => array('islandora-view-list', 'islandora-view-active')),
$link_class = 'islandora-view-grid'; 'query' => array('display' => 'list')));
$grid_link = l('Grid View', $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => 'islandora-view-grid'),
'query' => array('display' => 'grid')));
$collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results)); $collection_content = theme('islandora_basic_collection', array('islandora_object' => $islandora_object, 'collection_results' => $results));
} }
global $base_url; $variables['list_link'] = $list_link;
$link = l($link_text, $base_url . '/islandora/object/' . $islandora_object->id, array('attributes' => array('class' => $link_class), $variables['grid_link'] = $grid_link;
'query' => $query_params));
$variables['switch_view_link'] = $link;
$variables['collection_content'] = $collection_content; $variables['collection_content'] = $collection_content;
} }

2
islandora_basic_image/islandora_basic_image.module

@ -124,7 +124,7 @@ function islandora_basic_image_theme($existing, $type, $theme, $path) {
'variables' => array('islandora_objects' => NULL), 'variables' => array('islandora_objects' => NULL),
), ),
'islandora_basic_image' => array( 'islandora_basic_image' => array(
'template' => 'islandora-basic-image', 'template' => 'theme/islandora-basic-image',
'pattern' => 'islandora_basic_image__', //we can add pids to the end of this pattern in our preprocess function 'pattern' => 'islandora_basic_image__', //we can add pids to the end of this pattern in our preprocess function
// and templates will be able to have have a pid appended to the template name to overide a template on a per object basis // and templates will be able to have have a pid appended to the template name to overide a template on a per object basis
//an example template would be named islandora-basic-image--islandora-27.tpl.phps //an example template would be named islandora-basic-image--islandora-27.tpl.phps

0
islandora_basic_image/islandora-basic-image.tpl.php → islandora_basic_image/theme/islandora-basic-image.tpl.php

Loading…
Cancel
Save