function sckls_random_featured_collection()
{
    $html = '';
    $collection = get_db()->getTable('Collection')->findRandomFeatured();
    if ($collection) {
        set_current_record('collection', $collection);
        $html .= '<a href="' . record_url($collection, null, true) . '" class="featured">';
        $html .= '    <h6 class="header-label">Featured Collection</h6>';
        $html .= '    <div class="overlay"></div>';
        $items = get_records('Item', array('collection' => $collection->id), 8);
        set_loop_records('items', $items);
        if (has_loop_records('items')) {
            $image = $items[0]->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>';
            }
        } else {
            $html .= '<div style="background-image: url(' . img('*****@*****.**') . ');" class="img default"></div>';
        }
        $html .= '    <span class="title">' . metadata('collection', array('Dublin Core', 'Title')) . '</span>';
        $html .= '</a>';
    } else {
        $html .= '<h4 class="not-featured">No featured collections.</h4>';
    }
    return $html;
}
Beispiel #2
0
/**
 * Compile item metadata for the lazy-loaded `item_body` record attribute.
 *
 * @param Item $item The parent item.
 * @param NeatlineRecord|null $record The record.
 * @return string The item metadata.
 */
function nl_getItemMarkup($item, $record = null)
{
    // Set the item on the view.
    set_current_record('item', $item);
    if (!is_null($record)) {
        // Get exhibit slug and tags.
        $slug = $record->getExhibit()->slug;
        $tags = nl_explode($record->tags);
        // First, try to render an exhibit-specific `item-[tag].php` template.
        foreach ($tags as $tag) {
            try {
                return get_view()->render('exhibits/themes/' . $slug . '/item-' . $tag . '.php');
            } catch (Exception $e) {
            }
        }
        // Next, try to render an exhibit-specific `item.php` template.
        try {
            return get_view()->render('exhibits/themes/' . $slug . '/item.php');
        } catch (Exception $e) {
        }
    }
    // Default to the global `item.php` template, which is included in the
    // core plugin and can also be overridden in the public theme:
    return get_view()->render('exhibits/item.php');
}
 /**
  * Tests that all_element_texts behaves the same when an item is
  * set on the view and when it is directly passed.
  */
 public function testWithNoItemOnView()
 {
     $item = new Item();
     $item->item_type_id = 1;
     $metadataOutput = all_element_texts($item, array('return_type' => 'array'));
     set_current_record('item', $item, true);
     // Compare runs with and without item set on view, they should be
     // the same.
     $this->assertEquals($metadataOutput, all_element_texts('item', array('return_type' => 'array')));
 }
Beispiel #4
0
 /**
  * Creates a test Item and returns a citation string.
  *
  * @todo This function, like Item::getCitation(), uses date() to generate a date
  * accessed for the citation. This should be changed when we
  * internationalize date outputs.
  *
  * @param string|null The Item title.
  * @param string|null The Item creator.
  * @return string The Item's citation string.
  */
 protected function _createItemCitationString($title = null, $creator = null)
 {
     $elementTexts = array('Dublin Core' => array('Title' => array(array('text' => $title, 'html' => false)), 'Creator' => array(array('text' => $creator, 'html' => false))));
     $item = new Item();
     $item->addElementTextsByArray($elementTexts);
     $item->save();
     set_current_record('item', $item, true);
     $siteTitle = option('site_title');
     $dateAccessed = format_date(time(), Zend_Date::DATE_LONG);
     $itemUrl = record_url('item', null, true);
     $citationHtml = "&#8220;{$title},&#8221; <em>{$siteTitle}</em>, accessed {$dateAccessed}, {$itemUrl}.";
     if ($creator) {
         $citationHtml = "{$creator}, {$citationHtml}";
     }
     return $citationHtml;
 }
 public function tourJsonifier($tour)
 {
     // Add enumarations of the ordered items in this tour.
     $items = array();
     foreach ($tour->Items as $item) {
         set_current_record('item', $item);
         $location = get_db()->getTable('Location')->findLocationByItem($item, true);
         // If it has a location, we'll build the itemMetadata array and push it to items
         if ($location) {
             $item_metadata = array('id' => $item->id, 'title' => metadata('item', array('Dublin Core', 'Title')), 'latitude' => $location['latitude'], 'longitude' => $location['longitude']);
             array_push($items, $item_metadata);
         }
     }
     // Create the array of data
     $tour_metadata = array('id' => $tour->id, 'title' => $tour->title, 'description' => $tour->description, 'items' => $items);
     return $tour_metadata;
 }
Beispiel #6
0
function rhythm_display_random_featured_item_squarethumb()
{
    $featuredItems = get_random_featured_items(1);
    $featuredItem = $featuredItems[0];
    $html = '<h2>Featured <span class="type-featured">Item</span></h2>';
    if ($featuredItem) {
        set_current_record('item', $featuredItem);
        // Needed for transparent access of item metadata.
        if (metadata('item', 'has thumbnail')) {
            $html .= link_to_item(item_square_thumbnail(), array('class' => 'image'));
        }
        // Grab the 1st Dublin Core description field (first 150 characters)
        $itemDescription = metadata('item', array('Dublin Core', 'Description'), array('snippet' => 150));
        $html .= '<p><span class="title">' . link_to_item() . '</span>&nbsp;&nbsp;&nbsp;' . $itemDescription . '</p>';
    } else {
        $html .= '<p>No featured items are available.</p>';
    }
    return $html;
}
Beispiel #7
0
 protected function itemToRSS($item)
 {
     $entry = array();
     set_current_record('item', $item, true);
     // Title is a CDATA section, so no need for extra escaping.
     $entry['title'] = strip_formatting(metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)));
     $entry['description'] = $this->buildDescription($item);
     $entry['link'] = xml_escape(record_url($item, null, true));
     $entry['lastUpdate'] = strtotime($item->added);
     //List the first file as an enclosure (only one per RSS feed)
     if (($files = $item->Files) && ($file = current($files))) {
         $entry['enclosure'] = array();
         $fileDownloadUrl = file_display_url($file);
         $enc['url'] = $fileDownloadUrl;
         $enc['type'] = $file->mime_type;
         $enc['length'] = (int) $file->size;
         $entry['enclosure'][] = $enc;
     }
     return $entry;
 }
Beispiel #8
0
function get_first_collection_images()
{
    if (metadata('collection', 'total_items') > 0) {
        /* find child items  */
        $collectionId = metadata('collection', 'id');
        $childArray = get_child_collections($collectionId);
        $thumbnailCount = 0;
        $childCount = 0;
        while ($thumbnailCount <= 3) {
            $childID = $childArray[$childCount]['id'];
            set_current_record('collection', get_record_by_id('collection', $childID));
            while (loop('items') and $thumbnailCount <= 3) {
                echo item_thumbnail();
                $thumbnailCount++;
            }
            $childCount++;
        }
    } else {
        while (loop('items', 4)) {
            echo item_thumbnail();
        }
        return $html;
    }
}
    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 
    }
<?php

if (!array_key_exists('timeline-id', $options)) {
    return;
}
$timeline = get_record_by_id('NeatlineTimeTimeline', $options['timeline-id']);
if (!$timeline) {
    return;
}
set_current_record('neatline_time_timeline', $timeline);
echo $this->partial('timelines/_timeline.php');
Beispiel #11
0
$currentPage = get_current_record('exhibit page');
?>
        <?php 
set_exhibit_pages_for_loop_by_exhibit();
?>
        <?php 
foreach (loop('exhibit_page') as $exhibitPage) {
    ?>
        <?php 
    echo emiglio_exhibit_builder_page_nav($exhibitPage, $currentPageId);
    ?>
        <?php 
}
?>
        <?php 
set_current_record('exhibit page', $currentPage);
?>
        </ul>
    </nav>
</div>

<div id="exhibit-page-navigation">
    <?php 
if ($prevLink = exhibit_builder_link_to_previous_page()) {
    ?>
    <div id="exhibit-nav-prev">
    <?php 
    echo $prevLink;
    ?>
    </div>
    <?php 
Beispiel #12
0
            );
        }
    });


    <?php 
}
// end canProtect()
?>

});
</script>

<?php 
$page_id = $this->doc->getId();
set_current_record('item', get_record_by_id('item', $page_id));
$collection = get_collection_for_item();
$collection_link = link_to_collection_for_item();
if (strpos($this->file['original_filename'], "/full/full/0/default.jpg")) {
    $iiif_id = str_replace("/full/full/0/default.jpg", "", $this->file['original_filename']);
} else {
    $iiif_id = str_replace("/full/90,/0/default.jpg", "", $this->file['original_filename']);
}
?>

<?php 
$base_Dir = basename(getcwd());
?>

<?php 
if (!is_admin_theme()) {
	  <?php 
echo public_nav_tours();
?>
	</nav>	
	<div class="pagination bottom"><?php 
echo pagination_links();
?>
</div>

    <?php 
if (has_tours()) {
    if (has_tours_for_loop()) {
        $i = 1;
        $tourimg = 0;
        foreach ($tours as $tour) {
            set_current_record('tour', $tour);
            $tourdesc = nls2p(tour('description'));
            echo '<article id="item-result-' . $i . '" class="item-result">';
            echo '<h3>' . link_to_tour() . '</h3>';
            if ($i <= 10) {
                echo display_tour_thumb(get_tour_by_id(tour('id')), 0, $userDefined = null);
                $tourimg++;
            }
            echo '<div class="item-description"><p>' . snippet($tourdesc, 0, 300) . '</p></div>';
            echo '</article>';
            $i++;
        }
    }
}
?>
	
<?php

/*
This is a hack.  
Apparently, $this !== get_view().
So $this->simplePage != get_view()->simplePage 
So when the subsequent helper functions try to get the current simple page, they would not find them, 
Unless we explicitly set the current simple page.
If you try to fix this, see simple_pages_display_hierarchy, especially the call to get_view()->partial
*/
set_current_record('simple_pages_page', $this->simple_pages_page);
?>

<p><a href="<?php 
echo html_escape(record_url($simple_pages_page));
?>
">
<?php 
echo metadata('simple_pages_page', 'title');
?>
</a> 
 (<?php 
echo metadata('simple_pages_page', 'slug');
?>
)<br/> 
 <?php 
echo __('<strong>%1$s</strong> on %2$s', html_escape(metadata('simple_pages_page', 'modified_username')), html_escape(format_date(metadata('simple_pages_page', 'updated'), Zend_Date::DATETIME_SHORT)));
?>
 <a class="edit" href="<?php 
echo html_escape(record_url($simple_pages_page, 'edit'));
?>
        ?>
</h3>
    <div style="overflow:auto; max-height:150px;">
        <p><?php 
        echo $segmentDescription;
        ?>
</p>
    </div>
    <p><?php 
        echo __('Segment: %s - %s', $segmentStart, $segmentEnd);
        ?>
</p>
</div>
    <?php 
    }
    set_current_record('item', $orig_item);
    ?>
<hr style="color:lt-gray;" />
<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 + " ";
		   <div id="tour-description">
		    <?php 
echo nls2p(tour('Description'));
?>
		   </div>
		</section>
		   
		<section id="tour-items">
			<h3 class="locations">Locations for <?php 
echo $label;
?>
</h3>
	         <?php 
$i = 1;
foreach ($tour->getItems() as $tourItem) {
    set_current_record('item', $tourItem);
    $itemID = $tourItem->id;
    ?>
		         <article class="item-result">
			         <h3><?php 
    echo $i . '.';
    ?>
 <a href="<?php 
    echo url('/');
    ?>
items/show/<?php 
    echo $itemID . '?tour=' . tour('id') . '&index=' . ($i - 1) . '';
    ?>
">
			         <?php 
    echo metadata($tourItem, array('Dublin Core', 'Title'));
 <div id="recent-items">

<h2><?php 
echo __('Items in the Collection');
?>
</h2>
    <ul class="items-list">
        <?php 
asort($collections);
?>
        <?php 
foreach ($collections as $collection) {
    ?>
            <?php 
    set_current_record('collection', $collection);
    ?>
             <?php 
    if (metadata($collection, 'total_items') > 0) {
        ?>
            <?php 
        $cid = metadata($collection, 'id');
        set_loop_records('items', get_item_obj(array('sort_field' => 'random', 'collection' => $cid, 'type' => 'Text')), 1);
        ?>
            <?php 
        foreach (loop('items') as $item) {
            ?>
                <li class="item">
                    <?php 
            if (metadata('item', 'has thumbnail')) {
                ?>
                        <?php 
Beispiel #18
0
<?php

if (!array_key_exists('neatline-id', $options)) {
    return;
}
$neatline = get_record_by_id('NeatlineExhibit', $options['neatline-id']);
if (!$neatline) {
    return;
}
set_current_record('neatline_exhibit', $neatline);
?>
<iframe src="<?php 
echo nl_getExhibitUrl($neatline, "fullscreen");
?>
" seamless>
</iframe>
Beispiel #19
0
    </thead>
    <tbody>
        <?php 
    $filter = new Zend_Filter_Word_CamelCaseToDash();
    ?>
        <?php 
    foreach (loop('search_texts') as $searchText) {
        ?>
        <?php 
        $record = get_record_by_id($searchText['record_type'], $searchText['record_id']);
        ?>
        <?php 
        $recordType = $searchText['record_type'];
        ?>
        <?php 
        set_current_record($recordType, $record);
        ?>
        <tr class="<?php 
        echo strtolower($filter->filter($recordType));
        ?>
">

            <td>
                <div id="title-search-cell">
                    <?php 
        if ($recordImage = record_image($recordType, 'square_thumbnail')) {
            ?>
                        <?php 
            echo link_to($record, 'show', $recordImage, array('class' => 'image'));
            ?>
                    <?php 
 /**
  * This tests that we can iterate over mixed coverages.
  *
  * This is a work-around for this spec no longer working, due to O2's 
  * popping up a new window when you click "View Public Page." Technically, 
  * this test should have been a unittest all along, but having it as a 
  * feature keep the planning cleaner.
  *
  *  @kml
  *  @file_fixture @javascript
  *  Scenario: Mixed Feature Coverages
  *    Given I am logged into the admin console
  *    And I replace "themes/default/items/show.php" with "plugins/NeatlineFeatures/features/data/show-display-coverage-test.php"
  *    And I click "Add a new item"
  *    And I enter "Cucumber: Test Iterate Mixed Feature Coverages" for the "Elements-50-0-text"      # Title
  *    And I enter "Iterate Mixed Feature Coverages" for the "Elements-49-0-text"      # Subject
  *    And I click "Use Map" checkbox in "#Elements-38-0-widget"
  *    And I draw a line on "div#Elements-38-0-map.olMap"
  *    And I click "add_element_38"
  *    And I wait 15 seconds
  *    And I enter "UVa" into "Elements-38-1-free"
  *    And I click on "Add Item"
  *    And I click "Test Iterate Mixed Feature Coverages"
  *    When I click "View Public Page"
  *    Then I should see the following output in unordered list "#item-coverage":
  *      | true  |
  *      | false |
  *
  * @return void
  * @author Eric Rochester
  **/
 public function testTestMixedFeatureCoverage()
 {
     $table = $this->db->getTable('NeatlineFeature');
     $utils = new NeatlineFeatures_Utils_View();
     $utils->setCoverageElement();
     $item = new Item();
     $item->save();
     $this->toDelete($item);
     $this->_addElementTextDelete($item, $this->_title, "Unittest: Display All Feature Coverages", 1);
     $this->_addFeature($utils, $table, $item, "<kml xmlns=\"http://earth.google.com/kml/2.0\"><Folder><name>OpenLayers export</name><description>Exported on Thu Mar 07 2013 11:18:43 GMT-0500 (EST)</description><Placemark><name>OpenLayers.Feature.Vector_158</name><description>No description available</description><Polygon><outerBoundaryIs><LinearRing><coordinates>-10194865.083145,4313188.6314755 -9803507.4983789,3295658.9110849 -9744803.8606641,5017632.2840536 -10194865.083145,4313188.6314755</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><name>OpenLayers.Feature.Vector_182</name><description>No description available</description><LineString><coordinates>-8003262.6084573,5487261.3857724 -10097025.686953,6269976.5553037 -10958012.373438,4724114.0954794</coordinates></LineString></Placemark><Placemark><name>OpenLayers.Feature.Vector_194</name><description>No description available</description><LineString><coordinates>-10958012.373438,4724114.0954794 -10488383.271719,3119547.9979404</coordinates></LineString></Placemark></Folder></kml>|3|-9490421.4305667|3972279.4853711|osm\ncoverage a", 0);
     $this->_addElementTextDelete($item, $this->_coverage, "Charlottesville, VA", 1);
     $this->dispatch('/');
     set_current_record('item', $item);
     $covs = metadata('item', array('Dublin Core', 'Coverage'), array('all' => true, 'no_filter' => true, 'no_escape' => true));
     $this->assertCount(2, $covs);
     $this->assertTrue(NeatlineFeatures_Functions::isKmlCoverage($covs[0]));
     $this->assertFalse(NeatlineFeatures_Functions::isKmlCoverage($covs[1]));
 }
    <div id="description" class="element">
        <div class="element-text"><?php 
echo metadata('collection', array('Dublin Core', 'Description'));
?>
</div>
    </div><!-- end description -->

    <div id="collection-items span12">

        <ul class="thumbnails">
        <?php 
$collection_items = get_records('Item', array('collection' => $collection['id'], 'sort_field' => 'Scripto,Weight', 'sort_dir' => 'a'), 999);
set_loop_records('items', $collection_items);
foreach (loop('items') as $item) {
    set_current_record('item', $item);
    if (metadata($item, 'has thumbnail')) {
        ?>
            <li>
                <div id="col-images" class="thumbnail right-caption span4">
                    <?php 
        echo link_to_item(item_image('square_thumbnail', array('alt' => metadata($item, array('Dublin Core', 'Title')), 'class' => 'span2')));
        ?>
                    <div class="caption">
                        <?php 
        echo link_to_item(metadata($item, array('Dublin Core', 'Title'), array('snippet' => 60)), array('class' => 'permalink'));
        ?>
<br /><br />
                        <div id="col-progress">
                            <?php 
        // Set statuses.
Beispiel #22
0
 public function testLinkToItemWithCurrentItem()
 {
     set_current_record('item', $this->item);
     $linkToItemHtml = '<a href="/items/show/1">' . Installer_Test::TEST_ITEM_TITLE . '</a>';
     $this->assertEquals($linkToItemHtml, link_to_item());
 }