本文整理汇总了PHP中ca_objects::getPreferredDisplayLabelsForIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getPreferredDisplayLabelsForIDs方法的具体用法?PHP ca_objects::getPreferredDisplayLabelsForIDs怎么用?PHP ca_objects::getPreferredDisplayLabelsForIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getPreferredDisplayLabelsForIDs方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recentlyAdded
function recentlyAdded()
{
// redirect user if not logged in
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
} elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
}
$t_object = new ca_objects();
$va_recently_added_objects = $t_object->getRecentlyAddedItems(25, array('checkAccess' => caGetUserAccessValues($this->request)));
$va_entries = array();
$va_object_ids = array();
foreach ($va_recently_added_objects as $va_object) {
$va_object_ids[] = $va_object['object_id'];
}
$va_labels = $t_object->getPreferredDisplayLabelsForIDs($va_object_ids);
// TODO: Need to get object descriptions and last update times properly
foreach ($va_labels as $vn_object_id => $vs_label) {
$va_entries[] = array('title' => $vs_label, 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => time(), 'description' => '', 'pubDate' => time());
}
$va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
$o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
$this->view->setVar('feed', $o_feed);
$this->render('Feed/feed_recently_added_xml.php');
}
示例2: caGetUserAccessValues
*
* ----------------------------------------------------------------------
*/
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"];
# $vn_padding_top = 0;
示例3: array
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured_obj->get("access"), $va_access_values)) {
$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>
示例4: 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
}
示例5: 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());
}
//.........这里部分代码省略.........
示例6: 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');
}
示例7: getFulfillmentLog
/**
* Returns a list of fulfillment events for the currently loaded order
*
* @param array $pa_options An array of options (none supported yet)
* @return array A list of arrays, each containing information about a specific fulfillment event. The list is ordered by date/time starting with the oldest event.
*/
public function getFulfillmentLog($pa_options = null)
{
if (!($vn_order_id = $this->getPrimaryKey())) {
return null;
}
$o_db = $this->getDb();
$qr_res = $o_db->query("\n\t\t\tSELECT e.*, i.*, o.idno item_idno\n\t\t\tFROM ca_commerce_fulfillment_events e \n\t\t\tINNER JOIN ca_commerce_order_items AS i ON i.item_id = e.item_id\n\t\t\tINNER JOIN ca_objects AS o ON o.object_id = i.object_id\n\t\t\tWHERE \n\t\t\t\te.order_id = ?\n\t\t\tORDER BY e.occurred_on\n\t\t", (int) $vn_order_id);
$t_object = new ca_objects();
$va_labels = $t_object->getPreferredDisplayLabelsForIDs($qr_res->getAllFieldValues("object_id"));
$t_item = new ca_commerce_order_items();
$va_events = array();
$qr_res->seek(0);
$va_user_cache = array();
while ($qr_res->nextRow()) {
$va_row = $qr_res->getRow();
$va_row['fulfillment_details'] = caUnserializeForDatabase($va_row['fulfillment_details']);
$va_row['item_label'] = $va_labels[$va_row['object_id']];
$va_row['fulfillment_method_display'] = $t_item->getChoiceListValue('fullfillment_method', $va_row['fullfillment_method']);
$va_row['service_display'] = $t_item->getChoiceListValue('service', $va_row['service']);
if ($vn_user_id = (int) $va_row['fulfillment_details']['user_id']) {
if (!isset($va_user_cache[$vn_user_id])) {
$t_user = new ca_users($vn_user_id);
if ($t_user->getPrimaryKey()) {
$va_user_cache[$vn_user_id] = array('fname' => $t_user->get('fname'), 'lname' => $t_user->get('lname'), 'email' => $t_user->get('email'));
} else {
$va_user_cache[$vn_user_id] = null;
}
}
if (is_array($va_user_cache[$vn_user_id])) {
$va_row = array_merge($va_row, $va_user_cache[$vn_user_id]);
}
}
$va_events[] = $va_row;
}
return $va_events;
}