Browse Source

Merge branch 'master' of https://github.com/zacho/islandora into zacho-master

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
806827bd81
  1. 24
      MimeClass.inc
  2. 11
      plugins/pidfield/pidfield.module

24
MimeClass.inc

@ -163,6 +163,9 @@ class MimeClass {
"mpeg" => "video/mpeg", "mpeg" => "video/mpeg",
"mpe" => "video/mpeg", "mpe" => "video/mpeg",
"mpg" => "video/mpeg", "mpg" => "video/mpeg",
"m4v" => "video/mp4",
"mp4" => "video/mp4",
"ogv" => "video/ogg",
"qt" => "video/quicktime", "qt" => "video/quicktime",
"mov" => "video/quicktime", "mov" => "video/quicktime",
"mxu" => "video/vnd.mpegurl", "mxu" => "video/vnd.mpegurl",
@ -170,12 +173,20 @@ class MimeClass {
"movie" => "video/x-sgi-movie", "movie" => "video/x-sgi-movie",
"flv" => "video/x-flv", "flv" => "video/x-flv",
"swf" => "application/x-shockwave-flash", "swf" => "application/x-shockwave-flash",
// audio:
"mp3" => "audio/mpeg",
"mp4a" => "audio/mp4",
"m4a" => "audio/mp4",
"oga" => "audio/ogg",
"ogg" => "audio/ogg",
"flac" => "audio/x-flac",
"wav" => "audio/vnd.wave",
// compressed formats: (note: http://svn.cleancode.org/svn/email/trunk/mime.types) // compressed formats: (note: http://svn.cleancode.org/svn/email/trunk/mime.types)
"tgz" => "application/x-gzip", "tgz" => "application/x-gzip",
"gz" => "application/x-gzip", "gz" => "application/x-gzip",
"tar" => "application/x-tar", "tar" => "application/x-tar",
"gtar" => "application/x-gtar", "gtar" => "application/x-gtar",
"zip" => "application/x-zip", "zip" => "application/x-zip",
// others: // others:
'bin' => 'application/octet-stream', 'bin' => 'application/octet-stream',
); );
@ -323,14 +334,3 @@ class MimeClass {
} }
/*
$helper = new MimeClass();
print "get_extension('application/x-gzip'): \n";
echo print_r( $helper->get_extension('application/x-gzip', true), true ) . "\n";
print "get_extension('text/plain'): \n";
echo print_r( $helper->get_extension('text/plain', true), true ) . "\n";
print "get_mimetype('fucker/asdf.tar.gz'): \n";
echo print_r( $helper->get_mimetype('fucker/asdf.tar.gz', true), true ) . "\n";
print "get_mimetype('blah.tsp'): \n";
echo print_r( $helper->get_mimetype('blah.tsp', true), true ) . "\n";
/* */

11
plugins/pidfield/pidfield.module

@ -276,11 +276,14 @@ function theme_pidfield_formatter_default($element) {
//return $element['#item']['safe']; //return $element['#item']['safe'];
$pid = $element['#item']['safe']; $pid = $element['#item']['safe'];
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); if(!empty($pid)) {
$item = new Fedora_Item($pid); module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($pid);
return fedora_repository_get_items($pid); return fedora_repository_get_items($pid);
//return $item->objectProfile->objLabel; //return $item->objectProfile->objLabel;
}
return null;
} }
/** /**

Loading…
Cancel
Save