$vs_controller = $this->request->getController(); switch ($vs_controller) { case "Browse": print " > Browse"; break; case "Search": print " > Search"; break; case "Object": print " > Object"; break; case "Collection": print " > Showcase"; if ($this->request->getParameter('collection_id', pInteger)) { $t_collection = new ca_collections($this->request->getParameter('collection_id', pInteger)); print " > " . $t_collection->getLabelForDisplay(); } break; case "Favorites": print " > Featured Artifacts"; break; case "LoginReg": print " > Login"; break; default: break; } ?> </p> </div>
<?php require_once __CA_MODELS_DIR__ . "/ca_collections.php"; require_once __CA_MODELS_DIR__ . '/ca_sets.php'; require_once __CA_MODELS_DIR__ . '/ca_lists.php'; $va_access_values = caGetUserAccessValues($this->request); # --- most popular collections $t_collections = new ca_collections(); $va_user_favorites_collections = $t_collections->getHighestRated(null, 5, $va_access_values); if (is_array($va_user_favorites_collections) && sizeof($va_user_favorites_collections) > 0) { $va_most_popular_collections = array(); foreach ($va_user_favorites_collections as $vn_fav_collection_id) { $t_collection = new ca_collections($vn_fav_collection_id); if ($t_collection->get("access") == 1) { $va_most_popular_collections[$vn_fav_collection_id] = $t_collection->getLabelForDisplay(); } } } # - get staff picks sets // get sets for public display $t_list = new ca_lists(); $vn_public_set_type_id = $t_list->getItemIDFromList('set_types', 'Staff Pick'); // 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_staff_picks_sets = array(); #$va_staff_picks_sets = caExtractValuesByUserLocale($t_set->getSets('ca_collections', null, $va_access_values, null, $vn_public_set_type_id)); $va_staff_picks_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_collections', 'checkAccess' => $va_access_values, "setType" => $vn_public_set_type_id))); if (is_array($va_most_popular_collections) && sizeof($va_most_popular_collections) > 0) { ?>
/** * Returns name of hierarchy for currently loaded row or, if specified, row identified by optional $pn_id parameter */ public function getHierarchyName($pn_id = null) { if (!$pn_id) { $pn_id = $this->getPrimaryKey(); } $va_ancestors = $this->getHierarchyAncestors($pn_id, array('idsOnly' => true)); if (is_array($va_ancestors) && sizeof($va_ancestors)) { $vn_parent_id = array_pop($va_ancestors); $t_collection = new ca_collections($vn_parent_id); return $t_collection->getLabelForDisplay(false); } else { if ($pn_id == $this->getPrimaryKey()) { return $this->getLabelForDisplay(true); } else { $t_collection = new ca_collections($pn_id); return $t_collection->getLabelForDisplay(false); } } }
<?php $t_featured_set = new ca_sets(); $va_access_values = caGetUserAccessValues($this->request); # --- featured collections - set_code hiddenCollections $t_featured_set->load(array('set_code' => "hiddenCollections")); #$va_featured_ids = array_keys(is_array($va_tmp = $t_featured_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array()); // These are the collection ids in the set $va_items = caExtractValuesByUserLocale($t_featured_set->getItems(array('returnItemAttributes' => array('caption')))); if (is_array($va_items) && sizeof($va_items) > 0) { $t_collection = new ca_collections(); foreach ($va_items as $vn_i => $va_set_item_info) { print "<div class='featuredCollection'>"; $vn_collection_id = $va_set_item_info["row_id"]; $t_collection->load($vn_collection_id); print caNavLink($this->request, $t_collection->getAttributesForDisplay("collection_still", null, array('version' => 'thumbnail', 'showMediaInfo' => false)), '', 'Detail', 'Collection', 'Show', array('collection_id' => $vn_collection_id)); print caNavLink($this->request, $t_collection->getLabelForDisplay(), '', 'Detail', 'Collection', 'Show', array('collection_id' => $vn_collection_id)) . "<br/>\n"; print "<div>" . $va_set_item_info["ca_attribute_caption"] . "</div>"; print "</div>"; } } ?> </div> </div><!-- end introText --> <?php if ($qr_collections->numHits() > 0) { $colLength = ceil($qr_collections->numHits() / 3); $c = 0; print "<br/><div class='subTitle'>" . _t("Work Life Collections") . "</div>"; print "<div id='hiddenCollectionList'><div class='col'>";