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")); }
// number of hits to display per block $vn_start = (int) $this->getVar('start'); // offset to seek to before outputting results $va_views = $this->getVar('views'); $vs_current_view = $this->getVar('view'); $va_view_icons = $this->getVar('viewIcons'); $vs_current_sort = $this->getVar('sort'); $t_instance = $this->getVar('t_instance'); $vs_table = $this->getVar('table'); $vs_pk = $this->getVar('primaryKey'); $va_access_values = caGetUserAccessValues($this->request); $o_config = $this->getVar("config"); $va_options = $this->getVar('options'); $vs_extended_info_template = caGetOption('extendedInformationTemplate', $va_options, null); $vb_ajax = (bool) $this->request->isAjax(); $o_set_config = caGetSetsConfig(); $vs_lightbox_icon = $o_set_config->get("add_to_lightbox_icon"); if (!$vs_lightbox_icon) { $vs_lightbox_icon = "<i class='fa fa-suitcase'></i>"; } if (!($vs_placeholder = $o_config->get("placeholder_media_icon"))) { $vs_placeholder = "<i class='fa fa-picture-o fa-2x'></i>"; } $vs_placeholder_tag = "<div class='bResultItemImgPlaceholder'>" . $vs_placeholder . "</div>"; $vn_col_span = 3; $vn_col_span_sm = 4; $vb_refine = false; if (is_array($va_facets) && sizeof($va_facets)) { $vb_refine = true; $vn_col_span = 3; $vn_col_span_sm = 6;
function caGetSetDisplayName($o_set_config = null) { if (!$o_set_config) { $o_set_config = caGetSetsConfig(); } $vs_set_display_name = $o_set_config->get("set_display_name"); if (!$vs_set_display_name) { $vs_set_display_name = _t("lightbox"); } $vs_set_display_name_plural = $o_set_config->get("set_display_name_plural"); if (!$vs_set_display_name_plural) { $vs_set_display_name_plural = _t("lightboxes"); } $vs_set_section_heading = $o_set_config->get("set_section_heading"); if (!$vs_set_section_heading) { $vs_set_section_heading = _t("lightboxes"); } return array("singular" => $vs_set_display_name, "plural" => $vs_set_display_name_plural, "section_heading" => $vs_set_section_heading); }
/** * Returns the info for each set item * * options: "write_access" = false * */ function caLightboxSetDetailItem($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; } $o_config = caGetSetsConfig(); if (!($vs_placeholder = $o_config->get("placeholder_media_icon"))) { $vs_placeholder = "<i class='fa fa-picture-o fa-2x'></i>"; } $vs_caption = ""; $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; }