本文整理汇总了PHP中set_current_record函数的典型用法代码示例。如果您正苦于以下问题:PHP set_current_record函数的具体用法?PHP set_current_record怎么用?PHP set_current_record使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_current_record函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sckls_random_featured_collection
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('[email protected]') . ');" class="img default"></div>';
}
} else {
$html .= '<div style="background-image: url(' . img('[email protected]') . ');" 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;
}
开发者ID:pyscajor,项目名称:cornishmemory-omeka,代码行数:28,代码来源:functions.php
示例2: nl_getItemMarkup
/**
* 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');
}
开发者ID:saden1,项目名称:Neatline,代码行数:32,代码来源:Views.php
示例3: testWithNoItemOnView
/**
* 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')));
}
开发者ID:emhoracek,项目名称:Omeka,代码行数:14,代码来源:AllElementTextsTest.php
示例4: _createItemCitationString
/**
* 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 = "“{$title},” <em>{$siteTitle}</em>, accessed {$dateAccessed}, {$itemUrl}.";
if ($creator) {
$citationHtml = "{$creator}, {$citationHtml}";
}
return $citationHtml;
}
开发者ID:kwiliarty,项目名称:Omeka,代码行数:27,代码来源:ItemCitationTest.php
示例5: tourJsonifier
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;
}
开发者ID:ebellempire,项目名称:MobileJSON_gardens,代码行数:17,代码来源:TourJsonifier.php
示例6: rhythm_display_random_featured_item_squarethumb
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> ' . $itemDescription . '</p>';
} else {
$html .= '<p>No featured items are available.</p>';
}
return $html;
}
开发者ID:SBUtltmedia,项目名称:omeka-neatline,代码行数:19,代码来源:custom.php
示例7: itemToRSS
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;
}
开发者ID:lchen01,项目名称:STEdwards,代码行数:20,代码来源:ItemRss2.php
示例8: get_first_collection_images
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;
}
}
开发者ID:AdrienneSerra,项目名称:Digitalsc,代码行数:24,代码来源:custom.php
示例9: append
//.........这里部分代码省略.........
?>
<?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: <?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
}
开发者ID:wmcowan,项目名称:VideoStream,代码行数:101,代码来源:VideoStreamPlugin.php
示例10: get_record_by_id
<?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');
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:11,代码来源:layout.php
示例11: get_current_record
$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
开发者ID:sgbalogh,项目名称:peddler_clone4,代码行数:31,代码来源:show.php
示例12: set_current_record
);
}
});
<?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()) {
开发者ID:pulibrary,项目名称:Scribe,代码行数:31,代码来源:transcribe.php
示例13: public_nav_tours
<?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++;
}
}
}
?>
开发者ID:ebellempire,项目名称:curatescape_gardens,代码行数:30,代码来源:browse.php
示例14: get_view
<?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'));
?>
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:browse-hierarchy-page.php
示例15: __
?>
</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 + " ";
开发者ID:Daniel-KM,项目名称:VideoStream,代码行数:31,代码来源:video-stream-current.php
示例16: nls2p
<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'));
开发者ID:ebellempire,项目名称:curatescape_gardens,代码行数:31,代码来源:show.php
示例17: __
<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
开发者ID:AdrienneSerra,项目名称:plugin_NALShortcodes,代码行数:31,代码来源:collection-item.php
示例18: get_record_by_id
<?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>
开发者ID:saden1,项目名称:Neatline,代码行数:16,代码来源:layout.php
示例19: Zend_Filter_Word_CamelCaseToDash
</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
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:31,代码来源:index.php
示例20: testTestMixedFeatureCoverage
/**
* 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]));
}
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:49,代码来源:NeatlineFeatures_Helpers_View_Test.php
注:本文中的set_current_record函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论