@ -29,15 +29,21 @@ class ShowStreamsInFieldSets {
function showFlv() {
//FLV is the datastream id
$path = drupal_get_path('module', 'Fedora_Repository');
$fullPath = base_path() . $path ;
$fullPath = url($path) ;
$content = "";
$pathTojs = drupal_get_path('module', 'Fedora_Repository') . '/js/swfobject.js';
drupal_add_js("$pathTojs");
$content .= '< div id = "player' . $this->pid . 'FLV" > < a href = "http://www.macromedia.com/go/getflashplayer" > Get the Flash Player< / a > to see this player.< / div > ';
drupal_add_js('var s1 = new SWFObject("' . $fullPath . '/flash/flvplayer.swf","single","320","240","7");
s1.addParam("allowfullscreen","TRUE");
s1.addVariable("file","' . base_path() . 'fedora/repository/' . $this->pid . '/FLV/FLV.flv");
s1.write("player' . $this->pid . 'FLV");', 'inline', 'footer');
$div_id = "player' . $this->pid . 'FLV";
$content .= < < < EOH
< div id = "$div_id" > < a href = "http://www.macromedia.com/go/getflashplayer" > Get the Flash Player< / a > to see this player.< / div >
EOH;
drupal_add_js(< < < EOJS
var s1 = new SWFObject("$fullPath/flash/flvplayer.swf","single","320","240","7");
s1.addParam("allowfullscreen","TRUE");
s1.addVariable("file", "$fullPath/fedora/repository/{$this->pid}/FLV/FLV.flv");
s1.write("$div_id");
EOJS
, 'inline', 'footer');
$collection_fieldset = array(
'#title' => t('Flash Video'),
'#collapsible' => TRUE,
@ -48,30 +54,26 @@ class ShowStreamsInFieldSets {
/**
* Show the TN ??
* @global type $base_url
* @return type
*/
function showTN() {
global $base_url;
$collection_fieldset = array(
'#title' => '',
'#attributes' => array(),
'#collapsible' => FALSE,
'#value' => '< a href = "' . $base_url . '/fedora/repository/' . $this->pid . '/OBJ/" > < img src = "' . $base_url . '/fedora/repository/' . $this->pid . '/TN/TN' . '" / > < / a > ' ,
'#value' => l(theme('image', "fedora/repository/{$this->pid}/TN/TN", '', '', NULL, FALSE), "fedora/repository/{$this->pid}/OBJ", array('html' => TRUE)) ,
);
return theme('fieldset', $collection_fieldset);
}
/**
* Same as showTN but artinventory stores the image in a dsid of IMAGE instead of OBJ
* @global type $base_url
* @return type
*/
function showArtInventoryTN() {
global $base_url;
$collection_fieldset = array(
'#collapsible' => FALSE,
'#value' => '< a href = "' . $base_url . '/fedora/repository/' . $this->pid . '/IMAGE/image.jpg" > < img src = "' . $base_url . '/fedora/repository/' . $this->pid . '/TN/TN' . '" / > < / a > ' ,
'#value' => l(theme('image', "fedora/repository/{$this->pid}/TN/TN", '', '', NULL, FALSE), "fedora/repository/{$this->pid}/IMAGE/image.jpg", array('html' => TRUE)) ,
);
return theme('fieldset', $collection_fieldset);
}
@ -102,14 +104,16 @@ class ShowStreamsInFieldSets {
$objectHelper = new ObjectHelper();
$item = new Fedora_Item($this->pid);
if (key_exists('TN', $item->datastreams)) {
$tn_url = $base_url . '/fedora/repository/' . $item->pid . '/TN' ;
$tn_url = "fedora/repository/{$item->pid}/TN" ;
}
else {
$tn_url = $base_path . drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png';
$tn_url = drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_app_download_manager.png';
}
$tn_url = url($tn_url);
$dc_html = $objectHelper->getFormattedDC($item);
$dl_link = l('< div style = "float:left; padding: 10px" > < img src = "' . $tn_url . '" > < br / > ' . t('View Document') .'< / div > ', 'fedora/repository/' . $this->pid . '/OBJ' , array('html' => TRUE));
$dl_link = l('< div style = "float:left; padding: 10px" > ' . theme('image', $tn_url, '', '', NULL, FALSE) . ' < br / > ' . t('View Document') .'< / div > ', "fedora/repository/{$this->pid}/OBJ" , array('html' => TRUE));
$tabset['first_tab']['tabs']['view'] = array(
'#type' => 'tabpage',
@ -126,11 +130,13 @@ class ShowStreamsInFieldSets {
);
}
$viewer_url = 'http://docs.google.com/viewer?url=' . url("fedora/repository/{$this->pid}/OBJ/preview.pdf", array('absolute' => TRUE)) . '&embedded=TRUE';
$tabset['second_tab'] = array(
'#type' => 'tabpage',
'#title' => t('Read Online'),
'#content' => "< iframe src = \"http://docs.google.com/viewer?url=" . $ base_url . ' / fedora / repository / ' .
$this->pid . '/OBJ/preview.pdf' . "& embedded=TRUE\" style=\"width:600px; height:500px;\" frameborder=\"0\">< / iframe > "
'#content' => < < < EOM
< iframe src = "$viewer_url" style = "width:600px; height:500px;" frameborder = "0" > < / iframe > "
EOM
);
// Render the tabset.
@ -164,7 +170,7 @@ class ShowStreamsInFieldSets {
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($this->pid);
$streams = $item->get_datastreams_list_as_array();
return "< a href = '" . $base_url . "/fedora/repository/" . $this->pid . "/OBJ/" . $streams[' OBJ ' ] [ ' label ' ] . " ' > " . $streams['OBJ']['label'] . "< / a > " ;
return l($streams['OBJ']['label'], "fedora/repository/{$this->pid}/OBJ") ;
}
/**