Esempio n. 1
0
function sckls_random_featured_item()
{
    $html = '';
    $items = get_records('Item', array('featured' => true, 'sort_field' => 'random'), 1);
    set_loop_records('items', $items);
    if (has_loop_records('items')) {
        foreach (loop('items') as $item) {
            $html .= '<a href="' . record_url($item, null, true) . '" class="featured">';
            $html .= '    <h6 class="header-label">Featured Item</h6>';
            $html .= '    <div class="overlay"></div>';
            $image = $item->Files;
            if ($image) {
                $html .= '<div style="background-image: url(' . file_display_url($image[0], 'fullsize') . ');" class="img"></div>';
            } else {
                $html .= '<div style="background-image: url(' . img('*****@*****.**') . ');" class="img default"></div>';
            }
            $html .= '    <span class="title">' . metadata('item', array('Dublin Core', 'Title')) . '</span>';
            $html .= '</a>';
        }
    } else {
        $html .= '<h4 class="not-featured">No featured items.</h4>';
    }
    return $html;
}
        echo html_escape(url('collections/add'));
        ?>
" class="small green button">
            <?php 
        echo __('Add a Collection');
        ?>
        </a>
    <?php 
    }
    ?>
    </div>
    <?php 
    echo pagination_links();
    ?>
    <?php 
    if (has_loop_records('collections')) {
        ?>
        <table id="collections" cellspacing="0" cellpadding="0">
            <thead>
                <tr>
                <?php 
        $sortLinks = array(__('Title') => 'Dublin Core,Title', __('Contributors') => null, __('Date Added') => 'added', __('Total Number of Items') => null);
        ?>
                <?php 
        echo browse_sort_links($sortLinks, array('link_tag' => 'th scope="col"', 'list_tag' => ''));
        ?>
                </tr>
            </thead>
            <tbody>
                <?php 
        $key = 0;
    echo __('Credits');
    ?>
</h3>
    <p><?php 
    echo $exhibitCredits;
    ?>
</p>
</div>
<?php 
}
?>
</div>

<?php 
set_exhibit_pages_for_loop_by_exhibit();
if (has_loop_records('exhibit_page')) {
    ?>
<nav id="exhibit-pages">
    <ul>
        <?php 
    foreach (loop('exhibit_page') as $exhibitPage) {
        ?>
        <?php 
        echo exhibit_builder_page_summary($exhibitPage);
        ?>
        <?php 
    }
    ?>
    </ul>
</nav>
<?php 
Esempio n. 4
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 
    }
echo head($head);
?>

<?php 
echo flash();
?>

<a class="add-page button small green" href="<?php 
echo html_escape(url('catalog-search/index/add'));
?>
"><?php 
echo __('Add a Search');
?>
</a>
<?php 
if (!has_loop_records('catalog_search_search')) {
    ?>
    <p><?php 
    echo __('There are no searches.');
    ?>
 <a href="<?php 
    echo html_escape(url('catalog-search/index/add'));
    ?>
"><?php 
    echo __('Add a search.');
    ?>
</a></p>
<?php 
} else {
    ?>
<table class="full">
Esempio n. 6
0
</div>
<?php 
}
?>

<div class="homepage-recent">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="content-block">
                    <h5 class="header-label">What's New</h6>

					<?php 
$homepageRecentItems = '6';
set_loop_records('items', get_recent_items($homepageRecentItems));
if (has_loop_records('items')) {
    ?>
					                        <div class="items-list slider">
					                        <?php 
    foreach (loop('items') as $item) {
        ?>
					                            <?php 
        $image = $item->Files;
        ?>
					                            <?php 
        if ($image) {
            ?>
					                            <div class="item">
												<?php 
            echo '  <a href="' . record_url($item, null, true) . '">';
            echo '    <div class="overlay"></div>';
Esempio n. 7
0
function mh_display_random_item($num = 1)
{
    echo $num <= 1 ? '<h2>Random ' . mh_item_label() . '</h2>' : '<h2>Random ' . mh_item_label('plural') . '</h2>';
    set_loop_records('items', get_random_featured_items($num, true));
    if (has_loop_records('items')) {
        foreach (loop('items') as $item) {
            echo '<article class="item-result">';
            echo '<h3>' . link_to_item(metadata($item, array('Dublin Core', 'Title'))) . '</h3>';
            echo '<div class="item-thumb">' . link_to_item(item_image('square_thumbnail')) . '</div>';
            if ($desc = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 200))) {
                echo '<div class="item-description">' . $desc . '</div>';
            } else {
                echo '<div class="item-description">Text preview unavailable.</div>';
            }
            echo '</article>';
        }
    }
    echo '<p class="view-more-link">' . link_to_items_browse('View all ' . mh_item_label('plural') . '') . '</p>';
}
Esempio n. 8
0
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @copyright Center for History and New Media, 2010
 * @package Contribution
 */
contribution_admin_header(array(__('Contributors')));
?>


<?php 
echo $this->partial('contribution-navigation.php');
?>

<div id="primary">
<?php 
echo flash();
if (!has_loop_records('contribution_contributors')) {
    echo '<p>No one has contributed to the site yet.</p>';
} else {
    ?>
    <div class="pagination"><?php 
    echo pagination_links();
    ?>
</div>
    <table>
        <thead id="types-table-head">
            <tr>
                <th><?php 
    echo __('ID');
    ?>
</th>
                <th><?php 
Esempio n. 9
0
 /**
  * Check if there are data for search.
  *
  * @return boolean
  *   True if there are data for search, else false.
  */
 public function hasDataForSearch()
 {
     if (empty($this->_item)) {
         return;
     }
     set_loop_records('files', $this->_item->getFiles());
     if (has_loop_records('files')) {
         foreach (loop('files') as $file) {
             if (strtolower($file->getExtension()) == 'xml') {
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 10
0
</a>
    </li>
</ul>
<?php 
echo flash();
?>

<a class="add-page button small green" href="<?php 
echo html_escape(url('simple-pages/index/add'));
?>
"><?php 
echo __('Add a Page');
?>
</a>
<?php 
if (!has_loop_records('simple_pages_page')) {
    ?>
    <p><?php 
    echo __('There are no pages.');
    ?>
 <a href="<?php 
    echo html_escape(url('simple-pages/index/add'));
    ?>
"><?php 
    echo __('Add a page.');
    ?>
</a></p>
<?php 
} else {
    ?>
    <?php 
Esempio n. 11
0
        ?>
" class="small green button">
            <?php 
        echo __('Add a Report');
        ?>
        </a>
    <?php 
    }
    ?>
    </div>
    <div class="pagination"><?php 
    echo pagination_links();
    ?>
</div>
    <?php 
    if (has_loop_records('reports_reports')) {
        ?>
        <table id="reports" cellspacing="0" cellpadding="0">
            <thead>
                <tr>
                <?php 
        $sortLinks = array(__('ID') => 'id', __('Name') => 'name', __('Creator') => 'creator', __('Date Modified') => 'modified', __('Items') => null, __('Filter') => null, __('Generate a New File') => null);
        ?>
                <?php 
        echo browse_sort_links($sortLinks, array('link_tag' => 'th scope="col"', 'list_tag' => ''));
        ?>
                </tr>
            </thead>
            <tbody>
                <?php 
        $key = 0;