Пример #1
0
function emiglio_exhibit_builder_page_nav($exhibitPage = null, $currentPageId)
{
    if (!$exhibitPage) {
        $exhibitPage = get_current_record('exhibit_page');
    }
    $parents = array();
    $currentPage = get_record_by_id('Exhibit Page', $currentPageId);
    while ($currentPage->parent_id) {
        $currentPage = $currentPage->getParent();
        array_unshift($parents, $currentPage->id);
    }
    $class = '';
    $class .= $exhibitPage->id == $currentPageId ? 'current' : '';
    $parent = array_search($exhibitPage->id, $parents) !== false ? ' parent' : '';
    $html = '<li class="' . $class . $parent . '">' . '<a href="' . exhibit_builder_exhibit_uri(get_current_record('exhibit'), $exhibitPage) . '">' . metadata($exhibitPage, 'title') . '</a>';
    $children = $exhibitPage->getChildPages();
    if ($children) {
        $html .= '<ul>';
        foreach ($children as $child) {
            $html .= emiglio_exhibit_builder_page_nav($child, $currentPageId);
            release_object($child);
        }
        $html .= '</ul>';
    }
    $html .= '</li>';
    return $html;
}
Пример #2
0
 /**
  * Get the sources for a video stream.
  *
  * @param Item $item
  * @return array The list of sources.
  */
 public function videoStreamSources($item = null)
 {
     $view = $this->view;
     if (is_null($item)) {
         $item = get_current_record('item');
     }
     $sources = array();
     if (get_option('videostream_jwplayer_flash_streaming')) {
         $segmentFlashUrl = metadata($item, array('Streaming Video', 'Video Streaming URL'));
         $segmentFlashType = metadata($item, array('Streaming Video', 'Video Type'));
         $segmentFlashFile = metadata($item, array('Streaming Video', 'Video Filename'));
         $sources[] = array('file' => $segmentFlashUrl . $segmentFlashType . $segmentFlashFile);
     }
     if (get_option('videostream_jwplayer_http_streaming')) {
         $segmentHttpDir = metadata($item, array('Streaming Video', 'HTTP Streaming Directory'));
         $segmentHttpFile = metadata($item, array('Streaming Video', 'HTTP Video Filename'));
         $sources[] = array('file' => $segmentHttpDir . $segmentHttpFile);
     }
     if (get_option('videostream_jwplayer_hls_streaming')) {
         $segmentHlsDir = metadata($item, array('Streaming Video', 'HLS Streaming Directory'));
         $segmentHlsFile = metadata($item, array('Streaming Video', 'HLS Video Filename'));
         $sources[] = array('file' => $segmentHlsDir . $segmentHlsFile);
     }
     return $sources;
 }
function return_files_for_item($options = array(), $wrapperAttributes = array('class' => 'item-file'), $item = null)
{
    if (!$item) {
        $item = get_current_record('item');
    }
    return return_files($item->Files, $options, $wrapperAttributes);
}
/**
 * Tests whether an item contains Fedora streams.
 *
 * @param Item $item The item.
 * @return bool Is the item a Fedora stream?
 * @author Eric Rochester <*****@*****.**>
 **/
function fc_isFedoraStream($item = null)
{
    $item = $item ? $item : get_current_record('item');
    $objects = get_db()->getTable('FedoraConnectorObject');
    $isStream = $item && $objects->findByItem($item);
    return $isStream;
}
 public function filterDisplayElements($elementSets)
 {
     if (!($item = get_current_record('item', false))) {
         return $elementSets;
     }
     if (!metadata($item, array('Item Type Metadata', 'Player'))) {
         return $elementSets;
     }
     $newElementSets = array();
     foreach ($elementSets as $set => $elements) {
         $newElements = $elements;
         if ($set === "Moving Image Item Type Metadata") {
             $newElements = array();
             foreach ($elements as $key => $element) {
                 if ($key === "Player") {
                     $playerElement = $element;
                 } else {
                     $newElements[$key] = $element;
                 }
             }
         }
         $newElementSets[$set] = $newElements;
     }
     if (isset($playerElement)) {
         return array_merge(array('Player' => array('' => $playerElement)), $newElementSets);
     } else {
         return $elementSets;
     }
 }
 private function _getRecordType($params)
 {
     if (isset($params['module'])) {
         switch ($params['module']) {
             case 'exhibit-builder':
                 //ExhibitBuilder uses slugs in the params, so need to negotiate around those
                 //to dig up the record_id and model
                 if (!empty($params['page_slug_1'])) {
                     $page = get_current_record('exhibit_page', false);
                     $model = 'ExhibitPage';
                 } else {
                     if (!empty($params['item_id'])) {
                         $model = 'Item';
                     } else {
                         //TODO: check for other possibilities
                     }
                 }
                 break;
             default:
                 $model = Inflector::camelize($params['module']) . ucfirst($params['controller']);
                 break;
         }
     } else {
         $model = ucfirst(Inflector::singularize($params['controller']));
     }
     return $model;
 }
Пример #7
0
function rhythm_display_date_added($format = 'F j, Y', $item = null)
{
    if (!$item) {
        $item = get_current_record('item');
    }
    $dateAdded = metadata($item, 'added');
    return date($format, strtotime($dateAdded));
}
Пример #8
0
 /**
  * Load viewer properties when instantiating class
  *
  * @param object the database object, defaults to standard Omeka db
  * @return null
  */
 public function __construct($db = null)
 {
     parent::__construct($db);
     if (!empty($this->viewer)) {
         $this->setViewerByName($this->viewer);
     }
     try {
         $this->_item = get_current_record('Item');
     } catch (Exception $e) {
         //ignore for now
     }
 }
Пример #9
0
 /**
  * Returns the form code for segmenting video for items.
  *
  * @param Item $item
  * @return string Html string.
  */
 public function segmentTuningForm($item = null)
 {
     $view = $this->view;
     $db = get_db();
     if (is_null($item)) {
         $item = get_current_record('item');
     }
     $sources = $view->videoStreamSources($item);
     $sources = version_compare(phpversion(), '5.4.0', '<') ? json_encode($sources) : json_encode($sources, JSON_UNESCAPED_SLASHES);
     $html = $view->partial('common/segment-tuning-form.php', array('item' => $item, 'sources' => $sources, 'segment_start' => (string) metadata($item, array('Streaming Video', 'Segment Start')), 'segment_end' => (string) metadata($item, array('Streaming Video', 'Segment End')), 'segment_description' => (string) metadata($item, array('Dublin Core', 'Description'))));
     return $html;
 }
Пример #10
0
function custom_item_image_gallery($attrs = array(), $imageType = 'square_thumbnail', $filesShow = false, $item = null)
{
    if (!$item) {
        $item = get_current_record('item');
    }
    $files = $item->Files;
    if (!$files) {
        return '';
    }
    $defaultAttrs = array('wrapper' => array('id' => 'item-images'), 'linkWrapper' => array(), 'link' => array(), 'image' => array());
    $attrs = array_merge($defaultAttrs, $attrs);
    $html = '';
    if ($attrs['wrapper'] !== null) {
        $html .= '<div ' . tag_attributes($attrs['wrapper']) . '>' . "\n";
    }
    foreach ($files as $file) {
        if ($attrs['linkWrapper'] !== null) {
            $html .= '<div ' . tag_attributes($attrs['linkWrapper']) . '>' . "\n";
        }
        $fileTitle = metadata($file, 'display title');
        $webPath = $file->getWebPath('original');
        // Taille de l'image en fonction du type de fichier
        if (preg_match("/\\.jpg\$/", $webPath)) {
            $imageType = 'fullsize';
            $attrs['image'] = array('style' => 'max-width: 100%');
        } else {
            $imageType = 'thumbnail';
            $attrs['image'] = array('style' => 'width:5em;vertical-align:middle;');
        }
        $image = file_image($imageType, $attrs['image'], $file);
        $html .= '<h2 class="title" style="text-align:center;">' . $fileTitle . '</h2>' . "\n";
        if ($filesShow) {
            $html .= link_to($file, 'show', $image, $attrs['link']);
        } else {
            if (preg_match("/\\.pdf\$/", $webPath)) {
                $html .= '<p style="padding:0 1em 1em 1em;color: #333333;">T&eacute;l&eacute;charger le fichier PDF : ';
            }
            $linkAttrs = $attrs['link'] + array('href' => $webPath);
            $html .= '<a ' . tag_attributes($linkAttrs) . '>' . $image . '</a>' . "\n";
            if (preg_match("/\\.pdf\$/", $webPath)) {
                $html .= '</p>';
            }
        }
        if ($attrs['linkWrapper'] !== null) {
            $html .= '</div>' . "\n";
        }
    }
    if ($attrs['wrapper'] !== null) {
        $html .= '</div>' . "\n";
    }
    return $html;
}
Пример #11
0
 /**
  * Get the specified BookReader.
  *
  * @param array $args Associative array of optional values:
  *   - (integer|Item) item: The item is the current one if not set.
  *   - (integer) page: set the page to be shown when including the iframe.
  *   - (boolean) embed_functions: include buttons (Zoom, Search...).
  *   - (integer) mode_page: allow to display 1 or 2 pages side-by-side.
  *   - (integer) part: can be used to display the specified part of a book.
  *
  * @return string. The html string corresponding to the BookReader.
  */
 public function getBookReader($args = array())
 {
     if (!isset($args['item'])) {
         $item = get_current_record('item');
     } elseif ($args['item'] instanceof Item) {
         $item = $args['item'];
     } else {
         $item = get_record_by_id('Item', (int) $args['item']);
     }
     if (empty($item)) {
         return '';
     }
     $part = empty($args['part']) ? 0 : (int) $args['part'];
     $page = empty($args['page']) ? '0' : $args['page'];
     // Currently, all or none functions are enabled.
     $embed_functions = isset($args['embed_functions']) ? $args['embed_functions'] : get_option('bookreader_embed_functions');
     // TODO Count leaves, not files.
     if ($item->fileCount() > 1) {
         $mode_page = isset($args['mode_page']) ? $args['mode_page'] : get_option('bookreader_mode_page');
     } else {
         $mode_page = 1;
     }
     // Build url of the page with iframe.
     $queryParams = array();
     if ($part > 1) {
         $queryParams['part'] = $part;
     }
     if (empty($embed_functions)) {
         $queryParams['ui'] = 'embed';
     }
     $url = absolute_url(array('id' => $item->id), 'bookreader_viewer', $queryParams);
     $url .= '#';
     $url .= empty($page) ? '' : 'page/n' . $page . '/';
     $url .= 'mode/' . $mode_page . 'up';
     $class = get_option('bookreader_class');
     if (!empty($class)) {
         $class = ' class="' . $class . '"';
     }
     $width = get_option('bookreader_width');
     if (!empty($width)) {
         $width = ' width="' . $width . '"';
     }
     $height = get_option('bookreader_height');
     if (!empty($height)) {
         $height = ' height="' . $height . '"';
     }
     $html = '<div><iframe src="' . $url . '"' . $class . $width . $height . ' frameborder="0"></iframe></div>';
     return $html;
 }
Пример #12
0
 /**
  * Get the specified JW Player to display a video stream.
  *
  * @param Item $item
  * @return string Html string.
  */
 public function videoStream($item = null)
 {
     $view = $this->view;
     $db = get_db();
     if (is_null($item)) {
         $item = get_current_record('item');
     }
     $sources = $view->videoStreamSources($item);
     $sources = version_compare(phpversion(), '5.4.0', '<') ? json_encode($sources) : json_encode($sources, JSON_UNESCAPED_SLASHES);
     $partial = get_option('videostream_jwplayer_external_control') ? 'video-stream-external-control' : 'video-stream-internal-control';
     $html = $view->partial('common/' . $partial . '.php', array('item' => $item, 'sources' => $sources, 'segment_start' => (string) metadata($item, array('Streaming Video', 'Segment Start')), 'segment_end' => (string) metadata($item, array('Streaming Video', 'Segment End')), 'segment_description' => (string) metadata($item, array('Dublin Core', 'Description'))));
     if (get_option('videostream_display_current')) {
         $html .= $view->partial('common/video-stream-current.php', array('item' => $item, 'video_filename' => (string) metadata($item, array('Streaming Video', 'Video Filename'))));
     }
     return $html;
 }
 /**
  * Tests whether metadata() returns the correct value for an exhibit page.
  *
  * @uses metadata()
  **/
 public function testCanRetrieveCorrectExhibitPageValue()
 {
     $exhibit = $this->helper->createNewExhibit(true, false, 'Exhibit Title', 'Exhibit Description', 'Exhibit Credits', 'exhibitslug');
     $this->assertTrue($exhibit->exists());
     $exhibitPage = $this->helper->createNewExhibitPage($exhibit, null, 'Exhibit Page Title', 'exhibitpageslug', 1, 'text');
     $this->assertTrue($exhibitPage->exists());
     $this->dispatch('exhibits/show/exhibitslug/exhibitpageslug');
     $exhibitPage = get_current_record('exhibit_page');
     $this->assertTrue($exhibitPage->exists());
     $this->assertEquals('Exhibit Page Title', $exhibitPage->title);
     $this->assertEquals('exhibitpageslug', $exhibitPage->slug);
     // Exhibit Page Title
     $this->assertEquals('Exhibit Page Title', metadata('exhibitPage', 'Title'));
     // Exhibit Page Layout
     $this->assertEquals('text', metadata('exhibitPage', 'Layout'));
     // Exhibit Page Order
     $this->assertEquals(1, metadata('exhibitPage', 'Order'));
     // Exhibit Page Slug
     $this->assertEquals('exhibitpageslug', metadata('exhibitPage', 'Slug'));
 }
 /**
  * Get the IIIF manifest for the specified collection.
  *
  * @param Record|integer|null $record Collection
  * @param boolean $asJson Return manifest as object or as a json string.
  * @return Object|string|null. The object or the json string corresponding to the
  * manifest.
  */
 public function iiifCollection($record = null, $asJson = true)
 {
     if (is_null($record)) {
         $record = get_current_record('collection');
     } elseif (is_numeric($record)) {
         $record = get_record_by_id('Collection', (int) $record);
     }
     if (empty($record)) {
         return null;
     }
     $recordClass = get_class($record);
     if ($recordClass != 'Collection') {
         return null;
     }
     $result = $this->_buildManifestCollection($record);
     if ($asJson) {
         return version_compare(phpversion(), '5.4.0', '<') ? json_encode($result) : json_encode($result, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     }
     // Return as array
     return $result;
 }
Пример #15
0
 /**
  * Get the IIIF manifest for the specified record.
  *
  * @param Record|integer|null $record
  * @param boolean $asJson Return manifest as object or as a json string.
  * @return Object|string|null. The object or the json string corresponding to the
  * manifest.
  */
 public function iiifManifest($record = null, $asJson = true, $alternative = false, $currentImage = false)
 {
     if (is_null($record)) {
         $record = get_current_record('item');
     } elseif (is_numeric($record)) {
         $record = get_record_by_id('Item', (int) $record);
     }
     if (empty($record)) {
         return null;
     }
     $recordClass = get_class($record);
     if ($recordClass == 'Item') {
         $result = $this->_buildManifestItem($record, $alternative, $currentImage);
     } elseif ($recordClass == 'Collection') {
         return $this->view->iiifCollection($record, $asJson);
     } else {
         return null;
     }
     if ($asJson) {
         return version_compare(phpversion(), '5.4.0', '<') ? json_encode($result) : json_encode($result, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     }
     // Return as array
     return $result;
 }
/**
 * Return a URL to an item within an exhibit.
 * 
 * @param Item $item
 * @param Exhibit|null $exhibit If null, will use the current exhibit.
 * @return string
 */
function exhibit_builder_exhibit_item_uri($item, $exhibit = null)
{
    if (!$exhibit) {
        $exhibit = get_current_record('exhibit');
    }
    return url(array('slug' => $exhibit->slug, 'item_id' => $item->id), 'exhibitItem');
}
Пример #17
0
    
            <?php 
    echo link_to_collection(__('Edit'), array('class' => 'big green button'), 'edit');
    ?>
        <?php 
}
?>
        <a href="<?php 
echo html_escape(public_url('collections/show/' . metadata('collection', 'id')));
?>
" class="big blue button" target="_blank"><?php 
echo __('View Public Page');
?>
</a>
        <?php 
if (is_allowed(get_current_record('collection'), 'delete')) {
    ?>
    
            <?php 
    echo link_to_collection(__('Delete'), array('class' => 'big red button delete-confirm'), 'delete-confirm');
    ?>
        <?php 
}
?>
    </div>       
    
    <div class="public-featured panel">
        <p><span class="label"><?php 
echo __('Public');
?>
:</span> <?php 
 /**
  * Shortcode to display viewer.
  *
  * @param array $args
  * @param Omeka_View $view
  * @return string
  */
 public static function shortcodeOpenLayersZoom($args, $view)
 {
     // Check required arguments
     $recordType = isset($args['record_type']) ? $args['record_type'] : 'Item';
     $recordType = ucfirst(strtolower($recordType));
     if (!in_array($recordType, array('Item', 'File'))) {
         return;
     }
     // Get the specified record.
     if (isset($args['record_id'])) {
         $recordId = (int) $args['record_id'];
         $record = get_record_by_id($recordType, $recordId);
     } else {
         $record = get_current_record(strtolower($recordType));
     }
     if (empty($record)) {
         return;
     }
     $html = $view->openLayersZoom()->zoom($record);
     if ($html) {
         $html = '<link href="' . css_src('ol') . '" media="all" rel="stylesheet" type="text/css" >' . js_tag('ol') . js_tag('OpenLayersZoom') . $html;
         return $html;
     }
 }
Пример #19
0
    public function append($args)
    {
        ?>
        <?php 
        if (get_option('jwplayer_external_control')) {
            ?>
        <?php 
            if (metadata('item', array('Streaming Video', 'Segment Start'))) {
                ?>
            <div id="vid_player">
             <div id="jwplayer_plugin">Player failed to load...  </div>
			 <div id="vidcontrols">
	            <ul class="vidControlsLayout" style="width='<?php 
                echo get_option("jwplayer_width_public");
                ?>
'">
                    <li id="start_img"><img src="<?php 
                echo img('pause.png');
                ?>
"  title="Start/Stop" class="btnPlay"/></li>	            	
		            <li id="playback-display"><span class="current">0:00:00</span></li>
					<li class="progressBar"></li>   
		            <li id="slider-display"><span class="duration">0:00:00</span> </li>
		            <li id="vol_img"><img class="muted" src="<?php 
                echo img('volume_speaker.png');
                ?>
" /></a></li>
	                <li class="volumeBar"></li>		
	            </ul>
	         </div>

        <script type="text/javascript">
        var is_play = true;

		var startTime= calculateTime("<?php 
                echo metadata('item', array('Streaming Video', 'Segment Start'));
                ?>
");

		var endTime = calculateTime("<?php 
                echo metadata('item', array('Streaming Video', 'Segment End'));
                ?>
");
		jwplayer("jwplayer_plugin").setup({
		playlist:  [{
		sources: [
		<?php 
                if (get_option('jwplayer_hls_streaming')) {
                    ?>
		{
		file: '<?php 
                    echo metadata('item', array("Streaming Video", "HLS Streaming Directory"));
                    echo metadata('item', array("Streaming Video", "HLS Video Filename"));
                    ?>
' },
		<?php 
                }
                ?>
		<?php 
                if (get_option('jwplayer_flash_streaming')) {
                    ?>
		{
		file: '<?php 
                    echo metadata("item", array("Streaming Video", "Video Streaming URL"));
                    echo metadata("item", array("Streaming Video", "Video Type"));
                    echo metadata('item', array("Streaming Video", "Video Filename"));
                    ?>
'} ,
		<?php 
                }
                ?>
		<?php 
                if (get_option('jwplayer_http_streaming')) {
                    ?>
		{
		file: '<?php 
                    echo metadata("item", array("Streaming Video", "HTTP Streaming Directory"));
                    echo metadata("item", array("Streaming Video", "HTTP Video Filename"));
                    ?>
'},
		<?php 
                }
                ?>
		]
		}
		],
		<?php 
                if (get_option('jwplayer_flash_primary')) {
                    ?>
		primary: "flash",
		<?php 
                }
                ?>
		autostart: false,
		controls: false,
		width: "100%",
		height: "<?php 
                echo get_option('jwplayer_height_public');
                ?>
",
		}
		);
		jwplayer("jwplayer_plugin").onReady(function(){
				jQuery('.current').text(getFormattedTimeString(startTime));
				jQuery('.duration').text(getFormattedTimeString(endTime));
				jwplayer("jwplayer_plugin").seek(startTime);
                            <?php 
                if (get_option('jwplayer_autostart') == 0) {
                    ?>
                                jwplayer("jwplayer_plugin").pause();
                            <?php 
                }
                ?>
				}
				);
		jQuery( ".progressBar" ).slider(
						{
		min: startTime,
		max: endTime,
		range: "max",
		slide: function(event, ui) {
		jwplayer().seek(ui.value);
		},
		change: function(event,ui){
		if (jwplayer().getPosition() > endTime){
		jwplayer().seek(startTime);
		}
		}
		});
		jQuery( ".volumeBar" ).slider(
				{
		min: 0,
		max: 100,
		range: "max",
		slide: function(event, ui) {
		jwplayer().setVolume(ui.value);		
		},
		change: function(event,ui){
		jwplayer().setVolume(ui.value);		
		}
		});
		jwplayer("jwplayer_plugin").onTime(function(event){
			jQuery(".progressBar").slider("value", jwplayer("jwplayer_plugin").getPosition());
			jQuery('.current').text(getFormattedTimeString(jwplayer("jwplayer_plugin").getPosition()));
				});
		jwplayer("jwplayer_plugin").onPlay(function(){
			jQuery('.btnPlay').attr("src","<?php 
                echo img('pause.png');
                ?>
");
		});
		jwplayer("jwplayer_plugin").onPause(function(){
			jQuery('.btnPlay').attr("src","<?php 
                echo img('play.png');
                ?>
");
		});
		jwplayer("jwplayer_plugin").onMute(function(event){
				if (event.mute){
			jQuery('.muted').attr("src","<?php 
                echo img('volume_speaker_mute.png');
                ?>
");
		}else{
			jQuery('.muted').attr("src","<?php 
                echo img('volume_speaker.png');
                ?>
");
		}
		}
				);
		jwplayer("jwplayer_plugin").onVolume(function(event){
				if (event.volume <= 0 ){
			jQuery('.muted').attr("src","<?php 
                echo img('volume_speaker_mute.png');
                ?>
");
			
		}else{
			jQuery('.muted').attr("src","<?php 
                echo img('volume_speaker.png');
                ?>
");
			
		}
		}
				);
		jQuery('.btnPlay').on('click', function() {
			   if (jwplayer().getPosition() > endTime){
				   jwplayer().seek(startTime);
				} 
				   jwplayer().play();
				   return false;
				});

		jQuery('.btnStop').on('click', function() {
				jwplayer().stop();
				jwplayer().seek(startTime);
				jQuery(".progressBar").slider("value", jwplayer().getPosition());
				jQuery('.current').text(getFormattedTimeString(jwplayer().getPosition()));
				return false;
				});
		jQuery('.muted').click(function() {
				jwplayer().setMute(); 
				return false;
				});

		jQuery('#vid_player')[0].onmouseover = (function() {
		    var onmousestop = function() {
		       jQuery('#vidcontrols').css('display', 'none');
		    }, thread;

	    return function() {
	       jQuery('#vidcontrols').css('display', 'block');
		        clearTimeout(thread);
		        thread = setTimeout(onmousestop, 3000);
		    };
		})();
		jQuery('#vid_player')[0].onmousedown = (function() {
		    var moveend = function() {
		       jQuery('#vidcontrols').css('display', 'none');
		    }, thread;

	    return function() {
	       jQuery('#vidcontrols').css('display', 'block');
		        clearTimeout(thread);
		        thread = setTimeout(moveend, 3000);
		    };
		})();
		</script>
		</div>
        <?php 
            }
            ?>
		<?php 
        } else {
            //use jwplayer control
            ?>
		<?php 
            if ($bText = metadata('item', array('Streaming Video', 'Segment Start'))) {
                ?>
				<div id="vid_player" style="width:100%; margin:0 auto;">
				    <div id="jwplayer_plugin" style="margin:0 auto;">Player failed to load...  </div>
				</div>
		<?php 
            }
            ?>
        <script type="text/javascript">
        var is_play = true;

	    var startTime= calculateTime("<?php 
            echo metadata('item', array('Streaming Video', 'Segment Start'));
            ?>
");

	    var endTime = calculateTime("<?php 
            echo metadata('item', array('Streaming Video', 'Segment End'));
            ?>
");
	    jwplayer("jwplayer_plugin").setup({
		playlist:  [{
		sources: [
		<?php 
            if (get_option('jwplayer_hls_streaming')) {
                ?>
		{
		file: '<?php 
                echo metadata('item', array("Streaming Video", "HLS Streaming Directory"));
                echo metadata('item', array("Streaming Video", "HLS Video Filename"));
                ?>
' },
		<?php 
            }
            ?>
		<?php 
            if (get_option('jwplayer_flash_streaming')) {
                ?>
		{
		file: '<?php 
                echo metadata("item", array("Streaming Video", "Video Streaming URL"));
                echo metadata("item", array("Streaming Video", "Video Type"));
                echo metadata('item', array("Streaming Video", "Video Filename"));
                ?>
'} ,
		<?php 
            }
            ?>

		<?php 
            if (get_option('jwplayer_http_streaming')) {
                ?>
		{
		file: '<?php 
                echo metadata("item", array("Streaming Video", "HTTP Streaming Directory"));
                echo metadata("item", array("Streaming Video", "HTTP Video Filename"));
                ?>
'},
		<?php 
            }
            ?>
		]
		}
		],
		<?php 
            if (get_option('jwplayer_flash_primary')) {
                ?>
		primary: "flash",
		<?php 
            }
            ?>
		autostart: false,
		width: "95%",
		height: <?php 
            echo get_option('jwplayer_height_public');
            ?>
		}
		);
		jwplayer("jwplayer_plugin").onReady(function(){
				jwplayer("jwplayer_plugin").seek(startTime);
                            <?php 
            if (get_option('jwplayer_autostart') == 0) {
                ?>
                                jwplayer("jwplayer_plugin").pause();
                            <?php 
            }
            ?>
		}
		);
		<?php 
        }
        ?>
        </script>
            <?php 
        if (get_option('jwplayer_display_current')) {
            ?>
                
                <?php 
            $orig_item = get_current_record('item');
            $orig_video = metadata("item", array("Streaming Video", "Video Filename"));
            ?>
                <?php 
            $items = get_records('item', array('collection' => metadata('item', 'collection id'), 'sort_field' => 'Streaming Video,Segment Start'), null);
            ?>
                
                <?php 
            set_loop_records('items', $items);
            if (has_loop_records('items')) {
                $items = get_loop_records('items');
            }
            ?>
                <?php 
            foreach (loop('items') as $item) {
                ?>
                <?php 
                if (metadata('item', array('Streaming Video', 'Segment Type')) == 'Scene' && metadata('item', array('Streaming Video', 'Video Filename')) == $orig_video) {
                    ?>
                    <div class="scene" id="<?php 
                    echo metadata('item', array('Streaming Video', 'Segment Start'));
                    ?>
" title="<?php 
                    echo metadata('item', array('Streaming Video', 'Segment End'));
                    ?>
" style="display:none;">
                    <h2>Current video segment:</h2>
                    <h3><?php 
                    echo link_to_item(metadata('item', array('Dublin Core', 'Title')));
                    ?>
</h3>
                    <div style="overflow:auto; max-height:150px;">
                    <p> <?php 
                    echo metadata('item', array('Dublin Core', 'Description'));
                    ?>
 </p>
                    </div>
                    <p>Segment:&nbsp<?php 
                    echo metadata('item', array('Streaming Video', 'Segment Start'));
                    ?>
                    --
                    <?php 
                    echo metadata('item', array('Streaming Video', 'Segment End'));
                    ?>
                    </p>
                    </div> <!-- end of loop div for display -->
                <?php 
                }
                ?>
                <?php 
            }
            ?>
                <hr style="color:lt-gray;"/>
                <?php 
            set_current_record('item', $orig_item);
            ?>
                
                <script type="text/javascript">
                function getElementsByClass(searchClass, domNode, tagName)
                {
                    if (domNode == null) {
                        domNode = document;
                    }
                    if (tagName == null) {
                        tagName = '*';
                    }
                    var el = new Array();
                    var tags = domNode.getElementsByTagName(tagName);
                    var tcl = " "+searchClass+" ";
                    for (i=0,j=0; i<tags.length; i++) {
                        var test = " " + tags[i].className + " ";
                        if (test.indexOf(tcl) != -1) {
                            el[j++] = tags[i];
                        }
                    }
                    return el;
                }
                
                jwplayer("jwplayer_plugin").onTime(function(event){
                    var ctime = "0:00:00";
                    var scenes;
                    var sel;
                    var i = 0;
                    ctime = getTimeString(jwplayer("jwplayer_plugin").getPosition());
                    
                    scenes = getElementsByClass("scene");
                    for (i; i < scenes.length; i++) {
                        sel = scenes[i];
                        if (sel.getAttribute('id') <= ctime && sel.getAttribute('title') >= ctime) {
                            sel.style.display = 'block';
                        } else {
                            sel.style.display = 'none';
                        }
                    }
                }
                );
                </script>
                <?php 
        }
        ?>
            <?php 
    }
Пример #20
0
/**
 * Get a list item for a page, containing a sublist of all its children.
 */
function exhibit_builder_page_summary($exhibitPage = null)
{
    if (!$exhibitPage) {
        $exhibitPage = get_current_record('exhibit_page');
    }
    $html = '<li>' . '<a href="' . exhibit_builder_exhibit_uri(get_current_record('exhibit'), $exhibitPage) . '">' . metadata($exhibitPage, 'title') . '</a>';
    $children = $exhibitPage->getChildPages();
    if ($children) {
        $html .= '<ul>';
        foreach ($children as $child) {
            $html .= exhibit_builder_page_summary($child);
            release_object($child);
        }
        $html .= '</ul>';
    }
    $html .= '</li>';
    return $html;
}
 /**
  * Display the links to the catalogs on the public item page.
  */
 public function hookPublicItemsShow()
 {
     $item = get_current_record('item');
     $subject_full = strip_formatting(metadata($item, array('Dublin Core', 'Subject')));
     $subject_simple = cleanSubjectString($subject_full);
     /* Only display the links if the item has a subject */
     if ($subject_full !== "") {
         echo "<div id='catalog-search' class='element'>";
         echo "<h3>" . __("Catalog Search") . "</h3>";
         echo "<p>" . __("Search for related records in these catalogs:") . "</p>";
         $searches = get_db()->getTable('CatalogSearchSearch')->getAllCatalogSearches();
         foreach ($searches as $search) {
             // Decide whether to use full or simple query terms.
             if ($search->query_type == '0') {
                 $subject_use = $subject_full;
             } elseif ($search->query_type == '1') {
                 $subject_use = $subject_simple;
             }
             // Echo the search link to the catalog.
             echo "<div class='element-text'><a href='" . getCatalogSearchUrl($search->query_string, $subject_use) . "'>" . $search->catalog_name . "</a></div>";
         }
         echo "</div>";
     }
 }
Пример #22
0
<div class="five columns offset-by-two omega">
    <p class="element-set-description">
        <?php 
echo html_escape(@get_current_record('item')->Type->description);
?>
    </p>
</div>
<?php 
echo element_set_form(get_current_record('item'), 'Item Type Metadata');
Пример #23
0
/**
 * Return a tag string given an Item, Exhibit, or a set of tags.
 *
 * @package Omeka\Function\View\Tag
 * @param Omeka_Record_AbstractRecord|array $recordOrTags The record to retrieve
 * tags from, or the actual array of tags
 * @param string|null $link The URL to use for links to the tags (if null, tags
 * aren't linked)
 * @param string $delimiter ', ' (comma and whitespace) is the default tag_delimiter option. Configurable in Settings
 * @return string HTML
 */
function tag_string($recordOrTags = null, $link = 'items/browse', $delimiter = null)
{
    // Set the tag_delimiter option if no delimiter was passed.
    if (is_null($delimiter)) {
        $delimiter = get_option('tag_delimiter') . ' ';
    }
    if (!$recordOrTags) {
        $tags = array();
    } else {
        if (is_string($recordOrTags)) {
            $tags = get_current_record($recordOrTags)->Tags;
        } else {
            if ($recordOrTags instanceof Omeka_Record_AbstractRecord) {
                $tags = $recordOrTags->Tags;
            } else {
                $tags = $recordOrTags;
            }
        }
    }
    if (empty($tags)) {
        return '';
    }
    $tagStrings = array();
    foreach ($tags as $tag) {
        $name = $tag['name'];
        if (!$link) {
            $tagStrings[] = html_escape($name);
        } else {
            $tagStrings[] = '<a href="' . html_escape(url($link, array('tags' => $name))) . '" rel="tag">' . html_escape($name) . '</a>';
        }
    }
    return join(html_escape($delimiter), $tagStrings);
}
Пример #24
0
 /**
  * Print out the COinS span on the admin items browse page.
  */
 public function hookAdminItemsBrowseSimpleEach()
 {
     echo get_view()->coins(get_current_record('item'));
 }
Пример #25
0
 /**
  * Get the url to tiles or a zoomified file, if any.
  *
  * @param object $file
  *
  * @return string
  */
 public function getTileUrl($file = null)
 {
     if ($file == null) {
         $file = get_current_record('file');
     }
     if (empty($file)) {
         return;
     }
     $tileUrl = '';
     // Does it use a IIPImage server?
     if ($this->_creator->useIIPImageServer()) {
         $item = $file->getItem();
         $tileUrl = $item->getElementTexts('Item Type Metadata', 'Tile Server URL');
         $tileUrl = empty($tileUrl) ? '' : $tileUrl[0]->text;
     } elseif (file_exists($this->_creator->getZDataDir($file))) {
         // fetch identifier, to use in link to tiles for this jp2 - pbinkley
         // $jp2 = item('Dublin Core', 'Identifier') . '.jp2';
         // $tileUrl = ZOOMTILES_WEB . '/' . $jp2;
         $tileUrl = $this->_creator->getZDataWeb($file);
     }
     return $tileUrl;
 }
 public function hookPublicCollectionsShow()
 {
     if (get_option(SocialBookmarkingPlugin::ADD_TO_OMEKA_COLLECTIONS_OPTION) == '1') {
         $collection = get_current_record('collection');
         $url = record_url($collection, 'show', true);
         $title = strip_formatting(metadata($collection, array('Dublin Core', 'Title')));
         $description = strip_formatting(metadata($collection, array('Dublin Core', 'Description')));
         echo '<h2>' . __('Social Bookmarking') . '</h2>';
         echo social_bookmarking_toolbar($url, $title, $description);
     }
 }
Пример #27
0
<?php

echo get_current_record('item')->id;
 /**
  * Add viewer markup to public item display pages
  * 
  * @param array $args An array of parameters passed by the hook
  * @return void
  */
 public function hookPublicItemsShow($args)
 {
     $item = get_current_record('Item');
     if (empty($item)) {
         break;
     }
     $profile = $this->_db->getTable('MmdProfile')->getPrimaryAssignedProfile($item);
     if (empty($profile)) {
         return;
     }
     try {
         echo $profile->getBodyHtml();
     } catch (Exception $e) {
         echo "<h3>Error loading viewer</h3><p>" . $e->getMessage() . "</p>";
     }
 }
Пример #29
0
/**
 * Intercept get_theme_option calls to allow theme settings on a per-Exhibit basis.
 *
 * @param string $themeOptions Serialized array of theme options
 * @param string $args Unused here
 */
function exhibit_builder_theme_options($themeOptions, $args)
{
    try {
        if ($exhibit = get_current_record('exhibit', false)) {
            $exhibitThemeOptions = $exhibit->getThemeOptions();
            if (!empty($exhibitThemeOptions)) {
                return serialize($exhibitThemeOptions);
            }
        }
    } catch (Zend_Exception $e) {
        // no view available
    }
    return $themeOptions;
}
Пример #30
0
    $attrs = array('wrapper' => array('id' => 'slider-id', 'class' => 'liquid-slider'));
    echo custom_item_image_gallery($attrs);
}
?>
<!-- Liquid Slider Ends Here -->

<div id="primary">

    <?php 
echo all_element_texts('item');
?>

<div>
<?php 
if (!$item) {
    $item = get_current_record('item');
}
$files = $item->Files;
foreach ($files as $file) {
    if ($file->getExtension() == 'pdf') {
        echo '<iframe width=100% height=800 src="http://deevy.nuim.ie/pdf.js/web/viewer.html?file=http://deevy.nuim.ie/files/original/' . metadata($file, 'filename') . '"></iframe>';
        break;
    }
}
if ($file->getExtension() != 'pdf') {
    fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item));
}
?>
</div>
</div><!-- end primary -->