/** * */ 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", "iconlarge"), "checkAccess" => $this->opa_access_values)))); $pn_set_item_id = $this->request->getParameter('set_item_id', pInteger); if (!in_array($pn_set_item_id, array_keys($t_set->getItemIDs()))) { $pn_set_item_id = ""; } $this->view->setVar("set_item_id", $pn_set_item_id); 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"); } }
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'); }
public function displaySet() { # --- set info $pn_set_id = $this->request->getParameter('set_id', pInteger); $t_set = new ca_sets($pn_set_id); $va_access_values = caGetUserAccessValues($this->request); # Enforce access control if (sizeof($va_access_values) && !in_array($t_set->get("access"), $va_access_values)) { $this->notification->addNotification(_t("This set is not available for view"), "message"); $this->response->setRedirect(caNavUrl($this->request, "", "", "", "")); return; } $this->view->setVar('t_set', $t_set); $va_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('widepreview', 'medium', 'setimage'), "checkAccess" => $va_access_values))); $this->view->setVar('items', $va_items); $va_row_ids = array(); foreach ($va_items as $vn_item_id => $va_item_info) { $va_row_ids[] = $va_item_info['row_id']; } # --- all featured sets - for display in right hand column // get sets for public display $t_list = new ca_lists(); $vn_public_set_type_id = $t_list->getItemIDFromList('set_types', $t_list->getAppConfig()->get('simpleGallery_set_type')); $t_set = new ca_sets($pn_set_id); $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'checkAccess' => $va_access_values, 'setType' => $vn_public_set_type_id))); $va_set_first_items = array(); $va_set_first_items = $t_set->getFirstItemsFromSets(array_keys($va_sets), array("version" => "icon", "checkAccess" => $va_access_values)); $this->view->setVar('sets', $va_sets); $this->view->setVar('first_items_from_sets', $va_set_first_items); $this->view->setVar('set_title', $t_set->getLabelForDisplay()); $this->view->setVar('set_description', $t_set->get($this->opo_plugin_config->get('set_description_element_code'), array('convertLinkBreaks' => true))); // Needed to figure out what result context to use on details $this->opo_result_context->setParameter('set_id', $pn_set_id); $this->opo_result_context->setResultList($va_row_ids); $this->opo_result_context->setAsLastFind(); $this->opo_result_context->saveContext(); $this->render($this->ops_theme . '/set_info_html.php'); }
<div> <H1><?php print $this->getVar("section_name"); ?> </H1> <?php $o_config = caGetGalleryConfig(); $va_access_values = caGetUserAccessValues($this->request); $va_sets = $this->getVar("sets"); $va_first_items_from_set = $this->getVar("first_items_from_sets"); print "<div class='container'>"; if (is_array($va_sets) && sizeof($va_sets)) { $t_set = new ca_sets(); foreach ($va_sets as $vn_set_id => $va_set) { $t_set->load($vn_set_id); print "<div class='row'>"; print "<div class='col-sm-12 col-sm-offset-0 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3'><div class='galleryListItem'>"; $va_first_item = array_shift(array_shift($t_set->getFirstItemsFromSets(array($vn_set_id), array("version" => "small", "checkAccess" => $va_access_values)))); print "<div class='galleryListItemImg'>" . $va_first_item["representation_tag"] . "</div>"; print "<H3>" . $t_set->getLabelForDisplay() . "</H3>"; print "<p class='count'>" . $t_set->getItemCount(array("checkAccess" => $va_access_values)) . " items</p>"; if ($vs_description = $t_set->get($o_config->get('gallery_set_description_element_code'))) { print "<p><strong>" . $vs_description . "</strong></p>"; } print caNavLink($this->request, "<span class='glyphicon glyphicon-th-large'></span>", "", "", "Gallery", $t_set->get("set_id")) . " " . caNavLink($this->request, "<strong>" . _t("VIEW GALLERY") . "</strong>", "", "", "Gallery", $t_set->get("set_id")); print "<div style='clear:both;'></div></div></div></div>\n"; } } print "</div>"; ?> </div>