本文整理汇总了PHP中MetaTagManager类的典型用法代码示例。如果您正苦于以下问题:PHP MetaTagManager类的具体用法?PHP MetaTagManager怎么用?PHP MetaTagManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MetaTagManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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"));
}
$po_request->session->setVar('pawtucket2_browse_target', "ca_objects");
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, $this->ops_tablename, $this->ops_find_type);
$this->opo_result_context->setAsLastFind();
$this->opo_browse = new ObjectBrowse($x = $this->opo_result_context->getSearchExpression());
$this->view->setvar("browse_place_ids", $this->opo_plugin_config->get('artist_browser_place_ids'));
}
示例2: __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/MetabolicChronology/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/MetabolicChronology/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/MetabolicChronology/conf/Chronology.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('Metabolic Chronology plugin is not enabled'));
}
$this->_initView($pa_options);
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'MetabolicChronology');
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/MetabolicChronology/themes/" . $this->ops_theme . "/css/chronology.css", 'text/css');
JavascriptLoadManager::register('jcarousel');
JavascriptLoadManager::register('maps');
$t_list = new ca_lists();
$this->opn_silo_type_id = $t_list->getItemIDFromList('collection_types', 'silo');
$this->opn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action');
$this->opn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context');
$this->opn_yes_list_id = $t_list->getItemIDFromList('yes_no', 'yes');
$t_relationship_types = new ca_relationship_types();
$this->opn_rel_type_action_display_image = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "display");
$this->opn_rel_type_action_secondary_images = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "secondary");
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例3: __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/NovaMuse/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/NovaMuse/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/NovaMuse/conf/NovaMuse.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('NovaMuse plugin is not enabled'));
}
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/NovaMuse/themes/" . $this->ops_theme . "/css/dashboard.css", 'text/css');
$this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'dashboard');
$t_list = new ca_lists();
$this->opn_member_institution_id = $t_list->getItemIDFromList('entity_types', 'member_institution');
$this->opn_individual_id = $t_list->getItemIDFromList('entity_types', 'ind');
$this->opn_family_id = $t_list->getItemIDFromList('entity_types', 'fam');
$this->opn_organization_id = $t_list->getItemIDFromList('entity_types', 'org');
$t_object = new ca_objects();
$this->opn_objectTableNum = $t_object->tableNum();
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
$this->view->setVar('access_values', $va_access_values);
}
示例4: __construct
/**
*
*/
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
}
caSetPageCSSClasses(array("multisearch"));
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Search") . ": " . $this->request->getParameter('search', pString));
}
示例5: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->config = caGetFrontConfig();
caSetPageCSSClasses(array("front"));
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
}
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name"));
}
示例6: __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/Cataloging/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/Cataloging/themes/' . $this->ops_theme . '/views'));
$this->opo_plugin_config = Configuration::load($po_request->getAppConfig()->get('application_plugins') . '/Cataloging/conf/cataloging.conf');
if (!(bool) $this->opo_plugin_config->get('enabled')) {
die(_t('Cataloging plugin is not enabled'));
}
$vs_default_ui = $this->opo_plugin_config->get('default_ui');
$vs_requested_ui = $this->request->getParameter('ui', pString);
$va_ui_list = $this->opo_plugin_config->getAssoc('uis');
$o_dm = Datamodel::load();
if (isset($va_ui_list[$vs_requested_ui]) && is_array($va_ui_list[$vs_requested_ui])) {
$this->opa_ui_info = $va_ui_list[$vs_requested_ui];
$this->ops_ui_code = $vs_requested_ui;
} else {
if (isset($va_ui_list[$vs_default_ui]) && is_array($va_ui_list[$vs_default_ui])) {
$this->opa_ui_info = $va_ui_list[$vs_default_ui];
} else {
$vs_default_ui = array_shift(array_keys($va_ui_list));
$this->opa_ui_info = $va_ui_list[$vs_default_ui];
}
$this->ops_ui_code = $vs_default_ui;
}
$this->ops_table_name = $this->opa_ui_info['table'];
if (!($this->opo_instance = $o_dm->getInstanceByTableName($this->ops_table_name, true))) {
die(_t('Invalid table "%1" specified in Cataloging plugin for form "%2"', $this->ops_table_name, $vs_default_ui));
}
# --- load the current record
if (!($pn_id = $this->request->getParameter($this->opo_instance->primaryKey(), pInteger))) {
die(_t("Primary key of record must be passed to form"));
}
if (!$this->opo_instance->load($pn_id)) {
die(_t("Invalid id"));
}
$t_list = new ca_lists();
if (isset($this->opa_ui_info['representation_type']) && $this->opa_ui_info['representation_type']) {
$this->opa_ui_info['representation_type_id'] = $t_list->getItemIDFromList('object_representation_types', $this->opa_ui_info['representation_type']);
}
CatalogingPlugin::setUIInfo($this->ops_ui_code, $this->opa_ui_info);
JavascriptLoadManager::register('panel');
MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/Cataloging/themes/" . $this->ops_theme . "/css/cataloging.css", 'text/css');
$this->request->setParameter('dont_set_pawtucket2_last_page', '1');
// Setting this parameter ensures that the "last page" we (may) redirect to after submission isn't the Cataloging form itself
if ($this->opa_ui_info['require_login'] && !$po_request->isLoggedIn()) {
$this->notification->addNotification(_t("You must be logged in to use user cataloging features."), __NOTIFICATION_TYPE_ERROR__);
$this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'form'));
return;
}
}
示例7: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
}
$this->config = caGetContactConfig();
if (!$this->config->get("contact_email") && !$this->config->get("contact_form_elements")) {
$this->notification->addNotification(_t("Contact form is not configured properly"), __NOTIFICATION_TYPE_ERROR__);
$this->response->setRedirect(caNavUrl($this->request, '', '', ''));
}
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Contact"));
caSetPageCSSClasses(array("contact"));
}
示例8: __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/FindingAids/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/FindingAids/themes/' . $this->ops_theme . '/views'));
MetaTagManager::addLink("stylesheet", $this->request->getBaseUrlPath() . "/app/plugins/FindingAids/themes/" . $this->ops_theme . "/css/findingaids.css", "text/css");
// 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"));
}
}
示例9: __construct
/**
*
*/
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
// Set view path for plugin views directory
if (!is_array($pa_view_paths)) {
$pa_view_paths = array();
}
$pa_view_paths[] = __CA_APP_DIR__ . "/plugins/WorldCat/themes/" . __CA_THEME__ . "/views";
// Load plugin configuration file
$this->opo_config = Configuration::load(__CA_APP_DIR__ . '/plugins/WorldCat/conf/worldcat.conf');
parent::__construct($po_request, $po_response, $pa_view_paths);
if (!$this->request->user->canDoAction('can_import_worldcat')) {
$this->response->setRedirect($this->request->config->get('error_display_url') . '/n/3000?r=' . urlencode($this->request->getFullUrlPath()));
return;
}
// Load plugin stylesheet
MetaTagManager::addLink('stylesheet', __CA_URL_ROOT__ . "/app/plugins/WorldCat/themes/" . __CA_THEME__ . "/css/WorldCat.css", 'text/css');
}
示例10: __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"));
}
JavascriptLoadManager::register('cycle');
$t_list = new ca_lists();
$this->view->setVar("user_contributed_source_id", $t_list->getItemIDFromList('object_sources', 'user_contributed'));
$this->view->setVar("user_contributed_other_source_id", $t_list->getItemIDFromList('object_sources', 'user_contributed_other'));
}
示例11: caGetSearchInstance
<?php
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": Body of Knowledge");
# --- do a occurrece search to get all the competences
$o_search = caGetSearchInstance("ca_occurrences");
$t_lists = new ca_lists();
$vn_category_type_id = $t_lists->getItemIDFromList("occurrence_types", "category");
$qr_res = $o_search->search('type_id:' . $vn_category_type_id, $va_options['sort'] = "ca_occurrences.preferred_labels.name");
$va_all_competences = array();
$va_competences_by_area = array();
if ($qr_res->numHits()) {
while ($qr_res->nextHit()) {
$va_all_competences[$qr_res->get("ca_occurrences.occurrence_id")] = array("idno" => $qr_res->get("ca_occurrences.idno"), "label" => strtolower($qr_res->get("ca_occurrences.preferred_labels.name")));
$va_competences_by_area[str_replace(" Pa ", " PA ", ucwords(strtolower($qr_res->get("ca_occurrences.area", array("convertCodesToDisplayText" => true)))))][$qr_res->get("ca_occurrences.occurrence_id")] = array("idno" => $qr_res->get("ca_occurrences.idno"), "label" => strtolower($qr_res->get("ca_occurrences.preferred_labels.name")));
}
}
if (sizeof($va_competences_by_area)) {
?>
<div class="container containerTextPadding" id="comp_nav">
<div class="row">
<div class="col-sm-12">
<H2>Choose a competence category to explore:</H2>
<?php
if ($this->request->config->get("onlyLinkTrpCategory")) {
?>
<H5 class="indent red"><i>* Content currently under development. Please use the competence category TRP (Tourism, Recreation, and Public Use) to explore how the Body of Knowledge works.</i></H5>
<?php
}
?>
</div>
示例12: __call
/**
*
*/
public function __call($ps_function, $pa_args)
{
$ps_function = strtolower($ps_function);
# --- which type of set is configured for display in gallery section
$t_list = new ca_lists();
$vn_gallery_set_type_id = $t_list->getItemIDFromList('set_types', $this->config->get('gallery_set_type'));
$t_set = new ca_sets();
if ($ps_function == "index") {
if ($vn_gallery_set_type_id) {
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'checkAccess' => $this->opa_access_values, 'setType' => $vn_gallery_set_type_id)));
$va_set_first_items = $t_set->getFirstItemsFromSets(array_keys($va_sets), array("version" => "icon", "checkAccess" => $this->opa_access_values));
$o_front_config = caGetFrontConfig();
$vs_front_page_set = $o_front_config->get('front_page_set_code');
$vb_omit_front_page_set = (bool) $this->config->get('omit_front_page_set_from_gallery');
foreach ($va_sets as $vn_set_id => $va_set) {
if ($vb_omit_front_page_set && $va_set['set_code'] == $vs_front_page_set) {
unset($va_sets[$vn_set_id]);
}
}
$this->view->setVar('sets', $va_sets);
$this->view->setVar('first_items_from_sets', $va_set_first_items);
}
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . ($this->config->get('gallery_section_name') ? $this->config->get('gallery_section_name') : _t("Gallery")));
$this->render("Gallery/index_html.php");
} else {
$ps_set_id = $ps_function;
$this->view->setVar("set_id", $ps_set_id);
$t_set->load($ps_set_id);
$this->view->setVar("set", $t_set);
$this->view->setVar("label", $t_set->getLabelForDisplay());
$this->view->setVar("description", $t_set->get($this->config->get('gallery_set_description_element_code')));
$this->view->setVar("set_items", caExtractValuesByUserLocale($t_set->getItems(array("thumbnailVersions" => array("icon"), "checkAccess" => $this->opa_access_values))));
MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . ($this->config->get('gallery_section_name') ? $this->config->get('gallery_section_name') : _t("Gallery")) . ": " . $t_set->getLabelForDisplay());
$this->render("Gallery/detail_html.php");
}
}
示例13: Index
public function Index($pa_options = null)
{
$po_search = isset($pa_options['search']) && $pa_options['search'] ? $pa_options['search'] : null;
parent::Index($pa_options);
AssetLoadManager::register('browsable');
// need this to support browse panel when filtering/refining search results
$t_model = $this->opo_datamodel->getTableInstance($this->ops_tablename, true);
// Get elements of result context
$vn_page_num = $this->opo_result_context->getCurrentResultsPageNumber();
$vs_search = $this->opo_result_context->getSearchExpression();
if (!($vn_items_per_page = $this->opo_result_context->getItemsPerPage())) {
$vn_items_per_page = $this->opa_items_per_page[0];
}
if (!($vs_view = $this->opo_result_context->getCurrentView())) {
$va_tmp = array_keys($this->opa_views);
$vs_view = array_shift($va_tmp);
}
if (!($vs_sort = $this->opo_result_context->getCurrentSort())) {
$va_tmp = array_keys($this->opa_sorts);
$vs_sort = array_shift($va_tmp);
}
$vs_sort_direction = $this->opo_result_context->getCurrentSortDirection();
$vn_display_id = $this->opo_result_context->getCurrentBundleDisplay();
if (!$this->opn_type_restriction_id) {
$this->opn_type_restriction_id = '';
}
$this->view->setVar('type_id', $this->opn_type_restriction_id);
MetaTagManager::setWindowTitle(_t('%1 advanced search', $this->searchName('plural')));
$t_form = new ca_search_forms();
if (!($vn_form_id = isset($pa_options['form_id']) ? $pa_options['form_id'] : null)) {
if (!($vn_form_id = $this->opo_result_context->getParameter('form_id'))) {
if (sizeof($va_forms = $t_form->getForms(array('table' => $this->ops_tablename, 'user_id' => $this->request->getUserID(), 'access' => __CA_SEARCH_FORM_READ_ACCESS__)))) {
$va_tmp = array_keys($va_forms);
$vn_form_id = array_shift($va_tmp);
}
}
}
$t_form->load($vn_form_id);
$this->view->setVar('t_form', $t_form);
$this->view->setVar('form_id', $vn_form_id);
if ($pa_options['appendToSearch']) {
$vs_append_to_search .= " AND (" . $pa_options['appendToSearch'] . ")";
}
//
// Execute the search
//
if (isset($pa_options['saved_search']) && $pa_options['saved_search']) {
// Is this a saved search? If so, reused the canned params
$va_form_data = $pa_options['saved_search'];
foreach ($pa_options['saved_search'] as $vs_fld => $vs_val) {
$vs_proc_fld = str_replace(".", "_", $vs_fld);
$va_proc_form_data[$vs_proc_fld] = $vs_val;
}
$vs_search = $t_form->getLuceneQueryStringForHTMLFormInput($va_proc_form_data);
$vb_is_new_search = true;
} else {
if (!($vs_search = $t_form->getLuceneQueryStringForHTMLFormInput($_REQUEST))) {
// try to get search off of request
$vs_search = $this->opo_result_context->getSearchExpression();
// get the search out of the result context
$va_form_data = $this->opo_result_context->getParameter('form_data');
$vb_is_new_search = !$this->opo_result_context->cacheIsValid();
} else {
$va_form_data = $t_form->extractFormValuesFromArray($_REQUEST);
// ah ok, its an incoming request, so get the form values out for interpretation/processing/whatever
$vb_is_new_search = true;
}
}
if ($this->request->getParameter('reset', pString) == 'clear') {
$vs_search = '';
$vb_is_new_search = true;
}
if ($vs_search && $vs_search != "") {
/* any request? */
$va_search_opts = array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction, 'appendToSearch' => $vs_append_to_search, 'getCountsByField' => 'type_id', 'checkAccess' => $va_access_values, 'no_cache' => $vb_is_new_search);
if ($vb_is_new_search || isset($pa_options['saved_search']) || is_subclass_of($po_search, "BrowseEngine") && !$po_search->numCriteria()) {
$vs_browse_classname = get_class($po_search);
$this->opo_browse = $po_search = new $vs_browse_classname();
$po_search->addCriteria('_search', $vs_search);
}
if ($this->opn_type_restriction_id) {
$po_search->setTypeRestrictions(array($this->opn_type_restriction_id));
}
$vb_criteria_have_changed = false;
if (is_subclass_of($po_search, "BrowseEngine")) {
$vb_criteria_have_changed = $po_search->criteriaHaveChanged();
$po_search->execute($va_search_opts);
$this->opo_result_context->setParameter('browse_id', $po_search->getBrowseID());
$vo_result = $po_search->getResults($va_search_opts);
} else {
$vo_result = $po_search->search($vs_search, $va_search_opts);
}
$this->opo_result_context->validateCache();
// Only prefetch what we need
$vo_result->setOption('prefetch', $vn_items_per_page);
$this->opo_result_context->setParameter('form_data', $va_form_data);
$this->opo_result_context->setSearchExpression($vs_search);
if ($vb_is_new_search || $vb_criteria_have_changed) {
$this->opo_result_context->setResultList($vo_result->getPrimaryKeyValues());
$vn_page_num = 1;
//.........这里部分代码省略.........
示例14: __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);
}
}
//.........这里部分代码省略.........
示例15: Index
/**
*
*/
public function Index($pa_options = null)
{
$po_search = isset($pa_options['search']) ? $pa_options['search'] : null;
$pb_dont_render_view = isset($pa_options['dontRenderView']) && (bool) $pa_options['dontRenderView'] ? true : false;
parent::Index($pa_options);
AssetLoadManager::register('browsable');
AssetLoadManager::register('hierBrowser');
$va_access_values = caGetUserAccessValues($this->request);
//
// Restrict facets to specific group for main browse landing page (if set in app.conf config)
//
if ($vs_facet_group = $this->request->config->get($this->ops_tablename . '_browse_facet_group')) {
$this->opo_browse->setFacetGroup($vs_facet_group);
}
//
// Set useful values we'll need later
//
$t_model = $this->opo_datamodel->getInstanceByTableName($this->ops_tablename, true);
$vb_criteria_have_changed = $this->opo_browse->criteriaHaveChanged();
// Get elements of result context
$vn_page_num = $this->opo_result_context->getCurrentResultsPageNumber();
if ($this->opb_type_restriction_has_changed || $this->request->getParameter('reset', pString) == 'clear') {
$this->opo_browse->removeAllCriteria();
$this->opo_result_context->setSearchExpression($this->opo_browse->getBrowseID());
}
if (!($vn_items_per_page = $this->opo_result_context->getItemsPerPage())) {
$vn_items_per_page = $this->opn_items_per_page_default;
$this->opo_result_context->setItemsPerPage($vn_items_per_page);
}
if (!($vs_view = $this->opo_result_context->getCurrentView())) {
$va_tmp = array_keys($this->opa_views);
$vs_view = $this->ops_view_default ? $this->ops_view_default : array_shift($va_tmp);
$this->opo_result_context->setCurrentView($vs_view);
}
if (!isset($this->opa_views[$vs_view])) {
$va_tmp = array_keys($this->opa_views);
$vs_view = array_shift($va_tmp);
}
if (!($vs_sort = $this->opo_result_context->getCurrentSort())) {
$va_tmp = array_keys($this->opa_sorts);
$vs_sort = array_shift($va_tmp);
}
$vs_sort_direction = $this->opo_result_context->getCurrentSortDirection();
$vb_sort_has_changed = $this->opo_result_context->sortHasChanged();
if (!$vn_page_num || $vb_criteria_have_changed) {
$vn_page_num = 1;
}
// Do redirect directly to detail if configured to do so
if ($this->opo_browse->criteriaHaveChanged() && sizeof($va_criteria = $this->opo_browse->getCriteria()) == 1) {
$va_tmp = array_keys($va_criteria);
$va_tmp1 = array_keys($va_criteria[$va_tmp[0]]);
$va_facet_info = $this->opo_browse->getInfoForFacet($va_tmp[0]);
if ($this->request->config->get('redirect_to_' . $va_facet_info['table'] . '_detail_if_is_first_facet')) {
$t_table = $this->opo_datamodel->getInstanceByTableName($va_facet_info['table'], true);
$va_newmuseum_hack_occurrence_type_ids = $this->request->config->getList('newmuseum_hack_browse_should_redirect_occurrence_types_to_object_details');
if (is_array($va_newmuseum_hack_occurrence_type_ids) && sizeof($va_newmuseum_hack_occurrence_type_ids) && $va_facet_info['table'] == 'ca_occurrences') {
if ($t_table->load($va_tmp1[0])) {
if (in_array($t_table->getTypeID(), $va_newmuseum_hack_occurrence_type_ids)) {
if (sizeof($va_objects = $t_table->getRelatedItems('ca_objects'))) {
$va_object = array_shift($va_objects);
$vn_object_id = $va_object['object_id'];
$this->response->setRedirect(caNavUrl($this->request, 'Detail', 'Object', 'Show', array('object_id' => $vn_object_id)));
return;
}
}
}
}
$this->response->setRedirect(caNavUrl($this->request, 'Detail', ucfirst($t_table->getProperty('NAME_SINGULAR')), 'Show', array($t_table->primaryKey() => $va_tmp1[0])));
return;
}
}
//
// Enforce type restriction, if defined
//
$this->opo_browse->setTypeRestrictions(array($this->opn_type_restriction_id));
MetaTagManager::setWindowTitle(_t('%1 browse', $this->browseName('plural')));
//
// Actually execute the browse - do the queries
//
//if ($vs_group_name = $this->request->config->get('browse_facet_group_for_'.$this->ops_tablename)) {
// $this->opo_browse->setFacetGroup($vs_group_name);
//}
//
// Restrict facets to specific group (if set in app.conf config)
//
if ($vs_facet_group = $this->request->config->get($this->ops_tablename . ($this->opo_browse->numCriteria() < 1 ? '_browse_facet_group' : '_browse_refine_facet_group'))) {
$this->opo_browse->setFacetGroup($vs_facet_group);
}
$this->opo_browse->execute(array('checkAccess' => $va_access_values, 'no_cache' => !$this->opo_result_context->cacheIsValid()));
$this->opo_result_context->validateCache();
$this->opo_result_context->setSearchExpression($this->opo_browse->getBrowseID());
//
// Pass browse info (context + facets + criteria) to view
//
$this->view->setVar('browse', $this->opo_browse);
$this->view->setVar('target', $this->ops_tablename);
$this->view->setVar('result_context', $this->opo_result_context);
//.........这里部分代码省略.........