From 13c392458ce96579f75651cb1c470856744dffb0 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Sat, 23 Apr 2016 19:22:28 -0300 Subject: [PATCH 1/2] Remove unneeded download path. --- islandora.module | 8 -------- 1 file changed, 8 deletions(-) diff --git a/islandora.module b/islandora.module index af25681e..1d060c4d 100644 --- a/islandora.module +++ b/islandora.module @@ -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', From 3587335ac516a7f472b1099cbae4205a0476c74f Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Mon, 25 Apr 2016 14:38:48 -0300 Subject: [PATCH 2/2] Removing unused clip function. --- islandora.module | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/islandora.module b/islandora.module index 1d060c4d..b3c4263c 100644 --- a/islandora.module +++ b/islandora.module @@ -1614,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(). *