本文整理汇总了PHP中ResultContext::getResultsUrlForLastFind方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultContext::getResultsUrlForLastFind方法的具体用法?PHP ResultContext::getResultsUrlForLastFind怎么用?PHP ResultContext::getResultsUrlForLastFind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultContext
的用法示例。
在下文中一共展示了ResultContext::getResultsUrlForLastFind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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);
}
}
//.........这里部分代码省略.........