本文整理汇总了PHP中ca_objects::getPrimaryMediaForIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getPrimaryMediaForIDs方法的具体用法?PHP ca_objects::getPrimaryMediaForIDs怎么用?PHP ca_objects::getPrimaryMediaForIDs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getPrimaryMediaForIDs方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: caGetUserAccessValues
* http://www.CollectiveAccess.org
*
* ----------------------------------------------------------------------
*/
JavascriptLoadManager::register("cycle");
$t_object = new ca_objects();
$va_access_values = caGetUserAccessValues($this->request);
$t_featured = new ca_sets();
$t_featured->load(array('set_code' => $this->request->config->get('featured_set_name')));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured->get("access"), $va_access_values)) {
$va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
// These are the object ids in the set
}
$va_item_ids = $va_featured_ids;
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("mediumlarge", "widepreview", "splashpic"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
$title_id = array_shift(array_keys($va_item_media));
$t_object = new ca_objects($title_id);
$va_artist_name = $t_object->get('ca_entities.preferred_labels.displayname', array('restrictToRelationshipTypes' => array('artist'), 'delimiter' => ' and '));
?>
<h1 class='results'>Featured Art: <?php
print $va_artist_name;
?>
</h1>
<div style="height:25px;width:100%"></div>
<!-- <div id="hpFeatured">-->
<?php
# foreach ($va_item_media as $vn_object_id => $va_media) {
# $vs_image_tag = $va_media["tags"]["mediumlarge"];
示例2: caGetUserAccessValues
require_once __CA_MODELS_DIR__ . "/ca_sets.php";
include_once __CA_LIB_DIR__ . "/ca/Search/OccurrenceSearch.php";
include_once __CA_MODELS_DIR__ . "/ca_occurrences.php";
$va_access_values = caGetUserAccessValues($this->request);
if ($vs_set_code = $this->request->config->get("featured_art_set")) {
AssetLoadManager::register("carousel");
$t_set = new ca_sets();
$t_set->load(array('set_code' => $vs_set_code));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
$va_item_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
}
if (is_array($va_item_ids) && sizeof($va_item_ids)) {
$t_object = new ca_objects();
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("slideshowsmall"), array('checkAccess' => caGetUserAccessValues($this->request)));
}
}
?>
<div class="container">
<div class="row collection">
<div class="col-sm-6">
<div class="advSearch">
<h1>Search Collection</h1>
{{{form}}}
<div class="advancedSearchField">
Title:<br/>
{{{ca_objects.preferred_labels.name%width=220px}}}
</div>
<div class="advancedSearchField">
示例3: array
$vn_featured_set_id = $t_featured_obj->get("set_id");
$va_featured_ids = array_keys(is_array($va_tmp = $t_featured_obj->getItemRowIDs(array('checkAccess' => $va_access_values, 'limit' => 1))) ? $va_tmp : array());
// These are the object ids in the set
}
if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) {
$t_object = new ca_objects($va_featured_ids[0]);
$va_rep = $t_object->getPrimaryRepresentation(array('widepreview'), null, array('return_with_access' => $va_access_values));
$feat_obj_content_id = $va_featured_ids[0];
$feat_obj_content_widepreview = $va_rep["tags"]["widepreview"];
$vs_featured_content_label = $t_object->getLabelForDisplay();
}
# --- Recently Added
# --- get the 12 most recently added objects to display
$va_recently_added_items = $t_object->getRecentlyAddedItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_recently_added_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_recently_added_items), array('small', 'thumbnail', 'preview', 'widepreview'), array("checkAccess" => $va_access_values));
foreach ($va_recently_added_items as $vn_object_id => $va_object_info) {
$va_object_info['title'] = $va_labels[$vn_object_id];
$va_object_info['media'] = $va_media[$vn_object_id];
$va_recently_added_objects[$vn_object_id] = $va_object_info;
}
#$this->view->setVar('recently_added_objects', $va_recently_added_objects);
if (is_array($va_recently_added_objects) && sizeof($va_recently_added_objects) > 0) {
$va_object_info = array_shift($va_recently_added_objects);
$recently_added_id = $va_object_info['object_id'];
$recently_added_widepreview = $va_media[$va_object_info['object_id']]["tags"]["widepreview"];
}
?>
<div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;">
<a href="#" onclick="caUIBrowsePanel.hideBrowsePanel()" class="browseSelectPanelButton"></a>
<div id="splashBrowsePanelContent">
示例4: array
*
* CollectiveAccess is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* This source code is free and modifiable under the terms of
* GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
* the "license.txt" file for details, or visit the CollectiveAccess web site at
* http://www.CollectiveAccess.org
*
* ----------------------------------------------------------------------
*/
require_once __CA_MODELS_DIR__ . "/ca_entities.php";
$t_object = new ca_objects();
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("frontpage"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
if ($this->request->config->get("dont_enforce_access_settings")) {
$va_access_values = array();
} else {
$va_access_values = caGetUserAccessValues($this->request);
}
# --- set for share your knowledge box - set name assigned in app.conf - featured_share_set_name
$t_featured_share = new ca_sets();
$t_featured_share->load(array('set_code' => $this->request->config->get('featured_share_set_name')));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured_share->get("access"), $va_access_values)) {
$vn_featured_share_set_id = $t_featured_share->get("set_id");
$va_featured_share_ids = array_keys(is_array($va_tmp = $t_featured_share->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
// These are the object ids in the set
}
示例5: caGetUserAccessValues
?>
<div id="frontPage" class="subhomeslide">
<?php
$va_access_values = caGetUserAccessValues($this->request);
$this->config = caGetFrontConfig();
if ($vs_set_code = $this->config->get("front_page_set_code_CJF")) {
$t_set = new ca_sets();
$t_set->load(array('set_code' => $vs_set_code));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
$va_item_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
}
}
if (is_array($va_item_ids) && sizeof($va_item_ids)) {
$t_object = new ca_objects();
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("mediumlarge"), array('checkAccess' => $va_access_values));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
}
if (is_array($va_item_media) && sizeof($va_item_media)) {
?>
<div class="jcarousel-wrapper slidecontainer">
<!-- Carousel -->
<div class="jcarousel">
<ul>
<?php
foreach ($va_item_media as $vn_object_id => $va_media) {
print "<li>" . caDetailLink($this->request, $va_media["tags"]["mediumlarge"], '', 'ca_objects', $vn_object_id) . "</li>";
}
?>
</ul>
示例6: array
* ----------------------------------------------------------------------
*/
require_once __CA_MODELS_DIR__ . '/ca_objects.php';
$va_facets = $this->getVar('available_facets');
$va_facets_with_content = $this->getVar('facets_with_content');
$va_facet_info = $this->getVar('facet_info');
$va_criteria = is_array($this->getVar('criteria')) ? $this->getVar('criteria') : array();
$va_results = $this->getVar('result');
$vs_browse_target = $this->getVar('target');
$t_object = new ca_objects();
$va_random_items = $t_object->getRandomItems(10, array('checkAccess' => $this->getVar('access_values'), 'hasRepresentations' => 1));
$va_labels = array();
$va_media = array();
if (is_array($va_random_items) && sizeof($va_random_items)) {
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('medium'), array('checkAccess' => $this->getVar('access_values')));
}
JavascriptLoadManager::register('cycle');
?>
<div id="pageBody">
<?php
if (!$this->request->isAjax()) {
if ($this->getVar('browse_selector')) {
?>
<div class="browseTargetSelect"><?php
print _t('Browse for') . ' ' . $this->getVar('browse_selector');
?>
</div>
<?php
}
?>
示例7: caNavUrl
* the terms of the provided license as published by Whirl-i-Gig
*
* CollectiveAccess is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* This source code is free and modifiable under the terms of
* GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
* the "license.txt" file for details, or visit the CollectiveAccess web site at
* http://www.CollectiveAccess.org
*
* ----------------------------------------------------------------------
*/
$t_object = new ca_objects();
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("medium"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
?>
<div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;">
<a href="#" onclick="caUIBrowsePanel.hideBrowsePanel()" class="browseSelectPanelButton"></a>
<div id="splashBrowsePanelContent">
</div>
</div>
<script type="text/javascript">
var caUIBrowsePanel = caUI.initBrowsePanel({ facetUrl: '<?php
print caNavUrl($this->request, '', 'Browse', 'getFacet');
?>
'});
</script>
示例8: Index
function Index($pa_options = null)
{
// Remove any browse criteria previously set
$this->opo_browse->removeAllCriteria();
parent::Index(array('dontRenderView' => true));
JavascriptLoadManager::register('imageScroller');
JavascriptLoadManager::register('browsable');
JavascriptLoadManager::register('tabUI');
JavascriptLoadManager::register('cycle');
$t_object = new ca_objects();
$t_featured = new ca_sets();
if ($this->request->config->get("dont_enforce_access_settings")) {
$va_access_values = array();
} else {
$va_access_values = caGetUserAccessValues($this->request);
}
$va_default_versions = array('thumbnail', 'icon', 'small', 'preview', 'medium', 'preview', 'widepreview');
# --- featured items set - set name assigned in app.conf
$t_featured->load(array('set_code' => $this->request->config->get('featured_set_name')));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured->get("access"), $va_access_values)) {
$this->view->setVar('featured_set_id', $t_featured->get("set_id"));
$va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
// These are the object ids in the set
}
if (!is_array($va_featured_ids) || sizeof($va_featured_ids) == 0) {
# put a random object in the features variable
$va_featured_ids = array_keys($t_object->getRandomItems(10, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)));
}
$t_object = new ca_objects($va_featured_ids[0]);
$va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'medium', 'mediumlarge', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values));
$this->view->setVar('featured_content_id', $va_featured_ids[0]);
$this->view->setVar('featured_content_thumb', $va_rep["tags"]["thumbnail"]);
$this->view->setVar('featured_content_small', $va_rep["tags"]["small"]);
$this->view->setVar('featured_content_mediumlarge', $va_rep["tags"]["mediumlarge"]);
$this->view->setVar('featured_content_medium', $va_rep["tags"]["medium"]);
$this->view->setVar('featured_content_preview', $va_rep["tags"]["preview"]);
$this->view->setVar('featured_content_widepreview', $va_rep["tags"]["widepreview"]);
$this->view->setVar('featured_content_label', $t_object->getLabelForDisplay());
$this->view->setVar('featured_content_slideshow_id_list', $va_featured_ids);
if (!(bool) $this->request->config->get("splash_disable_highest_rated_objects")) {
if (!is_array($va_versions = $this->request->config->getList("splash_highest_rated_display_versions"))) {
$va_versions = $va_default_versions;
}
# --- user favorites get the highest ranked objects to display
$va_user_favorites_items = $t_object->getHighestRated(true, 12, $va_access_values);
if (sizeof($va_user_favorites_items) > 0) {
if (is_array($va_user_favorites_items) && sizeof($va_user_favorites_items) > 0) {
$t_object = new ca_objects($va_user_favorites_items[0]);
$va_rep = $t_object->getPrimaryRepresentation($va_versions, null, array('return_with_access' => $va_access_values));
$this->view->setVar('user_favorites_id', $va_user_favorites_items[0]);
foreach ($va_versions as $vs_version) {
$this->view->setVar('user_favorites_' . $vs_version, $va_rep['tags'][$vs_version]);
}
}
} else {
$this->view->setVar('user_favorites_is_random', 1);
# if no ranks set, choose a random object
$va_random_items = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), $va_versions, array("checkAccess" => $va_access_values));
foreach ($va_random_items as $vn_object_id => $va_object_info) {
$va_object_info['title'] = $va_labels[$vn_object_id];
$va_object_info['media'] = $va_media[$vn_object_id];
$va_random_items[$vn_object_id] = $va_object_info;
}
$this->view->setVar('random_objects', $va_random_items);
if (is_array($va_random_items) && sizeof($va_random_items) > 0) {
$va_object_info = reset($va_random_items);
$this->view->setVar('user_favorites_id', $va_object_info['object_id']);
foreach ($va_versions as $vs_version) {
$this->view->setVar('user_favorites_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]);
}
}
}
}
if (!(bool) $this->request->config->get("splash_disable_recently_added_objects")) {
if (!is_array($va_versions = $this->request->config->getList("splash_recently_added_display_versions"))) {
$va_versions = $va_default_versions;
}
# --- get the 12 most recently added objects to display
$va_recently_added_items = $t_object->getRecentlyAddedItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_recently_added_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_recently_added_items), $va_versions, array("checkAccess" => $va_access_values));
foreach ($va_recently_added_items as $vn_object_id => $va_object_info) {
$va_object_info['title'] = $va_labels[$vn_object_id];
$va_object_info['media'] = $va_media[$vn_object_id];
$va_recently_added_objects[$vn_object_id] = $va_object_info;
}
$this->view->setVar('recently_added_objects', $va_recently_added_objects);
if (is_array($va_recently_added_objects) && sizeof($va_recently_added_objects) > 0) {
$va_object_info = reset($va_recently_added_objects);
$this->view->setVar('recently_added_id', $va_object_info['object_id']);
foreach ($va_versions as $vs_version) {
$this->view->setVar('recently_added_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]);
}
}
} else {
$this->view->setVar('recently_added_objects', array());
}
//.........这里部分代码省略.........
示例9: foreach
$va_results = $this->getVar('result');
$vs_browse_target = $this->getVar('target');
$t_object = new ca_objects();
$t_featured = new ca_sets();
$featured_set = $t_featured->load(array('set_code' => 'carousel'));
$set_item = $t_featured->getItems();
foreach ($set_item as $id => $item) {
foreach ($item as $i_d => $the_item) {
$carousel_ids[] = $the_item['object_id'];
}
}
shuffle($carousel_ids);
$qr_set = ca_objects::createResultSet($carousel_ids);
$va_random_items = $t_object->getRandomItems(10, array('checkAccess' => $this->getVar('access_values'), 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('small', 'thumbnail', 'preview', 'medium', 'widepreview'), array('checkAccess' => $this->getVar('access_values')));
JavascriptLoadManager::register('cycle');
if (!$this->request->isAjax()) {
?>
<h1><?php
print _t('Browse the Archive');
?>
</h1>
<div id="browse"><div id="resultBox">
<?php
}
?>
<div style="position: relative;">
<?php
if (sizeof($va_criteria)) {
//
示例10: array
* the terms of the provided license as published by Whirl-i-Gig
*
* CollectiveAccess is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* This source code is free and modifiable under the terms of
* GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
* the "license.txt" file for details, or visit the CollectiveAccess web site at
* http://www.CollectiveAccess.org
*
* ----------------------------------------------------------------------
*/
$t_object = new ca_objects();
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("hpFeatured"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
$qr_hits = ca_objects::createResultSet($va_item_ids);
$va_item_captions = array();
$va_item_vaga = array();
$va_item_do_not_show = array();
if ($qr_hits->numHits()) {
while ($qr_hits->nextHit()) {
# --- vaga/ARS no image - remove from slideshow
if ($qr_hits->get("ca_objects.object_status") == 348) {
$va_item_do_not_show[$qr_hits->get("ca_objects.object_id")] = 1;
}
$vs_caption = "";
if ($qr_hits->get("ca_objects.object_status") == 349) {
$vs_caption = "<a href='http://www.vagarights.com' target='_blank'>" . $qr_hits->get("ca_objects.caption") . "</a>";
$va_item_vaga[$qr_hits->get("ca_objects.object_id")] = 1;
示例11: array
if ($vn_num_items) {
?>
<div class="steps">1</div>
<h1><?php
print _t('Review The Items In Your Order');
?>
</h1>
<div class="bg">
<?php
$va_item_object_ids = array();
foreach ($va_items as $va_item) {
$va_item_object_ids[] = $va_item['object_id'];
}
$t_object = new ca_objects();
$va_object_reps = $t_object->getPrimaryMediaForIDs($va_item_object_ids, array('thumbnail'));
?>
<div>
<?php
print "<b>" . _t("Total cost") . ":</b> " . $vs_currency_symbol . $t_order->getTotal();
?>
<?php
print " (" . ($vn_num_items == 1 ? _t('%1 item', $vn_num_items) : _t('%1 items', $vn_num_items)) . ")";
?>
</div>
<?php
$vn_i = 0;
foreach ($va_items as $va_item) {
$vn_i++;
?>
<div class="caClientOrderCustomerFormItem"<?php
示例12: Index
function Index()
{
// Remove any browse criteria previously set
$this->opo_browse->removeAllCriteria();
parent::Index(true);
JavascriptLoadManager::register('imageScroller');
JavascriptLoadManager::register('browsable');
JavascriptLoadManager::register('tabUI');
$t_object = new ca_objects();
$t_featured = new ca_sets();
if ($this->request->config->get("dont_enforce_access_settings")) {
$va_access_values = array();
} else {
$va_access_values = caGetUserAccessValues($this->request);
}
# --- featured items set - set name assigned in app.conf
$featured_sets = $this->request->config->get('featured_sets');
$len = count($featured_sets);
if ($len > 3) {
$len = 3;
}
for ($i = 0; $i < $len; $i++) {
$t_featured->load(array('set_code' => $featured_sets[$i]));
$set_id = $t_featured->getPrimaryKey();
$set_title = $t_featured->getLabelForDisplay();
$set_desc = $t_featured->getAttributeFromSets('description', array(0 => $set_id));
$va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
// These are the object ids in the set
if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) {
$t_object = new ca_objects($va_featured_ids[0]);
$va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'medium', 'mediumlarge', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values));
$featured_set_id_array[$i] = array('featured_set_code' => $featured_sets[$i], 'featured_content_id' => $va_featured_ids[0], 'featured_content_small' => $va_rep["tags"]["small"], 'featured_content_label' => $set_title, 'featured_content_description' => $set_desc[$set_id][0], 'featured_set_id' => $set_id);
}
}
$this->view->setVar('featured_set_id_array', $featured_set_id_array);
# --- user favorites get the highest ranked objects to display
$va_user_favorites_items = $t_object->getHighestRated(true, 12, $va_access_values);
if (sizeof($va_user_favorites_items) > 0) {
if (is_array($va_user_favorites_items) && sizeof($va_user_favorites_items) > 0) {
$t_object = new ca_objects($va_user_favorites_items[0]);
$va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values));
$this->view->setVar('user_favorites_id', $va_user_favorites_items[0]);
$this->view->setVar('user_favorites_thumb', $va_rep["tags"]["thumbnail"]);
$this->view->setVar('user_favorites_small', $va_rep["tags"]["small"]);
$this->view->setVar('user_favorites_preview', $va_rep["tags"]["preview"]);
$this->view->setVar('user_favorites_widepreview', $va_rep["tags"]["widepreview"]);
}
} else {
$this->view->setVar('user_favorites_is_random', 1);
# if no ranks set, choose a random object
$va_random_items = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('small', 'thumbnail', 'preview', 'medium', 'widepreview'), array("checkAccess" => $va_access_values));
foreach ($va_random_items as $vn_object_id => $va_object_info) {
$va_object_info['title'] = $va_labels[$vn_object_id];
$va_object_info['media'] = $va_media[$vn_object_id];
$va_random_items[$vn_object_id] = $va_object_info;
}
$this->view->setVar('random_objects', $va_random_items);
if (is_array($va_random_items) && sizeof($va_random_items) > 0) {
$va_object_info = array_shift($va_random_items);
$this->view->setVar('user_favorites_id', $va_object_info['object_id']);
$this->view->setVar('user_favorites_thumb', $va_media[$va_object_info['object_id']]["tags"]["thumbnail"]);
$this->view->setVar('user_favorites_small', $va_media[$va_object_info['object_id']]["tags"]["small"]);
$this->view->setVar('user_favorites_preview', $va_media[$va_object_info['object_id']]["tags"]["preview"]);
$this->view->setVar('user_favorites_widepreview', $va_media[$va_object_info['object_id']]["tags"]["widepreview"]);
$this->view->setVar('user_favorites_medium', $va_media[$va_object_info['object_id']]["tags"]["medium"]);
}
}
#---- new 'recently added'
$t_set = new ca_sets();
$ra_set_code = $this->request->config->get('recently_added_set_id');
$t_set->load(array('set_code' => $ra_set_code));
$set_id = $t_set->getPrimaryKey();
$ra_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('thumbnail', 'preview'), "checkAccess" => 1)));
$va_recently_added = array();
foreach ($ra_items as $va_item_info) {
$vn_r_object_id = $va_item_info['object_id'];
$t_object->load($vn_r_object_id);
$va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
$va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"];
}
# --- get the 12 most recently added objects to display
/*$va_recently_added_ids = $t_object->getRecentlyAddedItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
if(is_array($va_recently_added_ids) && sizeof($va_recently_added_ids) > 0){
$va_recently_added = array();
foreach($va_recently_added_ids as $va_item_info){
$vn_r_object_id = $va_item_info['object_id'];
$t_object->load($vn_r_object_id);
$va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
$va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"];
}
}*/
$this->view->setVar('recently_added', $va_recently_added);
$this->render('Splash/splash_html.php');
}
示例13: array
}
if (is_array($va_item_ids) && sizeof($va_item_ids)) {
$t_object = new ca_objects();
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("slideshowsmall"), array('checkAccess' => caGetUserAccessValues($this->request)));
}
}
if ($vs_set_code = $this->request->config->get("new_library_set")) {
$t_set_new = new ca_sets();
$t_set_new->load(array('set_code' => $vs_set_code));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set_new->get("access"), $va_access_values)) {
$va_item_new_ids = array_keys(is_array($va_tmp = $t_set_new->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
}
if (is_array($va_item_ids) && sizeof($va_item_ids)) {
$t_object_new = new ca_objects();
$va_item_new_media = $t_object_new->getPrimaryMediaForIDs($va_item_new_ids, array("thumbnail"), array('checkAccess' => caGetUserAccessValues($this->request)));
}
}
?>
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php
if (is_array($va_item_media) && sizeof($va_item_media)) {
?>
<div class="jcarousel-wrapper">
<!-- Carousel -->
<div class="jcarousel">
<ul>
<?php
示例14: caNavUrl
* the terms of the provided license as published by Whirl-i-Gig
*
* CollectiveAccess is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* This source code is free and modifiable under the terms of
* GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
* the "license.txt" file for details, or visit the CollectiveAccess web site at
* http://www.CollectiveAccess.org
*
* ----------------------------------------------------------------------
*/
$t_object = new ca_objects();
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("medium"), array('checkAccess' => array(1)));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
?>
<div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;">
<div id="splashBrowsePanelContent">
</div>
</div>
<script type="text/javascript">
var caUIBrowsePanel = caUI.initBrowsePanel({ facetUrl: '<?php
print caNavUrl($this->request, '', 'Browse', 'getFacet');
?>
'});
</script>
<div id="hpPageArea">