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