|
|
|
@ -360,14 +360,6 @@ function islandora_menu() {
|
|
|
|
|
'access arguments' => array(ISLANDORA_REGENERATE_DERIVATIVES, 4), |
|
|
|
|
'load arguments' => array(2), |
|
|
|
|
); |
|
|
|
|
$items['islandora/object/%islandora_object/download_clip'] = array( |
|
|
|
|
'page callback' => 'islandora_download_clip', |
|
|
|
|
'page arguments' => array(2), |
|
|
|
|
'type' => MENU_CALLBACK, |
|
|
|
|
'access callback' => 'islandora_object_access', |
|
|
|
|
'access arguments' => array(ISLANDORA_VIEW_OBJECTS, 2), |
|
|
|
|
'load arguments' => array(2), |
|
|
|
|
); |
|
|
|
|
$items['islandora/event-status'] = array( |
|
|
|
|
'title' => 'Event Status', |
|
|
|
|
'page callback' => 'islandora_event_status', |
|
|
|
@ -1622,31 +1614,6 @@ function islandora_entity_property_info() {
|
|
|
|
|
return $info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Menu callback downloads the given clip. |
|
|
|
|
*/ |
|
|
|
|
function islandora_download_clip(AbstractObject $object) { |
|
|
|
|
if (isset($_GET['clip'])) { |
|
|
|
|
$url = $_GET['clip']; |
|
|
|
|
if (!preg_match('/^https?:\/\//', $url)) { |
|
|
|
|
$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; |
|
|
|
|
header("Content-Disposition: attachment; filename=\"{$filename}.jpg\""); |
|
|
|
|
header("Content-type: image/jpeg"); |
|
|
|
|
header("Content-Transfer-Encoding: binary"); |
|
|
|
|
$ch = curl_init(); |
|
|
|
|
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); |
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0); |
|
|
|
|
curl_setopt($ch, CURLOPT_URL, $url); |
|
|
|
|
$response = curl_exec($ch); |
|
|
|
|
curl_close($ch); |
|
|
|
|
} |
|
|
|
|
exit(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Implements hook_file_mimetype_mapping_alter(). |
|
|
|
|
* |
|
|
|
|