• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ResultContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Edit

 public function Edit($pa_values = null, $pa_options = null)
 {
     $o_result_context = new ResultContext($this->request, 'ca_relationship_types', 'basic_search');
     $va_cur_result = $o_result_context->getResultList();
     $vn_id = $this->request->getParameter('type_id', pInteger);
     $vn_parent_id = $this->request->getParameter('parent_id', pInteger);
     // If we're creating a new record we'll need to establish the table_num
     // from the parent (there's always a parent)
     if (!$vn_id) {
         $t_parent = new ca_relationship_types($vn_parent_id);
         if (!$t_parent->getPrimaryKey()) {
             $this->postError(1230, _t("Invalid parent"), "RelationshipTypeEditorController->Edit()");
             return;
         }
         $this->request->setParameter('table_num', $t_parent->get('table_num'));
     }
     if (!is_array($va_cur_result) || !in_array($vn_id, $va_cur_result)) {
         //
         // Set "results list" navigation to all types in the same level as the currently selected type
         //
         $t_instance = new ca_relationship_types();
         if (is_array($va_siblings = $t_instance->getHierarchySiblings($this->request->getParameter('type_id', pInteger), array('idsOnly' => true)))) {
             $o_result_context->setResultList($va_siblings);
             $o_result_context->saveContext();
         }
     }
     parent::Edit();
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:28,代码来源:RelationshipTypeEditorController.php


示例2: 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');
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:13,代码来源:SearchFormController.php


示例3: 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');
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:13,代码来源:BundleDisplaysController.php


示例4: 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');
 }
开发者ID:samrahman,项目名称:providence,代码行数:13,代码来源:ElementsController.php


示例5: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do export
     //
     if (!$req->isLoggedIn()) {
         return;
     }
     set_time_limit(3600 * 24);
     // if it takes more than 24 hours we're in trouble
     $vn_id = $req->getParameter('exporter_id', pInteger);
     $t_exporter = new ca_data_exporters($vn_id);
     $vs_file = tempnam(__CA_APP_DIR__ . DIRECTORY_SEPARATOR . 'tmp', 'dataExport');
     // we have 3 different sources for batch exports: search/browse result, sets and search expressions (deprecated)
     // they all operate on different parameters and on different static functions in ca_data_exporters
     if ($req->getParameter('caIsExportFromSearchOrBrowseResult', pInteger)) {
         // batch export from search or browse result
         $vs_find_type = $req->getParameter('find_type', pString);
         $vo_result_context = new ResultContext($req, $t_exporter->getTargetTableName(), $vs_find_type);
         $t_instance = $t_exporter->getTargetTableInstance();
         $o_result = $t_instance->makeSearchResult($t_instance->tableName(), $vo_result_context->getResultList());
         ca_data_exporters::exportRecordsFromSearchResult($t_exporter->get('exporter_code'), $o_result, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
     } else {
         if ($vn_set_id = $req->getParameter('set_id', pInteger)) {
             // batch export from set
             ca_data_exporters::exportRecordsFromSet($t_exporter->get('exporter_code'), $vn_set_id, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
         } else {
             // batch export from search expression (deprecated)
             $vs_search = $req->getParameter('search', pString);
             ca_data_exporters::exportRecordsFromSearchExpression($t_exporter->get('exporter_code'), $vs_search, $vs_file, array('request' => $req, 'progressCallback' => 'caIncrementBatchMetadataExportProgress'));
         }
     }
     // export done, record it in session for later usage in download/destination action
     if (filesize($vs_file)) {
         $o_session = $req->getSession();
         $o_session->setVar('export_file', $vs_file);
         $o_session->setVar('export_content_type', $t_exporter->getContentType());
         $o_session->setVar('exporter_id', $t_exporter->getPrimaryKey());
         caExportAddDownloadLink($req);
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:50,代码来源:BatchMetadataExportProgress.php


示例6: __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();
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:15,代码来源:ListsController.php


示例7: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views'));
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/eastend/themes/" . $this->ops_theme . "/css/eastend.css", 'text/css');
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/eastend/conf/eastend.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('eastend plugin is not enabled'));
     }
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $this->opa_access_values = array();
     } else {
         $this->opa_access_values = caGetUserAccessValues($this->request);
     }
     $this->view->setVar('access_values', $va_access_values);
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', ResultContext::getLastFind($po_request, 'ca_objects'));
     JavascriptLoadManager::register('cycle');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:27,代码来源:ObjectSlideshowController.php


示例8: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:7,代码来源:BaseInterstitialController.php


示例9: Edit

 public function Edit()
 {
     $o_result_context = new ResultContext($this->request, 'ca_tour_stops', 'basic_search');
     $va_cur_result = $o_result_context->getResultList();
     $vn_id = $this->request->getParameter('stop_id', pInteger);
     if (is_array($va_cur_result) && !in_array($vn_id, $va_cur_result)) {
         //
         // Set "results list" navigation to all items in the same level as the currently selected item
         //
         $t_instance = new ca_list_items();
         if (is_array($va_siblings = $t_instance->getHierarchySiblings($vn_id, array('idsOnly' => true)))) {
             $o_result_context->setResultList($va_siblings);
             $o_result_context->saveContext();
         }
     }
     parent::Edit();
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:17,代码来源:TourStopEditorController.php


示例10: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     JavascriptLoadManager::register('bundleListEditorUI');
     JavascriptLoadManager::register('panel');
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:9,代码来源:BaseEditorController.php


示例11: convertResults

/**
 * 将结果集转为前端的模式
 * @param ResultContext $resContext
 */
function convertResults($resContext)
{
    $ret = array();
    $resArr = $resContext->getResArr();
    foreach ($resArr as $record) {
        $item = array();
        $record = $record->getRecord();
        $item['type'] = $record['type'];
        $item['node_path'] = $record['node_path'];
        $item['var_path'] = $record['var_path'];
        //整理node代码
        $node = $record['node'];
        $node_item = array();
        if ($node instanceof Symbol) {
            $node_start = $node->getValue()->getAttribute('startLine');
            $node_end = $node->getValue()->getAttribute('endLine');
        } else {
            $node_start = $node->getAttribute('startLine');
            $node_end = $node->getAttribute('endLine');
        }
        $node_item['line'] = $node_start . "|" . $node_end;
        $node_item['code'] = FileUtils::getCodeByLine($record['node_path'], $node_start, $node_end);
        $item['node'] = $node_item;
        //整理var代码
        $var = $record['var'];
        $var_item = array();
        if ($var instanceof Symbol) {
            $var_start = $var->getValue()->getAttribute('startLine');
            $var_end = $var->getValue()->getAttribute('endLine');
        } elseif (is_string($var)) {
            $var_start = $node_start;
            $var_end = $node_end;
        } else {
            $var_start = $var->getAttribute('startLine');
            $var_end = $var->getAttribute('endLine');
        }
        $var_item['line'] = $var_start . "|" . $var_end;
        $var_item['code'] = FileUtils::getCodeByLine($record['var_path'], $var_start, $var_end);
        $item['var'] = $var_item;
        array_push($ret, $item);
    }
    return $ret;
}
开发者ID:getcode2git,项目名称:phpvulhunter,代码行数:47,代码来源:main.php


示例12: _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;
 }
开发者ID:samrahman,项目名称:providence,代码行数:19,代码来源:InterfaceScreenEditorController.php


示例13: 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');
 }
开发者ID:samrahman,项目名称:providence,代码行数:24,代码来源:InterfacesController.php


示例14: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if (!$po_request->user->canDoAction('can_batch_import_metadata')) {
         $po_response->setRedirect($po_request->config->get('error_display_url') . '/n/3400?r=' . urlencode($po_request->getFullUrlPath()));
         return;
     }
     AssetLoadManager::register('bundleableEditor');
     AssetLoadManager::register('panel');
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
 }
开发者ID:samrahman,项目名称:providence,代码行数:13,代码来源:MetadataImportController.php


示例15: __construct

 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // Can user batch import media?
     if (!$po_request->user->canDoAction('can_batch_import_media')) {
         $po_response->setRedirect($po_request->config->get('error_display_url') . '/n/3410?r=' . urlencode($po_request->getFullUrlPath()));
         return;
     }
     AssetLoadManager::register('bundleableEditor');
     AssetLoadManager::register('panel');
     $this->opo_datamodel = Datamodel::load();
     $this->opo_app_plugin_manager = new ApplicationPluginManager();
     $this->opo_result_context = new ResultContext($po_request, $this->ops_table_name, ResultContext::getLastFind($po_request, $this->ops_table_name));
     $this->opa_importable_tables = array(caGetTableDisplayName('ca_objects') => 'ca_objects', caGetTableDisplayName('ca_entities') => 'ca_entities', caGetTableDisplayName('ca_places') => 'ca_places', caGetTableDisplayName('ca_collections') => 'ca_collections', caGetTableDisplayName('ca_occurrences') => 'ca_occurrences', caGetTableDisplayName('ca_storage_locations') => 'ca_storage_locations', caGetTableDisplayName('ca_object_lots') => 'ca_object_lots', caGetTableDisplayName('ca_movements') => 'ca_movements', caGetTableDisplayName('ca_loans') => 'ca_loans');
     foreach ($this->opa_importable_tables as $vs_key => $vs_table) {
         if ($this->getRequest()->getAppConfig()->get($vs_table . '_disable')) {
             unset($this->opa_importable_tables[$vs_key]);
         }
     }
 }
开发者ID:samrahman,项目名称:providence,代码行数:20,代码来源:MediaImportController.php


示例16: __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


示例17: ucfirst

							<p><label for="keyword">by keyword</label><input type="text" name="search" value="<?php 
    print $vs_search ? $vs_search : '';
    ?>
" onclick='jQuery("#quickSearch").select();' id="quickSearch"  autocomplete="off" /><input type="hidden" name="searchtype" value="keyword" /><input class="button" type="image" src="<?php 
    print $this->request->getThemeUrlPath();
    ?>
/graphics/city/search-button.png" alt="search" /></p>
						</fieldset>
					</form>
	</div>
 	<div id="resultBox">
<?php 
}
if ($vo_result) {
    $vn_num_hits = $this->getVar('num_hits');
    if (ResultContext::getLastFind($this->request, 'ca_objects') != 'basic_browse') {
        print '<div style="margin-top:2px; clear:left;">' . _t('Your %1 for <b>' . ucfirst($vo_result_context->getSearchExpression()) . '</b> returned %2 %3.', $this->getVar('mode_type_singular'), $vn_num_hits, $vn_num_hits == 1 ? _t('result') : _t('results')) . "</div>";
    } else {
        print '<div style="margin-top:2px; clear:left;">' . _t('Your %1 returned %2 %3.', $this->getVar('mode_type_singular'), $vn_num_hits, $vn_num_hits == 1 ? _t('result') : _t('results')) . "</div>";
    }
    if ($this->getVar('num_pages') > 1) {
        print $this->render('Results/paging_controls_html.php');
    } else {
        print "<div class='divide'></div>";
    }
    if (!$vn_collection_search) {
        if ($vo_result->numHits() > 0) {
            ?>
				<a href='#' id='showRefine' onclick='jQuery("#searchRefineBox").slideDown(250); jQuery("#showRefine").hide(); jQuery("#searchOptionsBox").slideUp(250); jQuery("#showOptions").show(); return false;'><?php 
            print _t("Filter Search");
            ?>
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_objects_search_basic_html.php


示例18: Show


//.........这里部分代码省略.........
                     $va_sort = array('sort' => $vs_sort);
                 }
                 $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);
             }
         }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:67,代码来源:BaseDetailController.php


示例19: Info

 /**
  * 
  */
 public function Info()
 {
     $t_set = new ca_sets($vn_set_id = $this->request->getParameter('set_id', pInteger));
     $vn_user_id = !(bool) $this->request->config->get('ca_sets_all_users_see_all_sets') ? $this->request->getUserID() : null;
     $va_set_stats = array('mine' => caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $this->request->getUserID(), 'access' => __CA_SET_EDIT_ACCESS__)), null, null, array()));
     if ($this->request->user->canDoAction('is_administrator') || $this->request->user->canDoAction('can_administrate_sets')) {
         $va_set_stats['user'] = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'allUsers' => true)), null, null, array());
         $va_set_stats['public'] = caExtractValuesByUserLocale($t_set->getSets(array('user_id' => $vn_user_id, 'publicUsers' => true)), null, null, array());
     }
     $o_result_context = new ResultContext($this->request, 'ca_sets', 'basic_search');
     $pn_mode = (int) $o_result_context->getParameter('set_display_mode');
     $this->view->setVar('mode', $pn_mode);
     $this->view->setVar('sets', $va_set_stats);
     return $this->render('widget_set_info_html.php', true);
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:18,代码来源:SetController.php


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ResultPrinter类代码示例发布时间:2022-05-23
下一篇:
PHP Result类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap