本文整理汇总了PHP中ResultContext::setAsLastFind方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultContext::setAsLastFind方法的具体用法?PHP ResultContext::setAsLastFind怎么用?PHP ResultContext::setAsLastFind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultContext
的用法示例。
在下文中一共展示了ResultContext::setAsLastFind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Index
public function Index()
{
AssetLoadManager::register('tableList');
$vo_dm = Datamodel::load();
$va_elements = ca_metadata_elements::getRootElementsAsList(null, null, true, true);
$this->view->setVar('element_list', $va_elements);
$this->view->setVar('attribute_types', Attribute::getAttributeTypes());
$o_result_context = new ResultContext($this->request, $this->ops_table_name, 'basic_search');
$o_result_context->setResultList(array_keys($va_elements));
$o_result_context->setAsLastFind();
$o_result_context->saveContext();
return $this->render('elements_list_html.php');
}
示例2: ListDisplays
public function ListDisplays()
{
AssetLoadManager::register('tableList');
$t_display = new ca_bundle_displays();
$this->view->setVar('t_display', $t_display);
$this->view->setVar('display_list', $va_displays = caExtractValuesByUserLocale($t_display->getBundleDisplays(array('user_id' => $this->request->getUserID(), 'access' => __CA_BUNDLE_DISPLAY_EDIT_ACCESS__)), null, null, array()));
$o_result_context = new ResultContext($this->request, 'ca_bundle_displays', 'basic_search');
$o_result_context->setAsLastFind();
$o_result_context->setResultList(is_array($va_displays) ? array_keys($va_displays) : array());
$o_result_context->saveContext();
$this->view->setVar('table_list', caFilterTableList($t_display->getFieldInfo('table_num', 'BOUNDS_CHOICE_LIST')));
$this->render('bundle_display_list_html.php');
}
示例3: ListForms
public function ListForms()
{
AssetLoadManager::register('tableList');
$t_form = new ca_search_forms();
$this->view->setVar('t_form', $t_form);
$this->view->setVar('form_list', $va_forms = caExtractValuesByUserLocale($t_form->getForms(array('user_id' => $this->request->getUserID(), 'access' => __CA_SEARCH_FORM_EDIT_ACCESS__)), null, null, array()));
$o_result_context = new ResultContext($this->request, 'ca_search_forms', 'basic_search');
$o_result_context->setAsLastFind();
$o_result_context->setResultList(is_array($va_forms) ? array_keys($va_forms) : array());
$o_result_context->saveContext();
$this->view->setVar('table_list', caFilterTableList($t_form->getFieldInfo('table_num', 'BOUNDS_CHOICE_LIST')));
$this->render('search_form_list_html.php');
}
示例4: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->opa_views = array('list' => _t('list'), 'editable' => _t('editable'));
$this->opa_sorts = array_merge(array('_natural' => _t('relevance'), 'ca_list_item_labels.name_singular' => _t('name'), 'ca_list_items.idno_sort' => _t('idno')), $this->opa_sorts);
$this->opo_browse = new ListItemBrowse($this->opo_result_context->getParameter('browse_id'), 'providence');
//
// We need to set the same "last find" for ca_lists as well as ca_list_items; here we set
// it for ca_lists... ca_list_items is taken care of automatically by BaseFindController
// because $this->ops_tablename is set to ca_list_items
//
$o_ca_lists_result_context = new ResultContext($po_request, 'ca_lists', $this->ops_find_type);
$o_ca_lists_result_context->setAsLastFind();
$o_ca_lists_result_context->saveContext();
}
示例5: ListSets
public function ListSets()
{
AssetLoadManager::register('tableList');
$o_result_context = new ResultContext($this->request, 'ca_sets', 'basic_search');
$t_set = new ca_sets();
$this->view->setVar('t_set', $t_set);
$vn_user_id = !(bool) $this->request->config->get('ca_sets_all_users_see_all_sets') ? $this->request->getUserID() : null;
if ($this->request->user->canDoAction('is_administrator') || $this->request->user->canDoAction('can_administrate_sets')) {
$ps_mode = $this->request->getParameter('mode', pString);
if (strlen($ps_mode) > 0) {
$pn_mode = (int) $ps_mode;
$o_result_context->setParameter('set_display_mode', $pn_mode);
} else {
$pn_mode = (int) $o_result_context->getParameter('set_display_mode');
}
switch ($pn_mode) {
case 0:
default:
$va_set_list = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'access' => __CA_SET_EDIT_ACCESS__)), null, null, array());
break;
case 1:
$va_set_list = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'allUsers' => true)), null, null, array());
break;
case 2:
$va_set_list = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'publicUsers' => true)), null, null, array());
break;
}
} else {
$va_set_list = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'access' => __CA_SET_EDIT_ACCESS__)), null, null, array());
}
if ($va_set_list) {
foreach ($va_set_list as $id => $va_set) {
$va_set_list[$id]['can_delete'] = $this->UserCanDeleteSet($va_set['user_id']);
}
}
$this->view->setVar('mode', $pn_mode);
$this->view->setVar('set_list', $va_set_list);
// get content types for sets
$this->view->setVar('table_list', caFilterTableList($t_set->getFieldInfo('table_num', 'BOUNDS_CHOICE_LIST')));
$o_result_context->setAsLastFind();
$o_result_context->setResultList(array_keys($va_set_list));
$o_result_context->saveContext();
$this->render('set_list_html.php');
}
示例6: _initView
protected function _initView($pa_options = null)
{
AssetLoadManager::register('bundleableEditor');
AssetLoadManager::register('sortableUI');
AssetLoadManager::register('bundleListEditorUI');
if ($vn_rc = parent::_initView()) {
$t_screen = $this->view->getVar('t_subject');
$this->opn_ui_id = $t_screen->get('ui_id');
$t_ui = new ca_editor_uis($this->opn_ui_id);
$va_screens = $t_ui->getScreens(null, array('showAll' => true));
if (is_array($va_screens)) {
$o_result_context = new ResultContext($this->request, 'ca_editor_ui_screens', 'basic_search');
$o_result_context->setResultList(array_keys($va_screens));
$o_result_context->setAsLastFind();
$o_result_context->saveContext();
}
}
return $vn_rc;
}
示例7: ListUIs
/**
*
*/
public function ListUIs()
{
AssetLoadManager::register('tableList');
$this->checkConfiguration();
$vo_dm = Datamodel::load();
$va_uis = ca_editor_uis::getUIList(null);
foreach ($va_uis as $vs_key => $va_ui) {
if (!($t_instance = $vo_dm->getInstanceByTableNum($va_ui['editor_type'], true))) {
continue;
}
$va_uis[$vs_key]['editor_type'] = $t_instance->getProperty('NAME_PLURAL');
}
$this->view->setVar('editor_ui_list', $va_uis);
$o_result_context = new ResultContext($this->request, $this->ops_table_name, 'basic_search');
$o_result_context->setResultList(array_keys($va_uis));
$o_result_context->setAsLastFind();
$o_result_context->saveContext();
$t_ui = new ca_editor_uis();
$this->view->setVar('table_list', caFilterTableList($t_ui->getFieldInfo('editor_type', 'BOUNDS_CHOICE_LIST')));
return $this->render('ui_list_html.php');
}
示例8: Index
/**
*
*/
function Index()
{
if (!$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'form'));
return;
}
if (!($t_set = $this->_getSet(__CA_SET_READ_ACCESS__))) {
$t_set = new ca_sets();
}
JavascriptLoadManager::register('sortableUI');
# --- get all sets for user
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'user_id' => $this->request->getUserID())));
if (sizeof($va_sets) == 0) {
# --- if there are not any sets for this user, make a new set for them
$t_new_set = new ca_sets();
$vn_new_set_id = null;
$t_new_set->setMode(ACCESS_WRITE);
$t_new_set->set('access', 0);
$t_new_set->set('table_num', 57);
// 57=ca_objects
$t_list = new ca_lists();
$vn_set_id = $t_list->getItemIDFromList('set_types', $this->request->config->get('user_set_type'));
$t_new_set->set('type_id', $vn_set_id);
$t_new_set->set('user_id', $this->request->getUserID());
$t_new_set->set('set_code', $this->request->getUserID() . '_' . time());
$t_new_set->insert();
if (!$t_new_set->numErrors()) {
if ($vn_new_set_id = $t_new_set->getPrimaryKey()) {
global $g_ui_locale_id;
// current locale_id for user
$t_new_set->addLabel(array('name' => _t("Your first lightbox")), $g_ui_locale_id, null, true);
// select the current set
$this->request->user->setVar('current_set_id', $vn_new_set_id);
# --- load new set
$t_set = new ca_sets($vn_new_set_id);
# --- get the sets again so the new set is included
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'user_id' => $this->request->getUserID())));
}
}
}
$t_new_set = new ca_sets();
# --- new set object used for access drop down in new set form
$this->view->setVar('t_set', $t_set);
$this->view->setVar('t_new_set', $t_new_set);
$this->view->setVar('set_list', $va_sets);
$this->view->setVar('set_name', $t_set->getLabelForDisplay());
$this->view->setVar('set_description', $t_set->get("ca_sets.set_intro"));
$this->view->setVar('set_access', $t_set->get("ca_sets.access"));
if ($this->request->config->get("dont_enforce_access_settings")) {
$va_access_values = array();
} else {
$va_access_values = caGetUserAccessValues($this->request);
}
$this->view->setVar('items', $va_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('thumbnail', 'icon'), 'checkAccess' => $va_access_values, 'user_id' => $this->request->getUserID()))));
$va_found_item_ids = array();
foreach ($va_items as $vn_i => $va_item) {
$va_found_item_ids[] = $va_item['row_id'];
}
$t_trans = new ca_commerce_transactions();
$t_trans->load(array('set_id' => $t_set->getPrimaryKey()));
$vn_transaction_id = $t_trans->getPrimaryKey();
$t_comm = new ca_commerce_communications();
$this->view->setVar('messages', $t_comm->getMessages($this->request->getUserID(), array('transaction_id' => $vn_transaction_id)));
$opo_result_context = new ResultContext($this->request, 'ca_objects', 'sets');
$opo_result_context->setResultList($va_found_item_ids);
$opo_result_context->setAsLastFind();
$opo_result_context->saveContext();
# --- use a different view if client services is enabled
if ($this->request->config->get("enable_client_services")) {
$this->render('Sets/client_services_html.php');
} else {
$this->render('Sets/sets_html.php');
}
}
示例9: __call
/**
*
*/
public function __call($ps_function, $pa_args)
{
AssetLoadManager::register("panel");
AssetLoadManager::register("mediaViewer");
AssetLoadManager::register("carousel");
AssetLoadManager::register("readmore");
AssetLoadManager::register("maps");
$ps_function = strtolower($ps_function);
$ps_id = urldecode($this->request->getActionExtra());
if (!isset($this->opa_detail_types[$ps_function]) || !isset($this->opa_detail_types[$ps_function]['table']) || !($vs_table = $this->opa_detail_types[$ps_function]['table'])) {
// invalid detail type – throw error
die("Invalid detail type");
}
$t_table = $this->opo_datamodel->getInstanceByTableName($vs_table, true);
if (($vb_use_identifiers_in_urls = caUseIdentifiersInUrls()) && substr($ps_id, 0, 3) == "id:") {
$va_tmp = explode(":", $ps_id);
$ps_id = (int) $va_tmp[1];
$vb_use_identifiers_in_urls = false;
}
if (!$t_table->load($vb_use_identifiers_in_urls && $t_table->getProperty('ID_NUMBERING_ID_FIELD') ? $t_table->hasField('deleted') ? array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id, 'deleted' => 0) : array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id) : ($t_table->hasField('deleted') ? array($t_table->primaryKey() => (int) $ps_id, 'deleted' => 0) : array($t_table->primaryKey() => (int) $ps_id)))) {
// invalid id - throw error
die("Invalid id");
}
// Printables
// merge displays with drop-in print templates
//
$va_export_options = caGetAvailablePrintTemplates('summary', array('table' => $t_table->tableName()));
$this->view->setVar('export_formats', $va_export_options);
$va_options = array();
foreach ($va_export_options as $vn_i => $va_format_info) {
$va_options[$va_format_info['name']] = $va_format_info['code'];
}
// Get current display list
$t_display = new ca_bundle_displays();
foreach (caExtractValuesByUserLocale($t_display->getBundleDisplays(array('table' => $this->ops_tablename, 'user_id' => $this->request->getUserID(), 'access' => __CA_BUNDLE_DISPLAY_READ_ACCESS__, 'checkAccess' => caGetUserAccessValues($this->request)))) as $va_display) {
$va_options[$va_display['name']] = "_display_" . $va_display['display_id'];
}
ksort($va_options);
$this->view->setVar('export_format_select', caHTMLSelect('export_format', $va_options, array('class' => 'searchToolsSelect'), array('value' => $this->view->getVar('current_export_format'), 'width' => '150px')));
#
# Enforce access control
#
if (sizeof($this->opa_access_values) && $t_table->hasField('access') && !in_array($t_table->get("access"), $this->opa_access_values)) {
$this->notification->addNotification(_t("This item is not available for view"), "message");
$this->response->setRedirect(caNavUrl($this->request, "", "", "", ""));
return;
}
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . $t_table->getTypeName() . ": " . $t_table->get('preferred_labels') . (($vs_idno = $t_table->get($t_table->getProperty('ID_NUMBERING_ID_FIELD'))) ? " [{$vs_idno}]" : ""));
$vs_type = $t_table->getTypeCode();
$this->view->setVar('detailType', $vs_table);
$this->view->setVar('item', $t_table);
$this->view->setVar('itemType', $vs_type);
caAddPageCSSClasses(array($vs_table, $ps_function, $vs_type));
// Do we need to pull in the multisearch result set?
if (ResultContext::getLastFind($this->request, $vs_table, array('noSubtype' => true)) === 'multisearch') {
$o_context = new ResultContext($this->request, $vs_table, 'multisearch', $ps_function);
$o_context->setAsLastFind();
$o_context->saveContext();
} else {
$o_context = ResultContext::getResultContextForLastFind($this->request, $vs_table);
}
$this->view->setVar('previousID', $vn_previous_id = $o_context->getPreviousID($t_table->getPrimaryKey()));
$this->view->setVar('nextID', $vn_next_id = $o_context->getNextID($t_table->getPrimaryKey()));
$this->view->setVar('previousURL', caDetailUrl($this->request, $vs_table, $vn_previous_id));
$this->view->setVar('nextURL', caDetailUrl($this->request, $vs_table, $vn_next_id));
$this->view->setVar('resultsURL', ResultContext::getResultsUrlForLastFind($this->request, $vs_table));
$va_options = isset($this->opa_detail_types[$ps_function]['options']) && is_array($this->opa_detail_types[$ps_function]['options']) ? $this->opa_detail_types[$ps_function]['options'] : array();
$this->view->setVar('previousLink', $vn_previous_id > 0 ? caDetailLink($this->request, caGetOption('previousLink', $va_options, _t('Previous')), '', $vs_table, $vn_previous_id) : '');
$this->view->setVar('nextLink', $vn_next_id > 0 ? caDetailLink($this->request, caGetOption('nextLink', $va_options, _t('Next')), '', $vs_table, $vn_next_id) : '');
$this->view->setVar('resultsLink', ResultContext::getResultsLinkForLastFind($this->request, $vs_table, caGetOption('resultsLink', $va_options, _t('Back'))));
$this->view->setVar('commentsEnabled', (bool) $va_options['enableComments']);
//
//
//
if (method_exists($t_table, 'getPrimaryRepresentationInstance')) {
if ($pn_representation_id = $this->request->getParameter('representation_id', pInteger)) {
$t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
$t_representation->load($pn_representation_id);
} else {
$t_representation = $t_table->getPrimaryRepresentationInstance(array("checkAccess" => $this->opa_access_values));
}
if ($t_representation) {
$this->view->setVar("t_representation", $t_representation);
$this->view->setVar("representation_id", $t_representation->get("representation_id"));
} else {
$t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
}
$this->view->setVar("representationViewer", caObjectDetailMedia($this->request, $t_table->getPrimaryKey(), $t_representation, $t_table, array("primaryOnly" => caGetOption('representationViewerPrimaryOnly', $va_options, false), "dontShowPlaceholder" => caGetOption('representationViewerDontShowPlaceholder', $va_options, false))));
}
//
// map
//
if (!is_array($va_map_attributes = caGetOption('map_attributes', $va_options, array())) || !sizeof($va_map_attributes)) {
if ($vs_map_attribute = caGetOption('map_attribute', $va_options, false)) {
$va_map_attributes = array($vs_map_attribute);
}
}
//.........这里部分代码省略.........
示例10: Index
public function Index()
{
AssetLoadManager::register('bundleableEditor');
$t_comm = new ca_commerce_communications();
$t_user = new ca_users();
$o_result_context = new ResultContext($this->request, 'ca_commerce_communications', 'basic_search_library');
$va_options = array();
$o_db = new Db();
// filtering options
foreach (array('created_on' => 'string', 'search' => 'string', 'user_id' => 'int', 'read_status' => 'string') as $vs_f => $vs_type) {
if (array_key_exists($vs_f, $_REQUEST)) {
$vm_v = $this->request->getParameter($vs_f, pString);
$o_result_context->setParameter('caClientCommunicationList_' . $vs_f, $vm_v);
} else {
$vm_v = $o_result_context->getParameter('caClientCommunicationList_' . $vs_f);
}
switch ($vs_type) {
case 'int':
if (strlen($vm_v)) {
$vm_v = (int) $vm_v;
}
break;
}
if ($vs_f == 'read_status') {
$va_options[$vs_f] = $vm_v;
switch ($vm_v) {
case 'read':
$vs_f = 'readOnly';
$vm_v = true;
break;
case 'unread':
$vs_f = 'unreadOnly';
$vm_v = true;
break;
default:
break;
}
}
if ($vs_f == 'user_id') {
if (!$this->request->getParameter('client_user_id_autocomplete', pString)) {
continue;
}
$o_search = new UserSearch();
$va_labels = caProcessRelationshipLookupLabel($o_search->search("ca_users.user_id:{$vm_v}"), $t_user, array('stripTags' => true));
if (sizeof($va_labels)) {
$va_label = array_pop($va_labels);
$va_options['_user_id_display'] = $va_label['label'];
}
}
if ($vs_f != 'search') {
$t_comm->set($vs_f, $vm_v);
}
$va_options[$vs_f] = $vm_v;
}
if ($pn_transaction_id = $this->request->getParameter('transaction_id', pInteger)) {
// if set load messages for this transaction
$va_options['transaction_id'] = $pn_transaction_id;
}
$this->view->setVar('t_communication', $t_comm);
$this->view->setVar('filter_options', $va_options);
$this->view->setVar('message_list', $t_comm->getMessages($this->request->getUserID(), $va_options));
//$o_result_context->setResultList($va_order_ids);
$o_result_context->setAsLastFind();
$o_result_context->saveContext();
$this->render('list_communications_html.php');
}
示例11: ResultContext
//$this->setVar('tooltip_representation', $qr_hits->getMediaTag('ca_object_representations.media', 'small', array('checkAccess' => $va_access_values)));
//$this->setVar('tooltip_title', $vs_caption);
//$this->setVar('tooltip_idno', $qr_hits->get('idno'));
//TooltipManager::add(
// "#searchThumbnail{$vn_object_id}", $this->render('../Results/ca_objects_result_tooltip_html.php')
//);
$vn_col++;
if ($vn_col > $vn_numCols) {
$vn_col = 1;
}
$va_related_objects[] = $vn_object_id;
}
}
# save object id's in result context
$o_search_result_context = new ResultContext($this->request, "ca_objects", $va_other_params['detail_type']);
$o_search_result_context->setAsLastFind();
if ($va_other_params['entity_id']) {
$o_search_result_context->setParameter("entity_id", $va_other_params['entity_id']);
}
if ($va_other_params['occurrence_id']) {
$o_search_result_context->setParameter("occurrence_id", $va_other_params['occurrence_id']);
}
$o_search_result_context->setResultList($va_related_objects);
$o_search_result_context->saveContext();
?>
<div class="ad_thumbs" <?php
print $vn_numCols == 3 ? "style='width:555px;'" : "";
?>
><div>
<?php
$i = 1;
示例12: Delete
public function Delete()
{
if (!($t_group = $this->getGroupObject())) {
$this->notification->addNotification(_t("You cannot delete this group"), __NOTIFICATION_TYPE_ERROR__);
$this->render('group_list_html.php');
return;
}
if ($this->request->getParameter('confirm', pInteger)) {
$t_group->setMode(ACCESS_WRITE);
$t_group->delete(true);
if ($t_group->numErrors()) {
foreach ($t_group->errors() as $o_e) {
$this->request->addActionError($o_e, 'general');
}
}
$o_result_context = new ResultContext($this->request, 'ca_user_groups', 'basic_search');
$o_result_context->setAsLastFind();
$o_result_context->setResultList(array());
$o_result_context->saveContext();
$this->ListGroups();
return;
} else {
$this->render('group_delete_html.php');
}
}
示例13: setDetail
function setDetail()
{
if (!$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'loginForm'));
return;
}
AssetLoadManager::register("mediaViewer");
$ps_view = $this->request->getParameter('view', pString);
if (!in_array($ps_view, array('thumbnail', 'timeline', 'timelineData', 'pdf'))) {
$ps_view = 'thumbnail';
}
$this->view->setVar('view', $ps_view);
$this->view->setVar('views', $this->opo_config->getAssoc("views"));
if (!($t_set = $this->_getSet(__CA_SET_READ_ACCESS__))) {
$this->Index();
}
$va_set_items = caExtractValuesByUserLocale($t_set->getItems(array("user_id" => $this->request->getUserID(), "thumbnailVersions" => array("medium"), "checkAccess" => $this->opa_access_values)));
$this->view->setVar("set", $t_set);
$this->view->setVar("set_items", $va_set_items);
$va_comments = $t_set->getComments();
$this->view->setVar("comments", $va_comments);
$o_context = new ResultContext($this->request, 'ca_objects', 'sets');
$o_context->setResultList($va_set_ids = $t_set->getItems(array('idsOnly' => true)));
$o_context->saveContext();
$o_context->setAsLastFind();
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Lightbox") . ": " . $t_set->getLabelForDisplay());
switch ($ps_view) {
case 'pdf':
$qr_res = caMakeSearchResult('ca_objects', $va_set_ids);
$this->view->setVar('result', $qr_res);
$this->_genExport($qr_res, '_pdf_checklist', $vs_label = $t_set->get('ca_sets.preferred_labels'), $vs_label);
case 'timelineData':
$this->view->setVar('view', 'timeline');
$this->render("Sets/set_detail_timelineData_json.php");
break;
default:
$this->render("Sets/set_detail_html.php");
break;
}
}
示例14: Index
function Index()
{
$vn_y = $this->ops_date_range;
$va_period_data = array();
//
// Do browse for objects from period; we'll use the facets for related entities, occurrences and list items
// from this browse to generate lists of which have related objects to show from it.
//
$vo_object_browse = new ObjectBrowse();
// we'll do a browse
$vo_object_browse->addCriteria('_search', array('ca_objects.creation_date:"' . $vn_y . '"'));
// criteria is a search for creation date
$vo_object_browse->execute();
// execute the browse
//
// Get events & exhibitions (occurrences)
//
$o_occ_search = new OccurrenceSearch();
$qr_occs = $o_occ_search->search("ca_occurrences.event_date:\"" . $vn_y . "\"", array("sort" => "ca_occurrences.event_date", "no_cache" => !$this->opb_cache_searches, "checkAccess" => $this->opa_access_values));
$va_occ_ids = array();
while ($qr_occs->nextHit()) {
$va_occ_ids[] = $qr_occs->get("ca_occurrences.occurrence_id");
}
$qr_occs->seek(0);
// result context for occ
$o_search_result_context_occ = new ResultContext($this->request, "ca_occurrences", 'chronology');
$o_search_result_context_occ->setAsLastFind();
$o_search_result_context_occ->setResultList($va_occ_ids);
$o_search_result_context_occ->setParameter("period", $this->opn_period);
$o_search_result_context_occ->saveContext();
$va_period_data["occurrences"] = $qr_occs;
// Get list of occurrences that have associated objects *from this period*
$va_related_occs = $vo_object_browse->getFacet('occurrence_facet');
$va_period_data["occurrences_with_objects"] = is_array($va_related_occs) ? array_keys($vo_object_browse->getFacet('occurrence_facet')) : array();
// grab the related occurrences facet to get a list of occurrences with objects; the keys of the returned array are occurrence_ids
//
// Get entity list
//
$o_ent_search = new EntitySearch();
$qr_entities = $o_ent_search->search("ca_entities.arrival_date:\"" . $vn_y . "\"", array("sort" => "ca_entity_labels.surname", "no_cache" => !$this->opb_cache_searches, "checkAccess" => $this->opa_access_values));
$va_entity_ids = array();
while ($qr_entities->nextHit()) {
$va_entity_ids[] = $qr_entities->get("ca_entities.entity_id");
}
$qr_entities->seek(0);
$this->opo_search_result_context_entity->setAsLastFind();
$this->opo_search_result_context_entity->setResultList($va_entity_ids);
$this->opo_search_result_context_entity->setParameter("period", $this->opn_period);
$this->opo_search_result_context_entity->saveContext();
$va_period_data["entities"] = $qr_entities;
$va_related_entities = $vo_object_browse->getFacet('entity_facet');
$va_period_data["entities_with_objects"] = is_array($va_related_entities) ? array_keys($va_related_entities) : array();
// grab the related entities facet to get a list of entities with objects; the keys of the returned array are entity_ids
//
// Get styles/schools (list items) list
//
$o_styles_schools_search = new ListItemSearch();
$qr_styles_schools_search = $o_styles_schools_search->search("ca_list_items.term_date:\"" . $vn_y . "\"", array("sort" => "ca_list_item_labels.name_singular", "no_cache" => !$this->opb_cache_searches, "checkAccess" => $this->opa_access_values));
$va_period_data["styles_schools"] = $qr_styles_schools_search;
$va_related_list_items = $vo_object_browse->getFacet('style');
$va_period_data["list_items_with_objects"] = is_array($va_related_list_items) ? array_keys($va_related_list_items) : array();
// grab the related list items facet to get a list of list items with objects; the keys of the returned array are item_ids
# -- make array of entity_ids so can find places associated with these entities to map
// $va_entities = array();
// if($qr_entities->numHits()){
// while($qr_entities->nextHit()){
// $va_entities[] = $qr_entities->get("entity_id");
// }
// }
// $qr_entities->seek(0);
// $o_place_search = new PlaceSearch();
// $o_place_search->addResultFilter("ca_entities.entity_id", "IN", join(',', $va_entities));
// $qr_places = $o_place_search->search("*", array("no_cache" => !$this->opb_cache_searches, "checkAccess" => $this->opa_access_values));
// $o_map = new GeographicMap(450, 250, 'map');
// $va_map_stats = $o_map->mapFrom($qr_places, "georeference", array("ajaxContentUrl" => caNavUrl($this->request, "eastend", "Chronology", "getMapItemInfo"), "request" => $this->request, "checkAccess" => $this->opa_access_values));
// $va_period_data["map"] = $o_map->render('HTML', array('delimiter' => "<br/>"));
// $va_period_data["places"] = $qr_places;
$o_obj_search = new ObjectSearch();
$qr_objects = $o_obj_search->search("ca_objects.creation_date:\"" . $vn_y . "\" AND (ca_object.object_status:349 OR ca_object.object_status:347 OR ca_object.object_status:193)", array("sort" => "ca_objects.creation_date", "no_cache" => !$this->opb_cache_searches, "checkAccess" => $this->opa_access_values));
$va_period_data["objects"] = $qr_objects;
$va_object_ids = array();
while ($qr_objects->nextHit()) {
$va_object_ids[] = $qr_objects->get("ca_objects.object_id");
}
$qr_objects->seek(0);
$this->opo_result_context->setAsLastFind();
$this->opo_result_context->setResultList($va_object_ids);
$this->opo_result_context->setParameter("period", $this->opn_period);
$this->opo_result_context->saveContext();
$this->view->setVar('period_data', $va_period_data);
$this->render('chronology_period_html.php');
}
示例15: setDetail
function setDetail()
{
if (!$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'loginForm'));
return;
}
AssetLoadManager::register("mediaViewer");
$o_context = new ResultContext($this->request, 'ca_objects', 'sets', 'lightbox');
$o_context->setAsLastFind();
$this->view->setVar('browse', $o_browse = caGetBrowseInstance("ca_objects"));
$this->view->setVar("browse_type", "caLightbox");
# --- this is only used when loading hierarchy facets and is a way to get around needing a browse type to pull the table in FindController
$ps_view = $this->request->getParameter('view', pString);
if (!in_array($ps_view, array('thumbnail', 'timeline', 'timelineData', 'pdf', 'list'))) {
$ps_view = 'thumbnail';
}
$this->view->setVar('view', $ps_view);
$this->view->setVar('views', $this->opo_config->getAssoc("views"));
if (!($t_set = $this->_getSet(__CA_SET_READ_ACCESS__))) {
$this->Index();
}
$vn_set_id = $t_set->get("set_id");
$this->view->setVar("set", $t_set);
$va_comments = $t_set->getComments();
$this->view->setVar("comments", $va_comments);
//
// Load existing browse if key is specified
//
if ($ps_cache_key = $this->request->getParameter('key', pString)) {
$o_browse->reload($ps_cache_key);
}
//
// Clear criteria if required
//
if ($vs_remove_criterion = $this->request->getParameter('removeCriterion', pString)) {
$o_browse->removeCriteria($vs_remove_criterion, array($this->request->getParameter('removeID', pString)));
}
if ((bool) $this->request->getParameter('clear', pInteger)) {
// Clear all refine critera but *not* underlying _search criterion
$va_criteria = $o_browse->getCriteria();
foreach ($va_criteria as $vs_criterion => $va_criterion_info) {
if ($vs_criterion == '_search') {
continue;
}
$o_browse->removeCriteria($vs_criterion, array_keys($va_criterion_info));
}
}
if ($this->request->getParameter('getFacet', pInteger)) {
$vs_facet = $this->request->getParameter('facet', pString);
$this->view->setVar('facet_name', $vs_facet);
$this->view->setVar('key', $o_browse->getBrowseID());
$va_facet_info = $o_browse->getInfoForFacet($vs_facet);
$this->view->setVar('facet_info', $va_facet_info);
# --- pull in different views based on format for facet - alphabetical, list, hierarchy
switch ($va_facet_info["group_mode"]) {
case "alphabetical":
case "list":
default:
$this->view->setVar('facet_content', $o_browse->getFacetContent($vs_facet, array("checkAccess" => $this->opa_access_values)));
$this->render("Browse/list_facet_html.php");
break;
case "hierarchical":
$this->render("Browse/hierarchy_facet_html.php");
break;
}
return;
}
//
// Add criteria and execute
//
$vs_search_expression = "ca_sets.set_id:{$vn_set_id}";
if ($o_browse->numCriteria() == 0 && $vs_search_expression) {
$o_browse->addCriteria("_search", array($vs_search_expression));
}
if ($vs_facet = $this->request->getParameter('facet', pString)) {
$o_browse->addCriteria($vs_facet, array($this->request->getParameter('id', pString)));
}
//
// Sorting
//
$vb_sort_changed = false;
if (!($ps_secondary_sort = $this->request->getParameter("secondary_sort", pString))) {
$ps_secondary_sort = $o_context->getCurrentSecondarySort();
}
$va_config_sort = $this->opo_config->getAssoc("sortBy");
if (!is_array($va_config_sort)) {
$va_config_sort = array();
}
$va_sort_by = array_merge(array(_t('Set order') => "ca_set_items.rank/{$vn_set_id}"), $va_config_sort);
if (!($ps_sort = urldecode($this->request->getParameter("sort", pString)))) {
if (!$ps_sort && !($ps_sort = $o_context->getCurrentSort())) {
if (is_array($va_sort_by)) {
$ps_sort = array_shift(array_keys($va_sort_by));
$vb_sort_changed = true;
}
}
} else {
$vb_sort_changed = true;
}
if ($vb_sort_changed) {
//.........这里部分代码省略.........