本文整理汇总了PHP中ca_sets::getAttributeFromSets方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_sets::getAttributeFromSets方法的具体用法?PHP ca_sets::getAttributeFromSets怎么用?PHP ca_sets::getAttributeFromSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_sets
的用法示例。
在下文中一共展示了ca_sets::getAttributeFromSets方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Index
public function Index()
{
$va_access_values = caGetUserAccessValues($this->request);
// get sets for public display
$t_list = new ca_lists();
$vn_public_set_type_id = $t_list->getItemIDFromList('set_types', $t_list->getAppConfig()->get('simpleGallery_set_type'));
$t_set = new ca_sets();
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'access' => __CA_SET_READ_ACCESS__, 'user_id' => $this->request->getUserID())));
$va_set_first_items = $t_set->getFirstItemsFromSets(array_keys($va_sets), array("version" => "widepreview", "checkAccess" => $va_access_values));
$va_set_descriptions = $t_set->getAttributeFromSets($this->opo_plugin_config->get('set_description_element_code'), array_keys($va_sets), array("checkAccess" => $va_access_values));
$va_set_date = $t_set->getAttributeFromSets('setdate', array_keys($va_sets), array("checkAccess" => $va_access_values));
$va_set_creator = $t_set->getAttributeFromSets('setcreator', array_keys($va_sets), array("checkAccess" => $va_access_values));
$this->view->setVar('sets', $va_sets);
$this->view->setVar('first_items_from_sets', $va_set_first_items);
$this->view->setVar('set_descriptions', $va_set_descriptions);
$this->view->setVar('set_date', $va_set_date);
$this->view->setVar('set_creator', $va_set_creator);
$this->render($this->ops_theme . '/landing_html.php');
}
示例2: Index
public function Index()
{
$va_access_values = caGetUserAccessValues($this->request);
// get sets for public display
$t_list = new ca_lists();
$vn_set_type_id = $t_list->getItemIDFromList('set_types', $t_list->getAppConfig()->get('exhibits_set_type'));
$t_set = new ca_sets();
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_occurrences', 'access' => $va_access_values, 'setType' => $vn_set_type_id)));
$va_set_first_items = $t_set->getFirstItemsFromSets(array_keys($va_sets), array("checkAccess" => $va_access_values));
$va_set_descriptions = $t_set->getAttributeFromSets($this->opo_plugin_config->get('set_description_element_code'), array_keys($va_sets), array("checkAccess" => $va_access_values));
$this->view->setVar('sets', $va_sets);
$this->view->setVar('first_items_from_sets', $va_set_first_items);
$this->view->setVar('set_descriptions', $va_set_descriptions);
$this->render('Exhibits/landing_html.php');
}
示例3: 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');
}
示例4: count
<!--
<h2>Highlights from the Collection</h2>
<?php
$t_featured = new ca_sets();
$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('preview', 'preview170'), 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"]["preview"], 'featured_content_label' => $set_title, 'featured_content_description' => $set_desc[$set_id][0], 'featured_set_id' => $set_id);
}
}
?>
<?php
if (isset($featured_set_id_array)) {
?>
<table class="featured-list" cell-padding="0" cell-spacing="0">
<tr>