本文整理汇总了PHP中caGetUserAccessValues函数的典型用法代码示例。如果您正苦于以下问题:PHP caGetUserAccessValues函数的具体用法?PHP caGetUserAccessValues怎么用?PHP caGetUserAccessValues使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caGetUserAccessValues函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Index
public function Index()
{
$t_occurrence = new ca_occurrences();
if ($this->request->config->get("dont_enforce_access_settings")) {
$va_access_values = array();
} else {
$va_access_values = caGetUserAccessValues($this->request);
}
# --- get the most viewed occ records
$va_occ_info = array();
$va_most_viewed_occs = $t_occurrence->getMostViewedItems(3, array('checkAccess' => $va_access_values));
foreach ($va_most_viewed_occs as $vn_occurrence_id => $va_occ_info) {
$t_occurrence->load($vn_occurrence_id);
$va_occ_info['title'] = $t_occurrence->getLabelForDisplay();
$va_preview_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "widepreview", "showMediaInfo" => false, "returnAsArray" => true));
if (sizeof($va_preview_stills) > 0) {
$va_occ_info["mediaPreview"] = array_shift($va_preview_stills);
}
$va_medium_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "medium", "showMediaInfo" => false, "returnAsArray" => true));
if (sizeof($va_medium_stills) > 0) {
$va_occ_info["mediaMedium"] = array_shift($va_medium_stills);
}
$va_occ_info["repository"] = $t_occurrence->get("CLIR2_institution", array('convertCodesToDisplayText' => true));
$va_most_viewed_occs[$vn_occurrence_id] = $va_occ_info;
}
$this->view->setVar('most_viewed_occs', $va_most_viewed_occs);
$this->render('Engage/engage_index_html.php');
}
示例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/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');
}
示例3: recentlyAdded
function recentlyAdded()
{
// 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"));
}
$t_object = new ca_objects();
if (($vn_num_items = (int) $this->request->config->get('rss_number_of_items')) <= 0) {
$vn_num_items = 10;
}
$va_recently_added_objects = $t_object->getRecentlyAddedItems($vn_num_items, array('checkAccess' => caGetUserAccessValues($this->request)));
$va_entries = array();
$va_object_ids = array();
foreach ($va_recently_added_objects as $va_object) {
$va_object_ids[] = $va_object['object_id'];
}
$qr_res = $t_object->makeSearchResult('ca_objects', $va_object_ids);
$vs_description_bundle = $this->request->config->get('rss_description');
while ($qr_res->nextHit()) {
$vn_object_id = $qr_res->get('ca_objects.object_id');
if (!($vn_creation_time = $t_object->getCreationTimestamp($vn_object_id, array('timestampOnly' => true)))) {
$vn_creation_time = time();
}
if (!($vn_update_time = $t_object->getLastChangeTimestamp($vn_object_id, array('timestampOnly' => true)))) {
$vn_update_time = time();
}
$va_entries[] = array('title' => $qr_res->get('ca_objects.preferred_labels.name'), 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => $vn_update_time, 'description' => $vs_description_bundle ? $qr_res->getMediaTag("ca_object_representations.media", "preview") . "\n" . $qr_res->get($vs_description_bundle) : '', 'pubDate' => $vn_creation_time);
}
$va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
$o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
$this->view->setVar('feed', $o_feed);
$this->render('Feed/feed_recently_added_xml.php');
}
示例4: recentlyAdded
function recentlyAdded()
{
// 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"));
}
$t_object = new ca_objects();
$va_recently_added_objects = $t_object->getRecentlyAddedItems(25, array('checkAccess' => caGetUserAccessValues($this->request)));
$va_entries = array();
$va_object_ids = array();
foreach ($va_recently_added_objects as $va_object) {
$va_object_ids[] = $va_object['object_id'];
}
$va_labels = $t_object->getPreferredDisplayLabelsForIDs($va_object_ids);
// TODO: Need to get object descriptions and last update times properly
foreach ($va_labels as $vn_object_id => $vs_label) {
$va_entries[] = array('title' => $vs_label, 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => time(), 'description' => '', 'pubDate' => time());
}
$va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
$o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
$this->view->setVar('feed', $o_feed);
$this->render('Feed/feed_recently_added_xml.php');
}
示例5: __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);
}
示例6: getMapItemInfo
/**
* Ajax action that returns info on a mapped location based upon the 'id' request parameter.
* 'id' is a list of object_ids to display information before. Each integer id is separated by a semicolon (";")
* The "ca_objects_results_map_balloon_html" view in Results/ is used to render the content.
*/
public function getMapItemInfo()
{
$pa_object_ids = explode(';', $this->request->getParameter('id', pString));
$va_access_values = caGetUserAccessValues($this->request);
$this->view->setVar('ids', $pa_object_ids);
$this->view->setVar('access_values', $va_access_values);
$this->render("Results/ca_objects_results_map_balloon_html.php");
}
示例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->opa_access_values = caGetUserAccessValues($po_request);
caSetPageCSSClasses(array("listing"));
}
示例8: displaySet
public function displaySet()
{
$pn_set_id = $this->request->getParameter('set_id', pInteger);
$t_set = new ca_sets($pn_set_id);
$t_list = new ca_lists();
$va_access_values = caGetUserAccessValues($this->request);
$this->view->setVar('t_set', $t_set);
$this->view->setVar('set_presentation_types', caExtractValuesByUserLocale($t_list->getItemsForList('set_presentation_types')));
$this->view->setVar('access_values', $va_access_values);
$this->render('features_contents_html.php');
}
示例9: __construct
/**
*
*/
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
if (!$this->request->isAjax() && $this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
$this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
}
$this->opa_access_values = caGetUserAccessValues($po_request);
$this->view->setVar("access_values", $this->opa_access_values);
$this->view->setVar("find_type", $this->ops_find_type);
caSetPageCSSClasses(array("browse", "results"));
}
示例10: __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->opa_access_values = caGetUserAccessValues($this->request);
$this->view->setVar("access_values", $this->opa_access_values);
$t_user_groups = new ca_user_groups();
$this->opa_user_groups = $t_user_groups->getGroupList("name", "desc", $this->request->getUserID());
$this->view->setVar("user_groups", $this->opa_user_groups);
$this->opo_config = caGetSetsConfig();
caSetPageCSSClasses(array("sets"));
}
示例11: __call
/**
*
*/
public function __call($ps_function, $pa_args)
{
AssetLoadManager::register("carousel");
$va_access_values = caGetUserAccessValues($this->request);
$this->view->setVar('access_values', $va_access_values);
#
# --- if there is a set configured to show on the front page, load it now
#
$va_featured_ids = array();
if ($vs_set_code = $this->config->get("front_page_set_code")) {
$t_set = new ca_sets();
$t_set->load(array('set_code' => $vs_set_code));
# Enforce access control on set
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
$this->view->setVar('featured_set_id', $t_set->get("set_id"));
$this->view->setVar('featured_set', $t_set);
$va_featured_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
$this->view->setVar('featured_set_item_ids', $va_featured_ids);
$this->view->setVar('featured_set_items_as_search_result', caMakeSearchResult('ca_objects', $va_featured_ids));
}
}
#
# --- no configured set/items in set so grab random objects with media
#
if (sizeof($va_featured_ids) == 0) {
$t_object = new ca_objects();
$va_featured_ids = array_keys($t_object->getRandomItems(10, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)));
$this->view->setVar('featured_set_item_ids', $va_featured_ids);
$this->view->setVar('featured_set_items_as_search_result', caMakeSearchResult('ca_objects', $va_featured_ids));
}
$this->view->setVar('config', $this->config);
$o_result_context = new ResultContext($this->request, 'ca_objects', 'front');
$this->view->setVar('result_context', $o_result_context);
$o_result_context->setAsLastFind();
//
// Try to load selected page if it exists in Front/, otherwise load default Front/front_page_html.php
//
$ps_function = preg_replace("![^A-Za-z0-9_\\-]+!", "", $ps_function);
$vs_path = "Front/{$ps_function}_html.php";
if (file_exists(__CA_THEME_DIR__ . "/views/{$vs_path}")) {
$this->render($vs_path);
} else {
$this->render("Front/front_page_html.php");
}
}
示例12: __construct
public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
{
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->config = Configuration::load(__CA_THEME_DIR__ . '/conf/search.conf');
$this->opa_search_blocks = $this->config->getAssoc('multisearchTypes');
// Create result context for each block
$va_tables = array();
foreach ($this->opa_search_blocks as $vs_block => $va_block_info) {
$va_tables[$va_block_info['table']] = 1;
$this->opa_result_contexts[$vs_block] = new ResultContext($po_request, $va_block_info['table'], $this->ops_find_type, $vs_block);
$this->opa_result_contexts[$vs_block]->setAsLastFind();
}
// Create generic contexts for each table in multisearch (no specific block); used to house search history and overall counts
// when there is more than one block for a given table
foreach (array_keys($va_tables) as $vs_table) {
$this->opa_result_contexts["_multisearch_{$vs_table}"] = new ResultContext($po_request, $vs_table, $this->ops_find_type);
}
$this->opa_access_values = caGetUserAccessValues($po_request);
}
示例13: getFacet
public function getFacet()
{
$va_access_values = caGetUserAccessValues($this->request);
$ps_facet_name = $this->request->getParameter('facet', pString);
if ($this->request->getParameter('clear', pInteger)) {
$this->opo_browse->removeAllCriteria();
$this->opo_browse->execute(array('checkAccess' => $va_access_values));
$this->opo_result_context->setSearchExpression($this->opo_browse->getBrowseID());
$this->opo_result_context->saveContext();
} else {
if ($this->request->getParameter('modify', pString)) {
$vm_id = $this->request->getParameter('id', pString);
$this->opo_browse->removeCriteria($ps_facet_name, array($vm_id));
$this->opo_browse->execute(array('checkAccess' => $va_access_values));
$this->view->setVar('modify', $vm_id);
}
}
$va_facet = $this->opo_browse->getFacet($ps_facet_name, array('sort' => 'name', 'checkAccess' => $va_access_values));
$this->view->setVar('facet', $va_facet);
// leave as is for old pawtucket views
$this->view->setVar('facet_info', $va_facet_info = $this->opo_browse->getInfoForFacet($ps_facet_name));
$this->view->setVar('facet_name', $ps_facet_name);
$this->view->setVar('grouping', $vs_grouping = $this->request->getParameter('grouping', pString));
// this should be 'facet' but we don't want to render all old 'ajax_refine_facet_html' views (pawtucket themes) unusable
$this->view->setVar('grouped_facet', $this->opo_browse->getFacetWithGroups($ps_facet_name, $va_facet_info["group_mode"], $vs_grouping, array('sort' => 'name', 'checkAccess' => $va_access_values)));
// generate type menu and type value list for related authority table facet
if ($va_facet_info['type'] === 'authority') {
$t_model = $this->opo_datamodel->getTableInstance($va_facet_info['table']);
if (method_exists($t_model, "getTypeList")) {
$this->view->setVar('type_list', $t_model->getTypeList());
}
$t_rel_types = new ca_relationship_types();
$this->view->setVar('relationship_type_list', $t_rel_types->getRelationshipInfo($va_facet_info['relationship_table']));
$this->view->setVar('t_item', $t_model);
$this->view->setVar('t_subject', $this->opo_datamodel->getInstanceByTableName($this->ops_tablename, true));
}
$this->render('Search/ajax_refine_facet_html.php');
}
示例14: __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 = caGetGalleryConfig();
$this->opo_datamodel = Datamodel::load();
$va_access_values = caGetUserAccessValues($this->request);
$this->opa_access_values = $va_access_values;
# --- what is the section called - title of page
if (!($vs_section_name = $this->config->get('gallery_section_name'))) {
$vs_section_name = _t("Featured Galleries");
}
$this->view->setVar("section_name", $vs_section_name);
if (!($vs_section_item_name = $this->config->get('gallery_section_item_name'))) {
$vs_section_item_name = _t("gallery");
}
$this->view->setVar("section_item_name", $vs_section_item_name);
caSetPageCSSClasses(array("gallery"));
AssetLoadManager::register("panel");
AssetLoadManager::register("mediaViewer");
AssetLoadManager::register("carousel");
}
示例15: setItemInfo
public function setItemInfo()
{
$va_access_values = caGetUserAccessValues($this->request);
$pn_set_id = $this->request->getParameter('set_id', pInteger);
$t_set = new ca_sets($pn_set_id);
$this->view->setVar('set_id', $pn_set_id);
$pn_set_item_id = $this->request->getParameter('set_item_id', pInteger);
$t_set_item = new ca_set_items($pn_set_item_id);
$va_set_item_info = array();
$va_items = $t_set->getItemIDs(array("checkAccess" => $va_access_values));
$pn_previous_id = "";
foreach ($va_items as $vn_item_id => $va_item_info) {
if ($va_set_item_info["item_id"]) {
$va_set_item_info["next_id"] = $vn_item_id;
break;
}
if ($pn_set_item_id == $vn_item_id) {
$va_set_item_info["previous_id"] = $pn_previous_id;
$va_set_item_info["item_id"] = $vn_item_id;
}
$pn_previous_id = $vn_item_id;
}
$va_set_item_info["item_id"] = $t_set_item->get("item_id");
$va_set_item_info["info"] = $va_rep[0]['info'];
$va_set_item_info["label"] = $t_set_item->getLabelForDisplay();
$va_set_item_info["description"] = $t_set_item->get($this->opo_plugin_config->get('set_description_element_code'), array('convertLineBreaks' => true));
$va_set_item_info["row_id"] = $t_set_item->get("row_id");
$t_occurrence = new ca_occurrences($t_set_item->get("row_id"));
$va_set_item_info["label"] = $t_occurrence->getLabelForDisplay();
$va_mediumlarge_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "mediumlarge", "showMediaInfo" => false, "returnAsArray" => true));
if (sizeof($va_mediumlarge_stills) > 0) {
$va_set_item_info["media_still"] = array_shift($va_mediumlarge_stills);
$va_image_caption = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_credit', array("returnAsArray" => true));
$vs_image_caption = array_shift($va_image_caption);
if ($vs_image_caption) {
$va_set_item_info["media_still_caption"] = $vs_image_caption;
}
}
if ($vs_video = $t_occurrence->get('ca_occurrences.ic_moving_images.ic_moving_images_media', array('version' => 'original', 'showMediaInfo' => false, 'viewer_width' => 580, 'viewer_height' => 450, 'poster_frame_version' => 'mediumlarge'))) {
$va_set_item_info["media_video"] = $vs_video;
if ($vs_video_caption = $t_occurrence->get('ca_occurrences.ic_moving_images.ic_moving_images_credit')) {
$va_set_item_info["media_video_caption"] = $vs_video_caption;
}
}
$this->view->setVar('item_info', $va_set_item_info);
$this->render('Exhibits/ajax_item_info_html.php');
}