|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|