Browse Source

Fixed Menu path conflicts with printing dc_data and clipping large image and newspaper.

pull/394/head
MorganDawe 11 years ago
parent
commit
76e09b2471
  1. 42
      islandora.module
  2. 1
      js/add_print.js

42
islandora.module

@ -119,13 +119,22 @@ function islandora_menu() {
'access callback' => 'islandora_object_access_callback',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 2),
);
$items['islandora/object/%islandora_object/print'] = array(
$items['islandora/object/%islandora_object/print_object'] = array(
'page callback' => 'islandora_printer_object',
'page arguments' => array(2),
'type' => MENU_NORMAL_ITEM,
'access callback' => 'islandora_object_access_callback',
'access callback' => 'islandora_object_access',
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 2),
);
$items['islandora/object/%islandora_object/print'] = array(
'title' => 'Print Object',
'page callback' => 'islandora_print_object',
'page arguments' => array(2),
'type' => MENU_CALLBACK,
'access callback' => 'islandora_object_access',
'access arguments' => array(FEDORA_VIEW_OBJECTS, 2),
'load arguments' => array(2),
);
$items['islandora/object/%islandora_object/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
@ -151,13 +160,11 @@ function islandora_menu() {
ISLANDORA_INGEST,
), 2),
);
$items['islandora/object/%islandora_object/manage/overview'] = array(
'title' => 'Overview',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -20,
);
$items['islandora/object/%islandora_object/manage/datastreams'] = array(
'title' => 'Datastreams',
'type' => MENU_LOCAL_TASK,
@ -172,7 +179,6 @@ function islandora_menu() {
), 2),
'weight' => -10,
);
$items['islandora/object/%islandora_object/manage/properties'] = array(
'title' => 'Properties',
'page callback' => 'drupal_get_form',
@ -297,15 +303,6 @@ function islandora_menu() {
'access arguments' => array(ISLANDORA_VIEW_DATASTREAM_HISTORY, 4),
'load arguments' => array(2),
);
$items['islandora/object/%islandora_object/printer'] = array(
'title' => 'Print Object',
'page callback' => 'islandora_print_object',
'page arguments' => array(2),
'type' => MENU_CALLBACK,
'access callback' => 'islandora_object_access',
'access arguments' => array(FEDORA_VIEW_OBJECTS, 2),
'load arguments' => array(2),
);
$items['islandora/object/%islandora_object/download_clip'] = array(
'page callback' => 'islandora_download_clip',
'page arguments' => array(2),
@ -350,12 +347,6 @@ function islandora_theme() {
'variables' => array('islandora_object' => NULL),
),
// Default edit page.
'islandora_default_print' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-object-print',
'variables' => array('islandora_object' => NULL),
),
// Default edit page.
'islandora_default_edit' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-object-edit',
@ -366,8 +357,13 @@ function islandora_theme() {
'file' => 'includes/solution_packs.inc',
'render element' => 'form',
),
// Print object view.
// Print used by the clipper.
'islandora_object_print' => array(
'file' => 'theme/theme.inc',
'variables' => array('object' => NULL, 'content' => array()),
),
// Print object view, prints islandora objects.
'islandora_object_print_object' => array(
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-object-print',
'variables' => array(
@ -866,7 +862,7 @@ function islandora_view_object(AbstractObject $object) {
drupal_add_js(array(
'islandora' => array(
'print_link' => 'islandora/object/' . $object->id . '/print')),
'print_link' => 'islandora/object/' . $object->id . '/print_object')),
array('type' => 'setting'));
drupal_add_js($path . '/js/add_print.js');
@ -999,7 +995,7 @@ function islandora_default_islandora_printer_object($object, $alter) {
}
$variables = isset($dc_object) ? $dc_object->asArray() : array();
$output = theme('islandora_object_print', array(
$output = theme('islandora_object_print_object', array(
'object' => $object,
'dc_array' => $variables,
'islandora_content' => $alter));

1
js/add_print.js

@ -10,6 +10,7 @@
$(document).ready(function() {
$('.tabs .primary').append('<img id="print_btn" title="Print" src="' + Drupal.settings.basePath + Drupal.settings.islandora.print_img + '"></img>');
$('#print_btn').css("cursor","pointer");
console.log(Drupal.settings.basePath + Drupal.settings.islandora.print_link);
$('#print_btn').click(function() {
window.location=Drupal.settings.basePath + Drupal.settings.islandora.print_link;
});

Loading…
Cancel
Save