|
|
|
@ -1564,9 +1564,12 @@ function islandora_entity_property_info() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_download_clip(AbstractObject $object) { |
|
|
|
function islandora_download_clip(AbstractObject $object) { |
|
|
|
if (isset($_GET['clip'])) { |
|
|
|
if (isset($_GET['clip'])) { |
|
|
|
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; |
|
|
|
$url = $_GET['clip']; |
|
|
|
$http_protocol = $is_https ? 'https' : 'http'; |
|
|
|
if (!preg_match('/^https?:\/\//', $url)) { |
|
|
|
$url = $http_protocol . '://' . $_SERVER['HTTP_HOST'] . $_GET['clip']; |
|
|
|
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; |
|
|
|
|
|
|
|
$http_protocol = $is_https ? 'https' : 'http'; |
|
|
|
|
|
|
|
$url = $http_protocol . '://' . $_SERVER['HTTP_HOST'] . $url; |
|
|
|
|
|
|
|
} |
|
|
|
$filename = $object->label; |
|
|
|
$filename = $object->label; |
|
|
|
header("Content-Disposition: attachment; filename=\"{$filename}.jpg\""); |
|
|
|
header("Content-Disposition: attachment; filename=\"{$filename}.jpg\""); |
|
|
|
header("Content-type: image/jpeg"); |
|
|
|
header("Content-type: image/jpeg"); |
|
|
|
@ -1590,6 +1593,7 @@ function islandora_download_clip(AbstractObject $object) { |
|
|
|
function islandora_file_mimetype_mapping_alter(&$mapping) { |
|
|
|
function islandora_file_mimetype_mapping_alter(&$mapping) { |
|
|
|
$mime_detect = new MimeDetect(); |
|
|
|
$mime_detect = new MimeDetect(); |
|
|
|
$types = $mime_detect->getMimeTypes(); |
|
|
|
$types = $mime_detect->getMimeTypes(); |
|
|
|
|
|
|
|
|
|
|
|
$diff = array_diff_key($types, $mapping['extensions']); |
|
|
|
$diff = array_diff_key($types, $mapping['extensions']); |
|
|
|
foreach ($diff as $ext => $mime) { |
|
|
|
foreach ($diff as $ext => $mime) { |
|
|
|
$mapping['mimetypes'][] = $mime; |
|
|
|
$mapping['mimetypes'][] = $mime; |
|
|
|
@ -1719,6 +1723,10 @@ function islandora_islandora_basic_collection_get_query_filters() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_islandora_object_ingested(AbstractObject $object) { |
|
|
|
function islandora_islandora_object_ingested(AbstractObject $object) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/derivatives'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/derivatives'); |
|
|
|
|
|
|
|
// Defer derivatives if necessary. |
|
|
|
|
|
|
|
if (islandora_get_defer_derivatives_flag($object)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
islandora_run_derivatives($object, NULL); |
|
|
|
islandora_run_derivatives($object, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1730,6 +1738,10 @@ function islandora_islandora_object_ingested(AbstractObject $object) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { |
|
|
|
function islandora_islandora_datastream_ingested(AbstractObject $object, AbstractDatastream $datastream) { |
|
|
|
module_load_include('inc', 'islandora', 'includes/derivatives'); |
|
|
|
module_load_include('inc', 'islandora', 'includes/derivatives'); |
|
|
|
|
|
|
|
// Defer derivatives if necessary. |
|
|
|
|
|
|
|
if (islandora_get_defer_derivatives_flag($object)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
islandora_run_derivatives($object, $datastream->id); |
|
|
|
islandora_run_derivatives($object, $datastream->id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1951,3 +1963,14 @@ function islandora_menu_local_tasks_alter(&$data, $router_item, $root_path) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Implements hook_islandora_object_alter(). |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function islandora_islandora_object_alter(AbstractObject $object, array &$context) { |
|
|
|
|
|
|
|
// Prevent derivative creation during ingest if var is set. |
|
|
|
|
|
|
|
if ($context['action'] == 'ingest' && variable_get('islandora_defer_derivatives_on_ingest', FALSE)) { |
|
|
|
|
|
|
|
module_load_include('inc', 'islandora', 'includes/derivatives'); |
|
|
|
|
|
|
|
islandora_set_defer_derivatives_flag($object); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|