Пример #1
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // 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"));
     }
     $t_list = new ca_lists();
     $pn_type_restriction_id = $t_list->getItemIDFromList('occurrence_types', 'chronology');
     // set type restrictions for searches
     $o_search_result_context = new ResultContext($this->request, "ca_occurrences", 'basic_search');
     $o_search_result_context->setTypeRestriction($pn_type_restriction_id);
     $o_search_result_context->saveContext();
 }
Пример #2
0
 function chronology()
 {
     $this->ops_tablename = 'ca_occurrences';
     $t_list = new ca_lists();
     $this->opn_type_restriction_id = $t_list->getItemIDFromList('occurrence_types', 'chronology');
     $va_access_values = caGetUserAccessValues($this->request);
     $this->getDefaults();
     // set type restrictions for searches
     $o_search_result_context = new ResultContext($this->request, $this->ops_tablename, 'basic_search');
     $o_search_result_context->setTypeRestriction($this->opn_type_restriction_id);
     $o_search_result_context->saveContext();
     // Set type restriction (ie. only show occurrences with type=bibliography)
     // the base browse controller Index() method will take care of actually setting the restriction
     $this->opo_result_context = new ResultContext($this->request, $this->ops_tablename, $this->ops_find_type);
     $this->opo_result_context->setTypeRestriction($this->opn_type_restriction_id);
     $this->opo_browse = new OccurrenceBrowse($this->opo_result_context->getSearchExpression(), 'pawtucket2');
     $this->opo_browse->setTypeRestrictions(array($this->opn_type_restriction_id));
     $this->opa_sorts = array('ca_occurrence_labels.name' => _t('title'), 'ca_occurrences.idno' => _t('idno'));
     // Remove any browse criteria previously set
     $this->opo_browse->removeAllCriteria();
     parent::Index(true);
     $this->render('Landing/chronology_html.php');
 }