qadan
11 years ago
11 changed files with 167 additions and 40 deletions
@ -0,0 +1,27 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* @file |
||||||
|
* Autocomplete functionality for MIME types in Islandora. |
||||||
|
*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Autocomplete the MIME type name. |
||||||
|
* |
||||||
|
* @param string $string |
||||||
|
* A search string. |
||||||
|
* |
||||||
|
* @return string |
||||||
|
* The rendered JSON results. |
||||||
|
*/ |
||||||
|
function islandora_mime_type_autocomplete($string) { |
||||||
|
module_load_include('inc', 'islandora', 'includes/mime_detect'); |
||||||
|
$mime_detect = new MimeDetect(); |
||||||
|
$mime_types = $mime_detect->getMimeTypes(); |
||||||
|
$output = array(); |
||||||
|
foreach ($mime_types as $mime_type) { |
||||||
|
if (preg_match("/{$string}/i", $mime_type) !== 0) { |
||||||
|
$output[$mime_type] = $mime_type; |
||||||
|
} |
||||||
|
} |
||||||
|
return drupal_json_output($output); |
||||||
|
} |
@ -1,18 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
/** |
|
||||||
* @file |
|
||||||
* The default view to theme an image of an object. |
|
||||||
* |
|
||||||
* This view is passed into 'islandora-object-print' theme file |
|
||||||
* and is rendred as an image. Allows for seperate theming of image |
|
||||||
* and metadata. |
|
||||||
* |
|
||||||
*/ |
|
||||||
|
|
||||||
?> |
|
||||||
<?php if (isset($islandora_content)): ?> |
|
||||||
<div> |
|
||||||
<?php print $islandora_content; ?> |
|
||||||
</div> |
|
||||||
<?php endif; ?> |
|
Loading…
Reference in new issue