예제 #1
0
 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");
 }
예제 #2
0
/**
 * class -> class name of <ul>
 * 
 */
function caGetGallerySetsAsList($po_request, $vs_class, $pa_options = null)
{
    $o_config = caGetGalleryConfig();
    $va_access_values = caGetUserAccessValues($po_request);
    $t_list = new ca_lists();
    $vn_gallery_set_type_id = $t_list->getItemIDFromList('set_types', $o_config->get('gallery_set_type'));
    $vs_set_list = "";
    if ($vn_gallery_set_type_id) {
        $t_set = new ca_sets();
        $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'checkAccess' => $va_access_values, 'setType' => $vn_gallery_set_type_id)));
        $vn_limit = caGetOption('limit', $pa_options, 100);
        if (sizeof($va_sets)) {
            $vs_set_list = "<ul" . ($vs_class ? " class='" . $vs_class . "'" : "") . ">\n";
            $vn_c = 0;
            foreach ($va_sets as $vn_set_id => $va_set) {
                $vs_set_list .= "<li>" . caNavLink($po_request, $va_set["name"], "", "", "Gallery", $vn_set_id) . "</li>\n";
                $vn_c++;
                if ($vn_c >= $vn_limit) {
                    break;
                }
            }
            $vs_set_list .= "</ul>\n";
        }
    }
    return $vs_set_list;
}
예제 #3
0
<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")) . "&nbsp;&nbsp;" . 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>