当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_sets::getFirstItemsFromSets方法代码示例

本文整理汇总了PHP中ca_sets::getFirstItemsFromSets方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_sets::getFirstItemsFromSets方法的具体用法?PHP ca_sets::getFirstItemsFromSets怎么用?PHP ca_sets::getFirstItemsFromSets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca_sets的用法示例。


在下文中一共展示了ca_sets::getFirstItemsFromSets方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __call

 /**
  *
  */
 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");
     }
 }
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:44,代码来源:GalleryController.php

示例2: 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');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:21,代码来源:ShowController.php

示例3: displaySet

 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');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:38,代码来源:ShowController.php

示例4: caGetGalleryConfig

<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>
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:index_html.php


注:本文中的ca_sets::getFirstItemsFromSets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。