当前位置: 首页>>代码示例>>PHP>>正文


PHP ResultContext::getResultsLinkForLastFind方法代码示例

本文整理汇总了PHP中ResultContext::getResultsLinkForLastFind方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultContext::getResultsLinkForLastFind方法的具体用法?PHP ResultContext::getResultsLinkForLastFind怎么用?PHP ResultContext::getResultsLinkForLastFind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResultContext的用法示例。


在下文中一共展示了ResultContext::getResultsLinkForLastFind方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: caNavLink

 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_place = $this->getVar('t_item');
$vn_place_id = $t_place->getPrimaryKey();
$vs_title = $this->getVar('label');
$va_access_values = $this->getVar('access_values');
if (!$this->request->isAjax()) {
    ?>
	<div id="detailBody">
		<div id="pageNav">
<?php 
    if ($this->getVar('is_in_result_list') && ($vs_back_link = ResultContext::getResultsLinkForLastFind($this->request, 'ca_places', _t("Back"), ''))) {
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h2><?php 
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_places_detail_html.php

示例2: caEditorFindResultNavigation

/**
 * Generates next/previous/back-to-results navigation HTML for bundleable editors
 *
 * @param $po_request RequestHTTP The current request
 * @param $po_instance BaseModel An instance containing the currently edited record
 * @param $po_result_context ResultContext The current result content
 * @param $pa_options array An optional array of options. Supported options are:
 *		backText = a string to use as the "back" button text; default is "Results"
 *
 * @return string HTML implementing the navigation element
 */
function caEditorFindResultNavigation($po_request, $po_instance, $po_result_context, $pa_options = null)
{
    $vn_item_id = $po_instance->getPrimaryKey();
    $vs_pk = $po_instance->primaryKey();
    $vs_table_name = $po_instance->tableName();
    if (($vs_priv_table_name = $vs_table_name) == 'ca_list_items') {
        $vs_priv_table_name = 'ca_lists';
    }
    $va_found_ids = $po_result_context->getResultList();
    $vn_current_pos = $po_result_context->getIndexInResultList($vn_item_id);
    $vn_prev_id = $po_result_context->getPreviousID($vn_item_id);
    $vn_next_id = $po_result_context->getNextID($vn_item_id);
    if (isset($pa_options['backText']) && $pa_options['backText']) {
        $vs_back_text = $pa_options['backText'];
    } else {
        $vs_back_text = "<span class='resultLink'>" . _t('Results') . "</span>";
    }
    $vs_buf = '';
    if (is_array($va_found_ids) && sizeof($va_found_ids)) {
        if ($vn_prev_id > 0) {
            if ($po_request->user->canAccess($po_request->getModulePath(), $po_request->getController(), "Edit", array($vs_pk => $vn_prev_id)) && !$po_request->getAppConfig()->get($vs_table_name . '_editor_defaults_to_summary_view')) {
                $vs_buf .= caNavLink($po_request, '&#60; prev', 'prev', $po_request->getModulePath(), $po_request->getController(), 'Edit' . '/' . $po_request->getActionExtra(), array($vs_pk => $vn_prev_id)) . '&nbsp;';
            } else {
                $vs_buf .= caNavLink($po_request, '&#60; prev', 'prev', $po_request->getModulePath(), $po_request->getController(), 'Summary', array($vs_pk => $vn_prev_id)) . '&nbsp;';
            }
        } else {
            $vs_buf .= '<span class="prev disabled">&#60; prev</span>';
        }
        $vs_buf .= "<span class='resultCount'>" . ResultContext::getResultsLinkForLastFind($po_request, $vs_table_name, $vs_back_text, '') . " (" . $vn_current_pos . "/" . sizeof($va_found_ids) . ")</span>";
        if (!$vn_next_id && sizeof($va_found_ids)) {
            $vn_next_id = $va_found_ids[0];
        }
        if ($vn_next_id > 0) {
            if ($po_request->user->canAccess($po_request->getModulePath(), $po_request->getController(), "Edit", array($vs_pk => $vn_next_id)) && !$po_request->getAppConfig()->get($vs_table_name . '_editor_defaults_to_summary_view')) {
                $vs_buf .= '&nbsp;' . caNavLink($po_request, '&#62; next', 'next', $po_request->getModulePath(), $po_request->getController(), 'Edit' . '/' . $po_request->getActionExtra(), array($vs_pk => $vn_next_id));
            } else {
                $vs_buf .= '&nbsp;' . caNavLink($po_request, '&#62; next', 'next', $po_request->getModulePath(), $po_request->getController(), 'Summary', array($vs_pk => $vn_next_id));
            }
        } else {
            $vs_buf .= '<span class="next disabled">&#62; next</span>';
        }
    } elseif ($vn_item_id) {
        $vs_buf .= ResultContext::getResultsLinkForLastFind($po_request, $vs_table_name, $vs_back_text, '');
    }
    return $vs_buf;
}
开发者ID:kai-iak,项目名称:providence,代码行数:57,代码来源:displayHelpers.php

示例3: caNavLink

$t_collection = $this->getVar('t_item');
$vn_collection_id = $t_collection->getPrimaryKey();
$vs_title = $this->getVar('label');
$va_access_values = $this->getVar('access_values');
if (!$this->request->isAjax()) {
    ?>
	<div id="detailBody">
		<div id="pageNav">
<?php 
    if ($this->getVar('previous_id')) {
        print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Collection', 'Show', array('collection_id' => $this->getVar('previous_id')), array('id' => 'previous'));
    } else {
        print "&lsaquo; " . _t("Previous");
    }
    print "&nbsp;&nbsp;&nbsp;";
    print ResultContext::getResultsLinkForLastFind($this->request, 'ca_collections', _t("Back"), '');
    print "&nbsp;&nbsp;&nbsp;";
    if ($this->getVar('next_id') > 0) {
        print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Collection', 'Show', array('collection_id' => $this->getVar('next_id')), array('id' => 'next'));
    } else {
        print _t("Next") . " &rsaquo;";
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print $vs_title;
    ?>
</h1>	
<?php 
    # --- identifier
    if ($t_collection->get('idno')) {
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_collections_detail_html.php

示例4: __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);
         }
     }
//.........这里部分代码省略.........
开发者ID:ffarago,项目名称:pawtucket2,代码行数:101,代码来源:DetailController.php

示例5: _t

 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_place = $this->getVar('t_item');
$vn_place_id = $t_place->getPrimaryKey();
$vs_title = $this->getVar('label');
$t_rel_types = $this->getVar('t_relationship_types');
if (!$this->request->isAjax()) {
    ?>
	<div id="detailBody">
		<div id="pageNav">
<?php 
    print ResultContext::getResultsLinkForLastFind($this->request, 'ca_places', "<img src='" . $this->request->getThemeUrlPath() . "/graphics/arrow_up_grey.gif' width='11' height='10' border='0'> " . _t("BACK"), '');
    if ($this->getVar('next_id') || $this->getVar('previous_id')) {
        print "&nbsp;&nbsp;&nbsp;";
    }
    if ($this->getVar('previous_id')) {
        print caNavLink($this->request, "<img src='" . $this->request->getThemeUrlPath() . "/graphics/arrow_grey_left.gif' width='10' height='10' border='0'> " . _t("PREVIOUS"), '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('previous_id')), array('id' => 'previous'));
    }
    if ($this->getVar('next_id') && $this->getVar('previous_id')) {
        print "&nbsp;&nbsp;|&nbsp;&nbsp;";
    }
    if ($this->getVar('next_id') > 0) {
        print caNavLink($this->request, _t("NEXT") . " <img src='" . $this->request->getThemeUrlPath() . "/graphics/arrow_grey_right.gif' width='10' height='10' border='0'>", '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('next_id')), array('id' => 'next'));
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_places_detail_html.php

示例6: caNavLink

$t_entity = $this->getVar('t_item');
$vn_entity_id = $t_entity->getPrimaryKey();
$vs_title = $this->getVar('label');
$va_access_values = $this->getVar('access_values');
if (!$this->request->isAjax()) {
    ?>
	<div id="detailBody">
		<div id="pageNav">
<?php 
    if ($this->getVar('previous_id')) {
        print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('previous_id')), array('id' => 'previous'));
    } else {
        print "&lsaquo; " . _t("Previous");
    }
    print "&nbsp;&nbsp;&nbsp;";
    print ResultContext::getResultsLinkForLastFind($this->request, 'ca_entities', _t("Back"), '');
    print "&nbsp;&nbsp;&nbsp;";
    if ($this->getVar('next_id') > 0) {
        print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('next_id')), array('id' => 'next'));
    } else {
        print _t("Next") . " &rsaquo;";
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print $vs_title;
    ?>
</h1>		
<?php 
    # --- identifier
    if ($t_entity->get('idno')) {
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_entities_detail_html.php

示例7: _t

$t_rep = $this->getVar('t_primary_rep');
$vn_num_images = $this->getVar('num_images');
$vs_display_version = $this->getVar('primary_rep_display_version');
$va_display_options = $this->getVar('primary_rep_display_options');
$vn_image_object_id = $this->getVar("image_object_id");
if (!$this->request->isAjax()) {
    ?>
<div id="pageHeading"><img src='<?php 
    print $this->request->getThemeUrlPath();
    ?>
/graphics/ncr/t_chronology.gif' width='141' height='23' border='0'></div><!-- end pageHeading -->
	<div id="detailBody">
<?php 
}
if ($this->getVar("show_back_button")) {
    $vs_back_link = ResultContext::getResultsLinkForLastFind($this->request, 'ca_occurrences', _t("Back"), '');
}
?>
		<div id="jumpTo">
			<?php 
print $vs_back_link ? $vs_back_link . "&nbsp;&nbsp;<span class='lineDivide'>|</span>&nbsp;&nbsp;" : "";
?>
<span class="subTitle"><?php 
print _t("Jump to:");
?>
&nbsp;</span><!-- end subTitle -->
<?php 
print caFormTag($this->request, 'Detail', 'caChronJumpToFormYear');
print "<select name='year' onchange='this.form.submit();' style='width:70px;'>";
print "<option value=''>Year</option>";
for ($year = 1904; $year <= 1988; $year++) {
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:year_detail_html.php


注:本文中的ResultContext::getResultsLinkForLastFind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。