本文整理汇总了PHP中ca_sets类的典型用法代码示例。如果您正苦于以下问题:PHP ca_sets类的具体用法?PHP ca_sets怎么用?PHP ca_sets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ca_sets类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Index
public function Index()
{
$va_participate_ids = array();
$t_participate = new ca_sets();
# --- participate set - set name assigned in eastend.conf - plugin conf file
$t_participate->load(array('set_code' => $this->opo_plugin_config->get('participate_set_name')));
# Enforce access control on set
if (sizeof($this->opa_access_values) == 0 || sizeof($this->opa_access_values) && in_array($t_participate->get("access"), $this->opa_access_values)) {
$this->view->setVar('participate_set_id', $t_participate->get("set_id"));
$va_participate_ids = array_keys(is_array($va_tmp = $t_participate->getItemRowIDs(array('checkAccess' => $this->opa_access_values, 'shuffle' => 1))) ? $va_tmp : array());
// These are the entity ids in the set
}
# --- loop through featured ids and grab the object's image
$t_object = new ca_objects();
$va_participate_images = array();
foreach ($va_participate_ids as $vn_participate_object_id) {
$va_tmp = array();
$t_object->load($vn_participate_object_id);
$va_tmp["object_id"] = $vn_participate_object_id;
$va_image = $t_object->getPrimaryRepresentation(array("mediumlarge"));
# --- don't show records with status ars/vaga don't show image
if ($t_object->get("ca_objects.object_status") != 348) {
if ($t_object->get("ca_objects.object_status") == 349) {
$va_tmp["vaga_class"] = "vagaDisclaimer";
}
$va_tmp["image"] = $va_image["tags"]["mediumlarge"];
$va_tmp["caption"] = $t_object->get("ca_objects.caption");
$va_tmp["title"] = $t_object->getLabelForDisplay();
}
$va_participate_images[$vn_participate_object_id] = $va_tmp;
}
$this->view->setVar("participate_images", $va_participate_images);
$this->render('participate_html.php');
}
示例2: testTest
public function testTest()
{
// establish everything went ok
$this->assertEquals('TEST', $this->opt_set->get('set_code'));
// should return primary label
$this->assertEquals('Homer J. Simpson', $this->opt_set->get('ca_sets.entity_reference'));
$this->assertEquals('Homer J. Simpson', $this->opt_set->getWithTemplate('^ca_sets.entity_reference'));
}
示例3: renderWidget
public function renderWidget($ps_widget_id, &$pa_settings)
{
parent::renderWidget($ps_widget_id, $pa_settings);
$this->opo_view->setVar('request', $this->getRequest());
$t_set = new ca_sets();
$va_tables = array("ca_objects", "ca_entities", "ca_places", "ca_object_lots", "ca_storage_locations", "ca_collections", "ca_occurrences");
$va_sets = array();
foreach ($va_tables as $vs_table) {
$va_sets[$vs_table][] = caExtractValuesByUserLocale($t_set->getSets(array('table' => $vs_table, 'user_id' => $this->request->getUserID())));
}
$this->opo_view->setVar("sets_by_table", $va_sets);
return $this->opo_view->render('main_html.php');
}
示例4: Info
public function Info($pa_parameters)
{
parent::info($pa_parameters);
$vn_item_id = isset($pa_parameters['item_id']) ? $pa_parameters['item_id'] : null;
$t_set_item = new ca_set_items($vn_item_id);
$this->view->setVar('t_set', $t_set = new ca_sets($t_set_item->get('set_id')));
if ($t_set_item->getPrimaryKey()) {
$t_row_instance = $this->opo_datamodel->getInstanceByTableNum($t_set->get('table_num'), true);
$t_row_instance->load($t_set_item->get('row_id'));
$this->view->setVar('t_row_instance', $t_row_instance);
}
return $this->render('widget_set_item_info_html.php', true);
}
示例5: __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");
}
}
示例6: Index
public function Index()
{
JavascriptLoadManager::register('imageScroller');
$va_access_values = caGetUserAccessValues($this->request);
// get sets for public display
$t_list = new ca_lists();
$vn_public_set_type_id = $t_list->getItemIDFromList('set_types', $t_list->getAppConfig()->get('features_set_type'));
// get value for public access status value
$va_tmp = $t_list->getItemFromList('access_statuses', 'public_access');
$vn_public_access = $va_tmp['item_value'];
$t_set = new ca_sets();
$va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'checkAccess' => $va_access_values, 'setType' => $vn_public_set_type_id)));
$va_set_ids = array();
foreach ($va_sets as $va_set) {
$va_set_ids[] = $va_set['set_id'];
}
$this->view->setVar('sets', $va_sets);
$this->view->setVar('set_ids', $va_set_ids);
$this->view->setVar('set_display_items', ca_sets::getFirstItemsFromSets($va_set_ids, array("version" => "preview160")));
$this->render('features_landing_html.php');
}
示例7: 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_reps = $t_set_item->getRepresentations(array("mediumlarge", "small"), null, array("return_with_access" => $va_access_values));
$va_rep = array_shift($va_rep);
$this->view->setVar('t_object_representation', $t_rep = new ca_object_representations($va_rep['representation_id']));
$va_rep_display_info = caGetMediaDisplayInfo('cropped_gallery_media_overlay', $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
$this->view->setVar('rep_display_version', $va_rep_display_info['display_version']);
unset($va_display_info['display_version']);
$va_rep_display_info['poster_frame_url'] = $t_rep->getMediaUrl('media', $va_rep_display_info['poster_frame_version']);
unset($va_display_info['poster_frame_version']);
$this->view->setVar('rep_display_options', $va_rep_display_info);
$va_set_item_info["info"] = $va_rep['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["item_description"] = $t_set_item->get($this->opo_plugin_config->get('set_item_description_element_code'), array('convertLineBreaks' => true));
$va_set_item_info["row_id"] = $t_set_item->get("row_id");
$va_set_item_info["lesson"] = $t_set_item->get('set_item_description');
$t_object = new ca_objects($t_set_item->get("row_id"));
$va_set_item_info["object_label"] = $t_object->getLabelForDisplay();
$this->view->setVar('item_info', $va_set_item_info);
$this->render($this->ops_theme . '/ajax_item_info_html.php');
}
示例8: CreateNewOrderFromCommunication
/**
*
*/
public function CreateNewOrderFromCommunication()
{
if ($pn_communication_id = $this->request->getParameter('communication_id', pInteger)) {
$t_comm = new ca_commerce_communications($pn_communication_id);
if (!$t_comm->getPrimaryKey()) {
$this->notification->addNotification(_t('Invalid message'), __NOTIFICATION_TYPE_ERROR__);
$this->CustomerInfo();
return;
}
$t_trans = new ca_commerce_transactions($t_comm->get('transaction_id'));
if (!$t_trans->getPrimaryKey()) {
$this->notification->addNotification(_t('Message is not associated with a transaction'), __NOTIFICATION_TYPE_ERROR__);
$this->CustomerInfo();
return;
}
$t_user = new ca_users($t_trans->get('user_id'));
$this->opt_order->setMode(ACCESS_WRITE);
$this->opt_order->set('transaction_id', $t_trans->getPrimaryKey());
if ($t_user->getPrimaryKey()) {
$this->opt_order->set('billing_fname', $t_user->get('fname'));
$this->opt_order->set('billing_lname', $t_user->get('lname'));
$this->opt_order->set('billing_email', $t_user->get('email'));
$this->opt_order->set('shipping_fname', $t_user->get('fname'));
$this->opt_order->set('shipping_lname', $t_user->get('lname'));
$this->opt_order->set('shipping_email', $t_user->get('email'));
// Pre-populate order with user's profile address
$va_mapping = array('billing_organization' => 'user_profile_organization', 'billing_address1' => 'user_profile_address1', 'billing_address2' => 'user_profile_address2', 'billing_city' => 'user_profile_city', 'billing_zone' => 'user_profile_state', 'billing_postal_code' => 'user_profile_postalcode', 'billing_country' => 'user_profile_country', 'billing_phone' => 'user_profile_phone', 'billing_fax' => 'user_profile_fax', 'shipping_organization' => 'user_profile_organization', 'shipping_address1' => 'user_profile_address1', 'shipping_address2' => 'user_profile_address2', 'shipping_city' => 'user_profile_city', 'shipping_zone' => 'user_profile_state', 'shipping_postal_code' => 'user_profile_postalcode', 'shipping_country' => 'user_profile_country', 'shipping_phone' => 'user_profile_phone', 'shipping_fax' => 'user_profile_fax');
foreach ($va_mapping as $vs_field => $vs_pref) {
$this->opt_order->set($vs_field, $t_user->getPreference($vs_pref));
}
}
$this->opt_order->set('order_type', 'L');
// L=loan
$this->opt_order->insert();
$this->request->setParameter('order_id', $this->opt_order->getPrimaryKey());
if (!$this->opt_order->numErrors()) {
$this->notification->addNotification(_t('Saved changes'), __NOTIFICATION_TYPE_INFO__);
// Add items
$t_set = new ca_sets($t_trans->get('set_id'));
if ($t_set->getPrimaryKey()) {
$va_items = $t_set->getItems();
foreach ($va_items as $va_item_list) {
foreach ($va_item_list as $vn_i => $va_item) {
if (!is_array($va_item['selected_services'])) {
//$va_item['selected_services'] = array('DIGITAL_COPY'); // TODO: make default configurable
}
foreach ($va_item['selected_services'] as $vs_service) {
if ($t_item = $this->opt_order->addItem($va_item['row_id'], array('service' => $vs_service), array('representations_ids' => is_array($va_item['selected_representations']) && sizeof($va_item['selected_representations']) ? $va_item['selected_representations'] : null))) {
$t_item->updateFee();
}
}
}
}
// Delete originating set if configured to do so
if ($this->opo_client_services_config->get('set_disposal_policy') == 'DELETE_WHEN_ORDER_CREATED') {
$t_set->setMode(ACCESS_WRITE);
$t_set->delete(true);
}
}
} else {
$va_errors['general'] = $this->opt_order->errors();
$this->notification->addNotification(_t('Errors occurred: %1', join('; ', $this->opt_order->getErrors())), __NOTIFICATION_TYPE_ERROR__);
}
$this->view->setVar('errors', $va_errors);
}
$this->OrderOverview();
}
示例9: addItem
/**
* Add item as specified in request body array. Can also be used to
* add item directly. If both parameters are set, the request data
* is ignored.
* @param null|string $ps_table optional table name. if not set, table name is taken from request
* @param null|array $pa_data optional array with item data. if not set, data is taken from request body
* @return array|bool
*/
public function addItem($ps_table = null, $pa_data = null)
{
if (!$ps_table) {
$ps_table = $this->ops_table;
}
if (!($t_instance = $this->_getTableInstance($ps_table))) {
return false;
}
$t_locales = new ca_locales();
if (!$pa_data || !is_array($pa_data)) {
$pa_data = $this->getRequestBodyArray();
}
// intrinsic fields
if (is_array($pa_data["intrinsic_fields"]) && sizeof($pa_data["intrinsic_fields"])) {
foreach ($pa_data["intrinsic_fields"] as $vs_field_name => $vs_value) {
$t_instance->set($vs_field_name, $vs_value);
}
} else {
$this->addError(_t("No intrinsic fields specified"));
return false;
}
// attributes
if (is_array($pa_data["attributes"]) && sizeof($pa_data["attributes"])) {
foreach ($pa_data["attributes"] as $vs_attribute_name => $va_values) {
foreach ($va_values as $va_value) {
if ($va_value["locale"]) {
$va_value["locale_id"] = $t_locales->localeCodeToID($va_value["locale"]);
unset($va_value["locale"]);
}
$t_instance->addAttribute($va_value, $vs_attribute_name);
}
}
}
$t_instance->setMode(ACCESS_WRITE);
$t_instance->insert();
if (!$t_instance->getPrimaryKey()) {
$this->opa_errors = array_merge($t_instance->getErrors(), $this->opa_errors);
return false;
}
// AFTER INSERT STUFF
// preferred labels
if (is_array($pa_data["preferred_labels"]) && sizeof($pa_data["preferred_labels"])) {
foreach ($pa_data["preferred_labels"] as $va_label) {
if ($va_label["locale"]) {
$vn_locale_id = $t_locales->localeCodeToID($va_label["locale"]);
unset($va_label["locale"]);
}
$t_instance->addLabel($va_label, $vn_locale_id, null, true);
}
}
// nonpreferred labels
if (is_array($pa_data["nonpreferred_labels"]) && sizeof($pa_data["nonpreferred_labels"])) {
foreach ($pa_data["nonpreferred_labels"] as $va_label) {
if ($va_label["locale"]) {
$vn_locale_id = $t_locales->localeCodeToID($va_label["locale"]);
unset($va_label["locale"]);
}
if ($va_label["type_id"]) {
$vn_type_id = $va_label["type_id"];
unset($va_label["type_id"]);
} else {
$vn_type_id = null;
}
$t_instance->addLabel($va_label, $vn_locale_id, $vn_type_id, false);
}
}
// relationships
if (is_array($pa_data["related"]) && sizeof($pa_data["related"]) > 0) {
foreach ($pa_data["related"] as $vs_table => $va_relationships) {
if ($vs_table == 'ca_sets') {
foreach ($va_relationships as $va_relationship) {
$t_set = new ca_sets();
if ($t_set->load($va_relationship)) {
$t_set->addItem($t_instance->getPrimaryKey());
}
}
} else {
foreach ($va_relationships as $va_relationship) {
$vs_source_info = isset($va_relationship["source_info"]) ? $va_relationship["source_info"] : null;
$vs_effective_date = isset($va_relationship["effective_date"]) ? $va_relationship["effective_date"] : null;
$vs_direction = isset($va_relationship["direction"]) ? $va_relationship["direction"] : null;
$t_rel_instance = $this->_getTableInstance($vs_table);
$vs_pk = isset($va_relationship[$t_rel_instance->primaryKey()]) ? $va_relationship[$t_rel_instance->primaryKey()] : null;
$vs_type_id = isset($va_relationship["type_id"]) ? $va_relationship["type_id"] : null;
$t_rel = $t_instance->addRelationship($vs_table, $vs_pk, $vs_type_id, $vs_effective_date, $vs_source_info, $vs_direction);
// deal with interstitial attributes
if ($t_rel instanceof BaseRelationshipModel) {
$vb_have_to_update = false;
if (is_array($va_relationship["attributes"]) && sizeof($va_relationship["attributes"])) {
foreach ($va_relationship["attributes"] as $vs_attribute_name => $va_values) {
foreach ($va_values as $va_value) {
if ($va_value["locale"]) {
//.........这里部分代码省略.........
示例10: _t
?>
</div>
<div style="margin-top:10px;" class="caption">
<?php
print _t("Or click \"Browse\" in the navigation bar to do a refined browse");
?>
</div>
</div> -->
</div><!-- end quickLinkItems -->
<?php
JavascriptLoadManager::register('cycle');
$t_slider = new ca_sets();
$t_slider->load(array('set_code' => 'siteFeatured'));
//$va_items = $t_slider->getItems(array('thumbnailVersions' => array('medium', 'mediumlarge'), 'checkAccess' => $va_access_values));
$va_images = $t_slider->getRepresentationTags('widesplash', array('checkAccess' => $va_access_values, 'quote' => true));
$t_slider = new ca_sets();
$t_slider->load(array('set_code' => 'cultureFeatured'));
//$va_items = $t_slider->getItems(array('thumbnailVersions' => array('medium', 'mediumlarge'), 'checkAccess' => $va_access_values));
$va_images2 = $t_slider->getRepresentationTags('widesplash', array('checkAccess' => $va_access_values, 'quote' => true));
?>
<script type="text/javascript">
caUI.initCycle('#hpSlider', {
fx: 'fade',
imageList: [
<?php
print join(",\n", $va_images);
?>
],
duration: 30000,
rewindDuration: 30000,
示例11: caGetUserAccessValues
<?php
require_once __CA_MODELS_DIR__ . "/ca_sets.php";
include_once __CA_LIB_DIR__ . "/ca/Search/OccurrenceSearch.php";
include_once __CA_MODELS_DIR__ . "/ca_occurrences.php";
$va_access_values = caGetUserAccessValues($this->request);
if ($vs_set_code = $this->request->config->get("featured_art_set")) {
AssetLoadManager::register("carousel");
$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)) {
$va_item_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
}
if (is_array($va_item_ids) && sizeof($va_item_ids)) {
$t_object = new ca_objects();
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("slideshowsmall"), array('checkAccess' => caGetUserAccessValues($this->request)));
}
}
?>
<div class="container">
<div class="row collection">
<div class="col-sm-6">
<div class="advSearch">
<h1>Search Collection</h1>
{{{form}}}
<div class="advancedSearchField">
Title:<br/>
{{{ca_objects.preferred_labels.name%width=220px}}}
</div>
示例12: caEditorInspector
/**
* Generates standard-format inspector panels for editors
*
* @param View $po_view Inspector view object
* @param array $pa_options Optional array of options. Supported options are:
* backText = a string to use as the "back" button text; default is "Results"
*
* @return string HTML implementing the inspector
*/
function caEditorInspector($po_view, $pa_options = null)
{
require_once __CA_MODELS_DIR__ . '/ca_sets.php';
require_once __CA_MODELS_DIR__ . '/ca_data_exporters.php';
$t_item = $po_view->getVar('t_item');
$vs_table_name = $t_item->tableName();
if (($vs_priv_table_name = $vs_table_name) == 'ca_list_items') {
$vs_priv_table_name = 'ca_lists';
}
$vn_item_id = $t_item->getPrimaryKey();
$o_result_context = $po_view->getVar('result_context');
$t_ui = $po_view->getVar('t_ui');
$t_type = method_exists($t_item, "getTypeInstance") ? $t_item->getTypeInstance() : null;
$vs_type_name = method_exists($t_item, "getTypeName") ? $t_item->getTypeName() : '';
if (!$vs_type_name) {
$vs_type_name = $t_item->getProperty('NAME_SINGULAR');
}
$va_reps = $po_view->getVar('representations');
$o_dm = Datamodel::load();
if ($t_item->isHierarchical()) {
$va_ancestors = $po_view->getVar('ancestors');
$vn_parent_id = $t_item->get($t_item->getProperty('HIERARCHY_PARENT_ID_FLD'));
} else {
$va_ancestors = array();
$vn_parent_id = null;
}
// action extra to preserve currently open screen across next/previous links
$vs_screen_extra = $po_view->getVar('screen') ? '/' . $po_view->getVar('screen') : '';
if ($vs_type_name == "list item") {
$vs_style = "style='height:auto;'";
}
if ($vn_item_id | $po_view->request->getAction() === 'Delete') {
$vs_buf = '<h3 class="nextPrevious" ' . $vs_style . '>' . caEditorFindResultNavigation($po_view->request, $t_item, $o_result_context, $pa_options) . "</h3>\n";
}
$vs_color = null;
if ($t_type) {
$vs_color = trim($t_type->get('color'));
}
if (!$vs_color && $t_ui) {
$vs_color = trim($t_ui->get('color'));
}
if (!$vs_color) {
$vs_color = "FFFFFF";
}
$vs_buf .= "<h4><div id='caColorbox' style='border: 6px solid #{$vs_color};'>\n";
$vs_icon = null;
if ($t_type) {
$vs_icon = $t_type->getMediaTag('icon', 'icon');
}
if (!$vs_icon && $t_ui) {
$vs_icon = $t_ui->getMediaTag('icon', 'icon');
}
if ($vs_icon) {
$vs_buf .= "<div id='inspectoricon' style='border-right: 6px solid #{$vs_color}; border-bottom: 6px solid #{$vs_color}; -moz-border-radius-bottomright: 8px; -webkit-border-bottom-right-radius: 8px;'>\n{$vs_icon}</div>\n";
}
if ($po_view->request->getAction() === 'Delete' && $po_view->request->getParameter('confirm', pInteger)) {
$vs_buf .= "<strong>" . _t("Deleted %1", $vs_type_name) . "</strong>\n";
$vs_buf .= "<br style='clear: both;'/></div></h4>\n";
} else {
if ($vn_item_id) {
if (!$po_view->request->config->get("{$vs_priv_table_name}_inspector_disable_headline")) {
if ($po_view->request->user->canDoAction("can_edit_" . $vs_priv_table_name) && sizeof($t_item->getTypeList()) > 1) {
$vs_buf .= "<strong>" . _t("Editing %1", $vs_type_name) . ": </strong>\n";
} else {
$vs_buf .= "<strong>" . _t("Viewing %1", $vs_type_name) . ": </strong>\n";
}
}
if ($t_item->hasField('is_deaccessioned') && $t_item->get('is_deaccessioned') && $t_item->get('deaccession_date', array('getDirectDate' => true)) <= caDateToHistoricTimestamp(_t('now'))) {
// If currently deaccessioned then display deaccession message
$vs_buf .= "<br/><div class='inspectorDeaccessioned'>" . _t('Deaccessioned %1', $t_item->get('deaccession_date')) . "</div>\n";
if ($vs_deaccession_notes = $t_item->get('deaccession_notes')) {
TooltipManager::add(".inspectorDeaccessioned", $vs_deaccession_notes);
}
} else {
if ($po_view->request->user->canDoAction('can_see_current_location_in_inspector_ca_objects')) {
if ($t_ui && method_exists($t_item, "getObjectHistory") && (is_array($va_placements = $t_ui->getPlacementsForBundle('ca_objects_history')) && sizeof($va_placements) > 0)) {
//
// Output current "location" of object in life cycle. Configuration is taken from a ca_objects_history bundle configured for the current editor
//
$va_placement = array_shift($va_placements);
$va_bundle_settings = $va_placement['settings'];
if (is_array($va_history = $t_item->getObjectHistory($va_bundle_settings, array('limit' => 1, 'currentOnly' => true))) && sizeof($va_history) > 0) {
$va_current_location = array_shift(array_shift($va_history));
if (!($vs_inspector_current_location_label = $po_view->request->config->get("ca_objects_inspector_current_location_label"))) {
$vs_inspector_current_location_label = _t('Current');
}
if ($va_current_location['display']) {
$vs_buf .= "<div class='inspectorCurrentLocation'><strong>" . $vs_inspector_current_location_label . ':</strong><br/>' . $va_current_location['display'] . "</div>";
}
}
} elseif (method_exists($t_item, "getLastLocationForDisplay")) {
//.........这里部分代码省略.........
示例13: getSetItemInfo
public function getSetItemInfo()
{
$pn_item_id = $this->request->getParameter('item_id', pInteger);
$pn_set_id = $this->request->getParameter('set_id', pInteger);
$t_set = new ca_sets($pn_set_id);
$t_set_item = new ca_set_items($pn_item_id);
$t_object = new ca_objects($t_set_item->get("row_id"));
$va_set_item_ids = array_keys($t_set->getItemIDs(array("checkAccess" => $this->opa_access_values)));
$this->view->setVar("set_num_items", sizeof($va_set_item_ids));
$this->view->setVar("set_item_num", array_search($pn_item_id, $va_set_item_ids) + 1);
$this->view->setVar("object", $t_object);
$this->view->setVar("object_id", $t_set_item->get("row_id"));
$this->view->setVar("label", $t_object->getLabelForDisplay());
//
// Tag substitution
//
// Views can contain tags in the form {{{tagname}}}. Some tags, such as "label" are defined by
// this controller. More usefully, you can pull data from the item being detailed by using a valid "get" expression
// as a tag (Eg. {{{ca_objects.idno}}}. Even more usefully for some, you can also use a valid bundle display template
// (see http://docs.collectiveaccess.org/wiki/Bundle_Display_Templates) as a tag. The template will be evaluated in the
// context of the item being detailed.
//
$va_defined_vars = array_keys($this->view->getAllVars());
// get list defined vars (we don't want to copy over them)
$va_tag_list = $this->getTagListForView("Gallery/set_item_info_html.php");
// get list of tags in view
foreach ($va_tag_list as $vs_tag) {
if (in_array($vs_tag, $va_defined_vars)) {
continue;
}
if (strpos($vs_tag, "^") !== false || strpos($vs_tag, "<") !== false) {
$this->view->setVar($vs_tag, $t_object->getWithTemplate($vs_tag, array('checkAccess' => $this->opa_access_values)));
} elseif (strpos($vs_tag, ".") !== false) {
$this->view->setVar($vs_tag, $t_object->get($vs_tag, array('checkAccess' => $this->opa_access_values)));
} else {
$this->view->setVar($vs_tag, "?{$vs_tag}");
}
}
$this->render("Gallery/set_item_info_html.php");
}
示例14: ca_objects
<?php
$t_object = new ca_objects();
$t_featured = new ca_sets();
$t_featured->load(array('set_code' => $this->request->config->get('featured_set_name')));
# Enforce access control on set
if (sizeof($va_access_values) && !in_array($t_featured->get("access"), $va_access_values)) {
$t_featured = new ca_sets();
}
$va_featured = array();
if (is_array($va_row_ids = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values)))) {
$va_featured_ids = array_keys($va_row_ids);
// These are the object ids in the set
foreach ($va_featured_ids as $vn_f_object_id) {
$t_object = new ca_objects($vn_f_object_id);
$va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
$va_featured[$vn_f_object_id] = $va_reps["tags"]["preview"];
$vs_featured_content_label = $t_object->getLabelForDisplay();
}
} else {
# --- get random objects
$va_random_ids = $t_object->getRandomItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
if (is_array($va_random_ids) && sizeof($va_random_ids) > 0) {
$va_random = array();
foreach ($va_random_ids as $va_item_info) {
$vn_rand_object_id = $va_item_info['object_id'];
$t_object->load($vn_rand_object_id);
$va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
$va_random[$vn_rand_object_id] = $va_reps["tags"]["preview"];
$vs_featured_content_label = $t_object->getLabelForDisplay();
}
示例15: _t
$va_errors = $this->getVar("errors");
?>
<div id="caFormOverlay"><div class="pull-right pointer" onclick="caMediaPanel.hidePanel(); return false;"><span class="glyphicon glyphicon-remove-circle"></span></div>
<H1><?php
print _t("Add item to lightbox");
?>
</H1>
<?php
if ($va_errors["general"]) {
print "<div class='alert alert-danger'>" . $va_errors["general"] . "</div>";
}
?>
<form id="AddItemForm" action="#" class="form-horizontal" role="form">
<?php
if (is_array($va_write_sets) && sizeof($va_write_sets)) {
$t_write_set = new ca_sets();
print "<div class='form-group'><div class='col-sm-offset-4 col-sm-7'><select name='set_id' class='form-control'>";
print "<option value=''>" . _t("Select a lightbox") . "</option>\n";
foreach ($va_write_sets as $va_write_set) {
$t_write_set->load($va_write_set["set_id"]);
print "<option value='" . $va_write_set["set_id"] . "'>" . $t_write_set->getLabelForDisplay() . "</option>\n";
}
print "</select>\n";
print "</div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
print "<div class='form-group'><div class='col-sm-offset-4 col-sm-7'><H3>" . _t("OR Create a New Lightbox") . "</H3></div></div><!-- end form-group -->\n";
}
print "<div class='form-group'><label for='name' class='col-sm-4 control-label'>" . _t("Name") . "</label><div class='col-sm-7'><input type='text' name='name' placeholder='Your lightbox' class='form-control'></div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
#print $t_set->htmlFormElement("access","<div class='form-group'><label for='access' class='col-sm-4 control-label'>"._t("Display Option")."</label><div class='col-sm-7' class='form-control'>^ELEMENT</div><!-- end col-sm-7 --></div><!-- end form-group -->\n", array("classname" => "form-control"));
print "<div class='form-group'><label for='description' class='col-sm-4 control-label'>" . _t("Description") . "</label><div class='col-sm-7'><textarea name='description' class='form-control' rows='3'></textarea></div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
?>
<div class="form-group">