Browse Source

Merge pull request #385 from christianselig/7.x-print-fix

Fixed links not working if Drupal is in a subfolder (e.g.: multi-site).
pull/382/merge
William Panting 12 years ago
parent
commit
17791b379c
  1. 2
      islandora.module
  2. 8
      js/add_print.js

2
islandora.module

@ -802,7 +802,7 @@ function islandora_view_object(AbstractObject $object) {
drupal_add_js(array( drupal_add_js(array(
'islandora' => array( 'islandora' => array(
'print_link' => '/islandora/object/' . $object->id . '/print')), 'print_link' => 'islandora/object/' . $object->id . '/print')),
array('type' => 'setting')); array('type' => 'setting'));
drupal_add_js($path . '/js/add_print.js'); drupal_add_js($path . '/js/add_print.js');

8
js/add_print.js

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

Loading…
Cancel
Save