|
|
@ -199,6 +199,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( |
|
|
@ -241,13 +245,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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -263,6 +261,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 |
|
|
@ -284,12 +300,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); |
|
|
@ -335,6 +347,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; |
|
|
|