本文整理汇总了PHP中ResultContext::getPreviousID方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultContext::getPreviousID方法的具体用法?PHP ResultContext::getPreviousID怎么用?PHP ResultContext::getPreviousID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultContext
的用法示例。
在下文中一共展示了ResultContext::getPreviousID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Show
//.........这里部分代码省略.........
$qr_hits = $this->opo_browse->getResults($va_sort);
$vn_num_pages = ceil($qr_hits->numHits() / $vn_items_per_page);
$qr_hits->seek(($vn_p - 1) * $vn_items_per_page);
} else {
$vn_num_pages = 0;
}
$this->view->setVar('browse_results', $qr_hits);
$this->view->setVar('num_pages', (int) $vn_num_pages);
$this->view->setVar('items_per_page', (int) $vn_items_per_page);
$this->view->setVar('opo_browse', $this->opo_browse);
$this->view->setVar('sorts', $this->opa_sorts);
// supported sorts for the object browse
// browse criteria in an easy-to-display format
$va_browse_criteria = array();
foreach ($this->opo_browse->getCriteriaWithLabels() as $vs_facet_code => $va_criteria) {
$va_facet_info = $this->opo_browse->getInfoForFacet($vs_facet_code);
$va_criteria_list = array();
foreach ($va_criteria as $vn_criteria_id => $vs_criteria_label) {
$va_criteria_list[] = $vs_criteria_label;
}
$va_browse_criteria[$va_facet_info['label_singular']] = join('; ', $va_criteria_list);
}
$this->view->setVar('browse_criteria', $va_browse_criteria);
} else {
// not configured for browse
$this->request->session->setVar($this->ops_tablename . '_' . $this->ops_appname . '_detail_current_browse_id', null);
$this->view->setVar('show_browse', false);
}
}
$this->request->session->setVar($this->ops_tablename . '_' . $this->ops_appname . '_detail_current_item_id', $vn_item_id);
# Next and previous navigation
$opo_result_context = new ResultContext($this->request, $this->ops_tablename, ResultContext::getLastFind($this->request, $this->ops_tablename));
$this->view->setVar('next_id', $opo_result_context->getNextID($vn_item_id));
$this->view->setVar('previous_id', $opo_result_context->getPreviousID($vn_item_id));
# Is the item we're show details for in the result set?
$this->view->setVar('is_in_result_list', $opo_result_context->getIndexInResultList($vn_item_id) != '?');
# Item instance and id
$this->view->setVar('t_item', $t_item);
$this->view->setVar($t_item->getPrimaryKey(), $vn_item_id);
# Item - preferred
$this->view->setVar('label', $t_item->getLabelForDisplay());
# Item - nonpreferred
$this->view->setVar('nonpreferred_labels', caExtractValuesByUserLocale($t_item->getNonPreferredLabels()));
# Item timestamps (creation and last change)
if ($va_entry_info = $t_item->getCreationTimestamp()) {
$this->view->setVar('date_of_entry', date('m/d/Y', $va_entry_info['timestamp']));
}
if ($va_last_change_info = $t_item->getLastChangeTimestamp()) {
$this->view->setVar('date_of_last_change', date('m/d/Y', $va_last_change_info['timestamp']));
}
# Media representations to display (objects only)
if (method_exists($t_item, 'getPrimaryRepresentationInstance')) {
if ($t_primary_rep = $t_item->getPrimaryRepresentationInstance()) {
if (!sizeof($va_access_values) || in_array($t_primary_rep->get('access'), $va_access_values)) {
// check rep access
$this->view->setVar('t_primary_rep', $t_primary_rep);
$va_rep_display_info = caGetMediaDisplayInfo('detail', $t_primary_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
$this->view->setVar('primary_rep_display_version', $va_rep_display_info['display_version']);
unset($va_display_info['display_version']);
$va_rep_display_info['poster_frame_url'] = $t_primary_rep->getMediaUrl('media', $va_rep_display_info['poster_frame_version']);
unset($va_display_info['poster_frame_version']);
$this->view->setVar('primary_rep_display_options', $va_rep_display_info);
}
}
}
#