本文整理汇总了PHP中ca_objects::getWithTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getWithTemplate方法的具体用法?PHP ca_objects::getWithTemplate怎么用?PHP ca_objects::getWithTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getWithTemplate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetObjectInfo
/**
* Return info via ajax on selected object
*/
public function GetObjectInfo()
{
$pn_checkout_id = $this->request->getParameter('checkout_id', pInteger);
$t_checkout = new ca_object_checkouts($pn_checkout_id);
$t_user = new ca_users($t_checkout->get('user_id'));
$t_object = new ca_objects($t_checkout->get('object_id'));
$va_status = $t_object->getCheckoutStatus();
$va_checkout_config = ca_object_checkouts::getObjectCheckoutConfigForType($t_object->getTypeCode());
$va_info = array('object_id' => $t_object->getPrimaryKey(), 'idno' => $t_object->get('idno'), 'name' => $t_object->get('ca_objects.preferred_labels.name'), 'media' => $t_object->getWithTemplate('^ca_object_representations.media.icon'), 'status' => $t_object->getCheckoutStatus(), 'status_display' => $t_object->getCheckoutStatus(array('returnAsText' => true)), 'checkout_date' => $t_checkout->get('ca_object_checkouts.checkout_date', array('timeOmit' => true)), 'user_name' => $t_user->get('ca_users.fname') . ' ' . $t_user->get('ca_users.lname'), 'config' => $va_checkout_config);
$va_info['title'] = $va_info['name'] . ' (' . $va_info['idno'] . ')';
$va_info['borrower'] = _t('Borrowed by %1 on %2', $va_info['user_name'], $va_info['checkout_date']);
$this->view->setVar('data', $va_info);
$this->render('checkin/ajax_data_json.php');
}
示例2: reload_object_current_locations
/**
*
*/
public static function reload_object_current_locations($po_opts = null)
{
require_once __CA_LIB_DIR__ . "/core/Db.php";
require_once __CA_MODELS_DIR__ . "/ca_objects.php";
$o_db = new Db();
$t_object = new ca_objects();
$qr_res = $o_db->query("SELECT * FROM ca_objects");
print CLIProgressBar::start($qr_res->numRows(), _t('Starting...'));
$vn_c = 0;
while ($qr_res->nextRow()) {
$vn_object_id = $qr_res->get('object_id');
if ($t_object->load($vn_object_id)) {
print CLIProgressBar::next(1, _t('Processing %1', $t_object->getWithTemplate("^ca_objects.preferred_labels.name (^ca_objects.idno)")));
$t_object->deriveCurrentLocationForBrowse();
} else {
print CLIProgressBar::next(1, _t('Cannot load object %1', $vn_object_id));
}
$vn_c++;
}
print CLIProgressBar::finish();
CLIUtils::addMessage(_t('Processed %1 objects', $vn_c));
return true;
}
示例3: caLightboxSetDetailItemOld
/**
* Returns the info for each set item
*
* options: "write_access" = false
*
*/
function caLightboxSetDetailItemOld($po_request, $va_set_item = array(), $pa_options = array())
{
$t_set_item = new ca_set_items($va_set_item["item_id"]);
if (!$t_set_item->get("item_id")) {
return false;
}
$vb_write_access = false;
if ($pa_options["write_access"]) {
$vb_write_access = true;
}
$t_list_items = new ca_list_items($va_set_item["type_id"]);
$vs_placeholder = getPlaceholder($t_list_items->get("idno"), "placeholder_media_icon");
$vs_caption = "";
$o_config = caGetSetsConfig();
$vs_caption_template = $o_config->get("caption_template");
if ($vs_caption_template) {
$t_object = new ca_objects($va_set_item["row_id"]);
$vs_caption = $t_object->getWithTemplate($vs_caption_template);
} else {
$vs_caption = $va_set_item["set_item_label"];
}
$vs_set_item_display = "";
$vs_set_item_display .= "<div class='lbItem'><div class='lbItemContent'>\n";
#$vs_set_item_display .= "<div class='lbItem' onmouseover='jQuery(\"#lbExpandedInfo".$t_set_item->get("item_id")."\").show();' onmouseout='jQuery(\"#lbExpandedInfo".$t_set_item->get("item_id")."\").hide();'><div class='lbItemContent'>\n";
if ($va_set_item["representation_tag_medium"]) {
$vs_set_item_display .= caDetailLink($po_request, "<div class='lbItemImg'>" . $va_set_item["representation_tag_medium"] . "</div>", '', 'ca_objects', $va_set_item["row_id"]);
} else {
$vs_set_item_display .= caDetailLink($po_request, "<div class='lbItemImg lbSetImgPlaceholder'>" . $vs_placeholder . "</div>", '', 'ca_objects', $va_set_item["row_id"]);
}
$vs_set_item_display .= "<div id='comment" . $t_set_item->get("item_id") . "' class='lbSetItemComment'><!-- load comments here --></div>\n";
$vs_set_item_display .= "<div class='caption'>" . $vs_caption . "</div>\n";
$vs_set_item_display .= "</div><!-- end lbItemContent -->\n";
$vs_set_item_display .= "<div class='lbExpandedInfo' id='lbExpandedInfo" . $t_set_item->get("item_id") . "'>\n<hr>\n";
if ($vb_write_access) {
$vs_set_item_display .= "<div class='pull-right'><a href='#' class='lbItemDeleteButton' id='lbItemDelete" . $t_set_item->get("item_id") . "' title='" . _t("Remove") . "'><span class='glyphicon glyphicon-trash'></span></a></div>\n";
}
$vs_set_item_display .= "<div>" . caDetailLink($po_request, "<span class='glyphicon glyphicon-file'></span>", '', 'ca_objects', $va_set_item["row_id"], "", array("title" => _t("View Item Detail"))) . "\n";
if ($va_set_item["representation_id"]) {
$vs_set_item_display .= " <a href='#' title='" . _t("Enlarge Image") . "' onclick='caMediaPanel.showPanel(\"" . caNavUrl($po_request, '', 'Detail', 'GetRepresentationInfo', array('object_id' => $t_set_item->get("row_id"), 'representation_id' => $va_set_item["representation_id"], 'overlay' => 1)) . "\"); return false;' ><span class='glyphicon glyphicon-zoom-in'></span></a>\n";
}
$vs_set_item_display .= " <a href='#' title='" . _t("Comments") . "' onclick='jQuery(\"#comment" . $t_set_item->get("item_id") . "\").load(\"" . caNavUrl($po_request, '', 'Sets', 'AjaxListComments', array('item_id' => $t_set_item->get("item_id"), 'tablename' => 'ca_set_items', 'set_id' => $t_set_item->get("set_id"))) . "\", function(){jQuery(\"#comment" . $t_set_item->get("item_id") . "\").show();}); return false;'><span class='glyphicon glyphicon-comment'></span> <small>" . $t_set_item->getNumComments() . "</small></a></div>\n";
$vs_set_item_display .= "</div><!-- end lbExpandedInfo --></div><!-- end lbItem -->\n";
return $vs_set_item_display;
}
示例4: SaveTransaction
/**
* Return info via ajax on selected object
*/
public function SaveTransaction()
{
$pn_user_id = $this->request->getParameter('user_id', pInteger);
$ps_item_list = $this->request->getParameter('item_list', pString);
$pa_item_list = json_decode($ps_item_list, true);
$t_checkout = ca_object_checkouts::newCheckoutTransaction();
$va_ret = array('status' => 'OK', 'total' => sizeof($pa_item_list), 'errors' => array(), 'checkouts' => array());
$t_object = new ca_objects();
foreach ($pa_item_list as $vn_i => $va_item) {
if (!$t_object->load(array('object_id' => $va_item['object_id'], 'deleted' => 0))) {
continue;
}
$vs_name = $t_object->getWithTemplate("^ca_objects.preferred_labels.name (^ca_objects.idno)");
if ($va_checkout_info = $t_checkout->objectIsOut($va_item['object_id'])) {
if ($va_checkout_info['user_id'] == $pn_user_id) {
// user already has item so skip it
$va_ret['errors'][$va_item['object_id']] = _t('User already has <em>%1</em>', $vs_name);
continue;
}
try {
$vb_res = $t_checkout->reserve($va_item['object_id'], $pn_user_id, $va_item['note'], array('request' => $this->request));
if ($vb_res) {
$va_ret['checkouts'][$va_item['object_id']] = _t('Reserved <em>%1</em>', $vs_name);
} else {
$va_ret['errors'][$va_item['object_id']] = _t('Could not reserve <em>%1</em>: %2', $vs_name, join('; ', $t_checkout->getErrors()));
}
} catch (Exception $e) {
$va_ret['errors'][$va_item['object_id']] = _t('Could not reserve <em>%1</em>: %2', $vs_name, $e->getMessage());
}
} else {
try {
$vb_res = $t_checkout->checkout($va_item['object_id'], $pn_user_id, $va_item['note'], $va_item['due_date'], array('request' => $this->request));
if ($vb_res) {
$va_ret['checkouts'][$va_item['object_id']] = _t('Checked out <em>%1</em>; due date is %2', $vs_name, $va_item['due_date']);
} else {
$va_ret['errors'][$va_item['object_id']] = _t('Could not check out <em>%1</em>: %2', $vs_name, join('; ', $t_checkout->getErrors()));
}
} catch (Exception $e) {
$va_ret['errors'][$va_item['object_id']] = _t('Could not check out <em>%1</em>: %2', $vs_name, $e->getMessage());
}
}
}
$this->view->setVar('data', $va_ret);
$this->render('checkout/ajax_data_json.php');
}
示例5: foreach
print $this->render("Front/featured_set_slideshow_html.php");
?>
</div> <!--end col-sm-6-->
</div><!-- end row -->
<div class="row">
<div class="col-sm-12">
<HR/>
</div>
</div>
<div class="row">
<div class="col-sm-5 commentsImg">
<?php
if (is_array($va_comments) && sizeof($va_comments)) {
foreach ($va_comments as $va_comment) {
$t_object = new ca_objects($va_comment["row_id"]);
print $t_object->getWithTemplate('<l>^ca_object_representations.media.mediumlarge</l>', array("checkAccess" => $va_access_values));
print "<H3>" . $t_object->get("ca_objects.idno") . "</H3>";
break;
}
reset($va_comments);
} else {
print caGetThemeGraphic($this->request, 'hp_comments.jpg');
}
?>
</div>
<?php
if (is_array($va_comments) && sizeof($va_comments)) {
?>
<div class="col-sm-3 border-right border-left frontComments">
<H2>Latest Comments</H2>