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')); $this->opa_sorts = array('ca_items_x_tags.created_on' => _t('date'), 'ca_items_x_tags.user_id' => _t('user')); AssetLoadManager::register('tableList'); }
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_movement_labels.name' => _t('short description'), 'ca_movements.type_id;ca_movement_labels.name' => _t('type'), 'ca_movements.idno_sort' => _t('idno')), $this->opa_sorts); $this->opo_browse = new MovementBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); }
public function __construct(&$po_request, &$po_response, $pa_view_paths = null) { parent::__construct($po_request, $po_response, $pa_view_paths); $this->opa_views = array('thumbnail' => _t('thumbnails'), 'full' => _t('full'), 'list' => _t('list'), 'editable' => _t('editable')); $this->opa_sorts = array_merge(array('_natural' => _t('relevance'), 'ca_object_labels.name_sort' => _t('title'), 'ca_objects.type_id' => _t('type'), 'ca_objects.idno_sort' => _t('idno')), $this->opa_sorts); $this->opo_browse = new ObjectBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); }
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_tour_stop_labels.name' => _t('name')), $this->opa_sorts); $this->opo_browse = new TourStopBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); }
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_entity_labels.surname;ca_entity_labels.forename' => _t('surname, forename'), 'ca_entity_labels.forename' => _t('forename'), 'ca_entities.type_id;ca_entity_labels.surname;ca_entity_labels.forename' => _t('type'), 'ca_entities.idno_sort' => _t('idno')), $this->opa_sorts); $this->opo_browse = new EntityBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); }
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_occurrence_labels.name_sort' => _t('name'), 'ca_occurrences.idno_sort' => _t('idno')), $this->opa_sorts); $this->opo_browse = new OccurrenceBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); AssetLoadManager::register('imageScroller'); AssetLoadManager::register('tabUI'); AssetLoadManager::register('panel'); }
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')); $this->opa_sorts = array_merge(array('_natural' => _t('relevance'), 'ca_object_labels.name_sort' => _t('title'), 'ca_objects.type_id' => _t('type'), 'ca_objects.idno_sort' => _t('idno')), $this->opa_sorts); $this->opo_browse = new ObjectBrowse($this->opo_result_context->getParameter('browse_id'), 'providence'); // overwrite result context $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'ca_objects_table'); // set dummy search expression so that we don't skip half of // the controller code in BaseSearchController::Index() $this->opo_result_context->setSearchExpression('table_bundle'); }
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(); }
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(); }
public function __construct(&$po_request, &$po_response, $pa_view_paths = null) { parent::__construct($po_request, $po_response, $pa_view_paths); JavascriptLoadManager::register('tabUI'); // redirect user if not logged in if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) { $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form")); } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) { $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index")); } // get configured items per page options, if specified if ($va_items_per_page_for_ca_objects = $po_request->config->getList('items_per_page_options_for_ca_objects_search')) { $this->opa_items_per_page = $va_items_per_page_for_ca_objects; } if ($vn_items_per_secondary_search_page = $po_request->config->get('items_per_secondary_search_page')) { $this->opa_items_per_secondary_search_page = $vn_items_per_secondary_search_page; } if (!($vs_search_target = $po_request->getParameter('target', pString))) { $vs_search_target = $po_request->session->getVar('pawtucket2_search_target'); } // // Minimal view list (all targets have a "full" results view) // $this->opa_views = array('full' => _t('List')); $this->opa_views_options = array('full' => array("description" => _t("View results in a list"), "icon" => "icon_list.gif")); switch ($vs_search_target) { case 'ca_entities': $this->ops_tablename = 'ca_entities'; $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type); $this->opo_browse = new EntityBrowse($this->opo_result_context->getParameter('browse_id', true), 'pawtucket2'); // get configured result views, if specified if ($va_result_views_for_ca_entities = $po_request->config->getAssoc('result_views_for_ca_entities')) { $this->opa_views = $va_result_views_for_ca_entities; } else { $this->opa_views = array('full' => _t('List')); } // get configured result sort options, if specified if ($va_sort_options_for_ca_entities = $po_request->config->getAssoc('result_sort_options_for_ca_entities')) { $this->opa_sorts = $va_sort_options_for_ca_entities; } else { $this->opa_sorts = array('ca_entity_labels.displayname' => _t('Name'), 'ca_entities.type_id' => _t('Type'), 'ca_entities.idno_sort' => _t('Idno')); } if (is_array($va_view_opts = $po_request->config->get("result_views_options_for_ca_entities"))) { $this->opa_views_options = array_merge($this->opa_views_options, $va_view_opts); } break; case 'ca_places': $this->ops_tablename = 'ca_places'; $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type); $this->opo_browse = new PlaceBrowse($this->opo_result_context->getParameter('browse_id', true), 'pawtucket2'); // get configured result views, if specified if ($va_result_views_for_ca_places = $po_request->config->getAssoc('result_views_for_ca_places')) { $this->opa_views = $va_result_views_for_ca_places; } else { $this->opa_views = array('full' => _t('List')); } // get configured result sort options, if specified if ($va_sort_options_for_ca_places = $po_request->config->getAssoc('result_sort_options_for_ca_places')) { $this->opa_sorts = $va_sort_options_for_ca_places; } else { $this->opa_sorts = array('ca_place_labels.name' => _t('Name'), 'ca_places.type_id' => _t('Type'), 'ca_places.idno_sort' => _t('Idno')); } if (is_array($va_view_opts = $po_request->config->get("result_views_options_for_ca_places"))) { $this->opa_views_options = array_merge($this->opa_views_options, $va_view_opts); } break; case 'ca_occurrences': $this->ops_tablename = 'ca_occurrences'; $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type); $this->opo_browse = new OccurrenceBrowse($this->opo_result_context->getParameter('browse_id', true), 'pawtucket2'); // get configured result views, if specified if ($va_result_views_for_ca_occurrences = $po_request->config->getAssoc('result_views_for_ca_occurrences')) { $this->opa_views = $va_result_views_for_ca_occurrences; } else { $this->opa_views = array('full' => _t('List')); } // get configured result sort options, if specified if ($va_sort_options_for_ca_occurrences = $po_request->config->getAssoc('result_sort_options_for_ca_occurrences')) { $this->opa_sorts = $va_sort_options_for_ca_occurrences; } else { $this->opa_sorts = array('ca_occurrence_labels.name' => _t('Title'), 'ca_occurrences.idno_sort' => _t('Idno')); } if (is_array($va_view_opts = $po_request->config->get("result_views_options_for_ca_occurrences"))) { $this->opa_views_options = array_merge($this->opa_views_options, $va_view_opts); } break; case 'ca_collections': $this->ops_tablename = 'ca_collections'; $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type); $this->opo_browse = new CollectionBrowse($this->opo_result_context->getParameter('browse_id', true), 'pawtucket2'); // get configured result views, if specified if ($va_result_views_for_ca_collections = $po_request->config->getAssoc('result_views_for_ca_collections')) { $this->opa_views = $va_result_views_for_ca_collections; } else { $this->opa_views = array('full' => _t('List')); } // get configured result sort options, if specified if ($va_sort_options_for_ca_collections = $po_request->config->getAssoc('result_sort_options_for_ca_collections')) { $this->opa_sorts = $va_sort_options_for_ca_collections; } else { $this->opa_sorts = array('ca_collection_labels.name' => _t('Name'), 'ca_collections.type_id' => _t('Type'), 'ca_collections.idno_sort' => _t('Idno')); } if (is_array($va_view_opts = $po_request->config->get("result_views_options_for_ca_collections"))) { $this->opa_views_options = array_merge($this->opa_views_options, $va_view_opts); } break; default: $this->ops_tablename = 'ca_objects'; $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type); $this->opo_browse = new ObjectBrowse($this->opo_result_context->getParameter('browse_id', true), 'pawtucket2'); // get configured result views, if specified if ($va_result_views_for_ca_objects = $po_request->config->getAssoc('result_views_for_ca_objects')) { $this->opa_views = $va_result_views_for_ca_objects; } else { $this->opa_views = array('thumbnail' => _t('Thumbnails'), 'full' => _t('List')); } // get configured result sort options, if specified if ($va_sort_options_for_ca_objects = $po_request->config->getAssoc('result_sort_options_for_ca_objects')) { $this->opa_sorts = $va_sort_options_for_ca_objects; } else { $this->opa_sorts = array('ca_object_labels.name' => _t('Title'), 'ca_objects.type_id' => _t('Type'), 'ca_objects.idno_sort' => _t('Idno')); } if ($po_request->config->get("show_map_object_search_results")) { JavascriptLoadManager::register('maps'); $this->opa_views['map'] = _t('Map'); if (!$this->opa_views_options['map']) { $this->opa_views_options['map'] = array("description" => _t("View results plotted on a map"), "icon" => "icon_map.gif"); } } if (is_array($va_view_opts = $po_request->config->get("result_views_options_for_ca_objects"))) { $this->opa_views_options = array_merge($this->opa_views_options, $va_view_opts); } break; } // if target changes we need clear out all browse criteria as they are no longer valid if ($vs_search_target != $po_request->session->getVar('pawtucket2_search_target')) { $this->opo_browse->removeAllCriteria(); } // Set up target vars and controls $po_request->session->setVar('pawtucket2_search_target', $vs_search_target); // set current result view options so can check we are including a configured result view $this->view->setVar('result_views', $this->opa_views); // get configured items per page options, if specified if ($va_items_per_page_for = $po_request->config->getList('items_per_page_options_for_' . $this->ops_tablename . '_search')) { $this->opa_items_per_page = $va_items_per_page_for; } if (($vn_items_per_page_default = (int) $po_request->config->get('items_per_page_default_for_' . $this->ops_tablename . '_search')) > 0) { $this->opn_items_per_page_default = $vn_items_per_page_default; } else { $this->opn_items_per_page_default = $this->opa_items_per_page[0]; } // secondary search settings if ($vn_items_per_secondary_search_page = $po_request->config->get('items_per_secondary_search_page')) { $this->opa_items_per_secondary_search_page = $vn_items_per_secondary_search_page; } // set current result view options so can check we are including a configured result view $this->view->setVar('result_views', $this->opa_views); $this->view->setVar('result_views_options', $this->opa_views_options); if ($this->opn_type_restriction_id = $this->opo_result_context->getTypeRestriction($pb_type_restriction_has_changed)) { $_GET['type_id'] = $this->opn_type_restriction_id; // push type_id into globals so breadcrumb trail can pick it up $this->opb_type_restriction_has_changed = $pb_type_restriction_has_changed; // get change status } }
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')); JavascriptLoadManager::register('smoothDivScrollVertical'); 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', $this->opa_access_values); $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'chronology'); $t_list = new ca_lists(); $pn_type_restriction_id_entity = $t_list->getItemIDFromList('entity_types', 'individual'); // set type restrictions for searches $this->opo_search_result_context_entity = new ResultContext($this->request, "ca_entities", 'chronology'); $this->opo_search_result_context_entity->setTypeRestriction($pn_type_restriction_id_entity); $this->opo_search_result_context_entity->saveContext(); $va_periods = $this->opa_periods; $this->view->setVar('periods', $this->opa_periods); $vn_year = $this->request->getParameter('year', pInteger); $vn_period = $this->request->getParameter('period', pInteger); if (!$vn_period || !$va_periods[$vn_period]) { if ($vn_year) { # --- determine the period from the year foreach ($va_periods as $i => $va_per_info) { if ($vn_year >= $va_per_info["start"] && $vn_year <= $va_per_info["end"]) { $vn_period = $i; break; } } } else { $vn_period = $this->opn_default_period; } } $this->view->setVar('period', $vn_period); $this->opn_period = $vn_period; if (!$vn_year) { $vn_year = $va_periods[$vn_period]["start"]; } $this->view->setVar('year', $vn_year); if ($va_periods[$vn_period]["displayAllYears"] == 1) { $this->ops_date_range = $va_periods[$vn_period]["start"] . " to " . $va_periods[$vn_period]["end"]; } else { $this->ops_date_range = $vn_year; } JavascriptLoadManager::register('maps'); }
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')); $this->opa_sorts = array('ca_relationship_type_labels.typename' => _t('type name')); }