public function Index() { $va_participate_ids = array(); $t_participate = new ca_sets(); # --- participate set - set name assigned in eastend.conf - plugin conf file $t_participate->load(array('set_code' => $this->opo_plugin_config->get('participate_set_name'))); # Enforce access control on set if (sizeof($this->opa_access_values) == 0 || sizeof($this->opa_access_values) && in_array($t_participate->get("access"), $this->opa_access_values)) { $this->view->setVar('participate_set_id', $t_participate->get("set_id")); $va_participate_ids = array_keys(is_array($va_tmp = $t_participate->getItemRowIDs(array('checkAccess' => $this->opa_access_values, 'shuffle' => 1))) ? $va_tmp : array()); // These are the entity ids in the set } # --- loop through featured ids and grab the object's image $t_object = new ca_objects(); $va_participate_images = array(); foreach ($va_participate_ids as $vn_participate_object_id) { $va_tmp = array(); $t_object->load($vn_participate_object_id); $va_tmp["object_id"] = $vn_participate_object_id; $va_image = $t_object->getPrimaryRepresentation(array("mediumlarge")); # --- don't show records with status ars/vaga don't show image if ($t_object->get("ca_objects.object_status") != 348) { if ($t_object->get("ca_objects.object_status") == 349) { $va_tmp["vaga_class"] = "vagaDisclaimer"; } $va_tmp["image"] = $va_image["tags"]["mediumlarge"]; $va_tmp["caption"] = $t_object->get("ca_objects.caption"); $va_tmp["title"] = $t_object->getLabelForDisplay(); } $va_participate_images[$vn_participate_object_id] = $va_tmp; } $this->view->setVar("participate_images", $va_participate_images); $this->render('participate_html.php'); }
protected function getAllItemInfo() { $va_info = parent::getAllItemInfo(); if ($this->getTableName() == 'ca_objects' && is_array($va_info) && sizeof($va_info) > 0) { $t_object = new ca_objects($va_info['object_id']['value']); if (!$t_object->getPrimaryKey()) { return $va_info; } // include number of 'likes' (comments) $va_info['likes'] = (int) $t_object->getNumComments(null); // include copyright holder $vs_copyright_holder = $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => 'copyright')); if ($vs_copyright_holder) { $va_info['copyright_holder'] = $vs_copyright_holder; } // include urls for reference img $va_objects = $t_object->getRelatedItems('ca_objects', array('restrictToRelationshipTypes' => 'reference')); if (!is_array($va_objects) || sizeof($va_objects) != 1) { return $va_info; } $va_object = array_shift($va_objects); $t_rel_object = new ca_objects($va_object['object_id']); $va_rep = $t_rel_object->getPrimaryRepresentation(array('preview170', 'medium', 'alhalqa1000', 'alhalqa2000')); if (!is_array($va_rep) || !is_array($va_rep['urls'])) { return $va_info; } $va_info['reference_image_urls'] = $va_rep['urls']; } return $va_info; }
protected function search($pa_bundles = null) { $va_return = parent::search($pa_bundles); if ($this->getTableName() == 'ca_objects' && is_array($va_return['results']) && sizeof($va_return['results']) > 0) { $pb_only_with_likes = (bool) $this->opo_request->getParameter('likesOnly', pInteger); foreach ($va_return['results'] as $vn_k => &$va_result) { $t_object = new ca_objects($va_result['object_id']); if (!$t_object->getPrimaryKey()) { continue; } // include number of 'likes' (comments) $va_result['likes'] = (int) $t_object->getNumComments(null); if ($pb_only_with_likes && !$va_result['likes']) { unset($va_return['results'][$vn_k]); continue; } // include copyright holder $vs_copyright_holder = $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => 'copyright')); if ($vs_copyright_holder) { $va_result['copyright_holder'] = $vs_copyright_holder; } // include urls for reference img $va_objects = $t_object->getRelatedItems('ca_objects', array('restrictToRelationshipTypes' => 'reference')); if (!is_array($va_objects) || sizeof($va_objects) != 1) { continue; } $va_object = array_shift($va_objects); $t_rel_object = new ca_objects($va_object['object_id']); $va_rep = $t_rel_object->getPrimaryRepresentation(array('preview170', 'medium', 'alhalqa1000', 'alhalqa2000')); if (!is_array($va_rep) || !is_array($va_rep['urls'])) { continue; } $va_result['reference_image_urls'] = $va_rep['urls']; } if ($this->opo_request->getParameter('sort', pString) == 'likes') { if (strtolower($this->opo_request->getParameter('sortDirection', pString)) == 'asc') { usort($va_return['results'], function ($a, $b) { return $a['likes'] - $b['likes']; }); } else { // default is desc usort($va_return['results'], function ($a, $b) { return $b['likes'] - $a['likes']; }); } } } return $va_return; }
/** * */ public function renderWidget($ps_widget_id, &$pa_settings) { parent::renderWidget($ps_widget_id, $pa_settings); $t_object = new ca_objects(); # get a random object for display $va_random_item = $t_object->getRandomItems(1, array('hasRepresentations' => 1)); if (sizeof($va_random_item) > 0) { foreach ($va_random_item as $vn_object_id => $va_object_info) { $t_object->load($vn_object_id); $va_rep = $t_object->getPrimaryRepresentation(array('medium')); $this->opo_view->setVar('object_id', $vn_object_id); $this->opo_view->setVar('image', $va_rep["tags"]["medium"]); $this->opo_view->setVar('label', $t_object->getLabelForDisplay()); } } $this->opo_view->setVar('request', $this->getRequest()); return $this->opo_view->render('main_html.php'); }
</div><!-- end col --> </div> <div class="row"> <div class='col-md-12 col-lg-12'> <H4>Loan</H4> <H6></H6> </div><!-- end col 12--> </div><!-- end row --> <div class="row"> <div class='col-xs-12 col-sm-7 col-md-6 col-lg-6'> <div class="row"> <?php $va_related_artworks = $t_item->get('ca_objects.object_id', array('checkAccess' => caGetUserAccessValues($this->request), 'returnAsArray' => true)); foreach ($va_related_artworks as $vn_id => $va_related_artwork) { $t_object = new ca_objects($va_related_artwork); $va_reps = $t_object->getPrimaryRepresentation(array('versions' => 'medium'), null, array("checkAccess" => $va_access_values, 'scaleCSSHeightTo' => '260px', 'scaleCSSWidthTo' => '220px')); print "<div class='col-xs-12 col-sm-6 col-md-6 col-lg-6 relatedLoan'>"; print "<div class='loanImg'>" . caNavLink($this->request, $va_reps['tags']['medium'], '', '', 'Detail', 'artworks/' . $va_related_artwork) . "</div>"; print "<div class='lotCaption'>"; print "<p>" . caNavLink($this->request, $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('artist'))), '', '', 'Detail', 'artworks/' . $va_related_artwork) . "</p>"; print "<p>" . caNavLink($this->request, "<i>" . $t_object->get('ca_objects.preferred_labels') . "</i>, " . $t_object->get('ca_objects.creation_date'), '', '', 'Detail', 'artworks/' . $va_related_artwork) . "</p>"; print "<p>" . $t_object->get('ca_objects.medium') . "</p>"; print "<p>" . $t_object->get('ca_objects.dimensions.display_dimensions') . "</p>"; if ($this->request->user->hasUserRole("founders_new") || $this->request->user->hasUserRole("admin") || $this->request->user->hasUserRole("curatorial_all_new") || $this->request->user->hasUserRole("curatorial_basic_new") || $this->request->user->hasUserRole("archives_new") || $this->request->user->hasUserRole("library_new")) { print "<p>" . $t_object->get('ca_objects.idno') . "</p>"; } print "</div><!-- end lotCaption -->"; print "</div>"; } ?>
?> <div class="dontmiss noh2 yellowbar"> <h1><a href="local-studies.html">My Favourites</a></h1> <?php if ($this->request->isLoggedIn()) { # --- get the last item added to the users sets $o_db = new Db(); $qr_set_item = $o_db->query("\n\t\t\t\t\t\t\t\tSELECT csi.row_id\n\t\t\t\t\t\t\t\tFROM ca_sets cs\n\t\t\t\t\t\t\t\tINNER JOIN ca_set_items AS csi ON cs.set_id = csi.set_id\n\t\t\t\t\t\t\t\tWHERE cs.user_id = ?\n\t\t\t\t\t\t\t\tORDER BY csi.item_id DESC\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t", $this->request->getUserID()); if ($qr_set_item->numRows() > 0) { while ($qr_set_item->nextRow()) { $t_lastSetObject = new ca_objects($qr_set_item->get("row_id")); if (in_array($t_lastSetObject->get("access"), $va_access_values)) { $vn_lastSetObjectId = $qr_set_item->get("row_id"); $vs_lastSetObjectLabel = $t_lastSetObject->get("preferred_labels"); $va_reps = $t_lastSetObject->getPrimaryRepresentation(array('icon'), null, array('return_with_access' => $va_access_values)); $vs_lastSetObjectIcon = $va_reps["tags"]["icon"]; $vs_lastSetObjectIconLink = caNavLink($this->request, $vs_lastSetObjectIcon, '', 'Detail', 'Object', 'Show', array('object_id' => $vn_lastSetObjectId)); } } } if ($vs_lastSetObjectIconLink) { print $vs_lastSetObjectIconLink; } else { print '<a href="local-studies.html"><img src="' . $this->request->getThemeUrlPath() . '/graphics/bookicon.jpg" alt="" title="" /></a>'; } ?> <p>Click <?php print caNavLink($this->request, _t("here"), "", "", "Sets", "index"); ?> to view your saved items. Or <?php
<?php $t_object = new ca_objects(); $t_featured = new ca_sets(); $t_featured->load(array('set_code' => $this->request->config->get('featured_set_name'))); # Enforce access control on set if (sizeof($va_access_values) && !in_array($t_featured->get("access"), $va_access_values)) { $t_featured = new ca_sets(); } $va_featured = array(); if (is_array($va_row_ids = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values)))) { $va_featured_ids = array_keys($va_row_ids); // These are the object ids in the set foreach ($va_featured_ids as $vn_f_object_id) { $t_object = new ca_objects($vn_f_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_featured[$vn_f_object_id] = $va_reps["tags"]["preview"]; $vs_featured_content_label = $t_object->getLabelForDisplay(); } } else { # --- get random objects $va_random_ids = $t_object->getRandomItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (is_array($va_random_ids) && sizeof($va_random_ids) > 0) { $va_random = array(); foreach ($va_random_ids as $va_item_info) { $vn_rand_object_id = $va_item_info['object_id']; $t_object->load($vn_rand_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_random[$vn_rand_object_id] = $va_reps["tags"]["preview"]; $vs_featured_content_label = $t_object->getLabelForDisplay(); }
public function Index() { if ($this->request->config->get("dont_enforce_access_settings")) { $va_access_values = array(); } else { $va_access_values = caGetUserAccessValues($this->request); } $t_object = new ca_objects(); $t_user_favs = new ca_sets(); // redirect user if not logged in if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) { $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form")); } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) { $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index")); } # --- user favs - highest ranked $va_user_favs = array(); $va_user_favs_ids = $t_object->getHighestRated(true, 12, $va_access_values); if (is_array($va_user_favs_ids) && sizeof($va_user_favs_ids) > 0) { foreach ($va_user_favs_ids as $vn_uf_object_id) { $t_object = new ca_objects($vn_uf_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_user_favs[$vn_uf_object_id] = $va_reps["tags"]["preview"]; } } else { # --- get random objects $this->view->setVar('user_favorites_is_random', 1); $va_random_ids = $t_object->getRandomItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (is_array($va_random_ids) && sizeof($va_random_ids) > 0) { $va_random = array(); foreach ($va_random_ids as $va_item_info) { $vn_rand_object_id = $va_item_info['object_id']; $t_object->load($vn_rand_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_random[$vn_rand_object_id] = $va_reps["tags"]["preview"]; } $va_user_favs = $va_random; } } $this->view->setVar('user_favs', $va_user_favs); # --- featured items set set_code defined in app.conf $t_featured = new ca_sets(); $t_featured->load(array('set_code' => $this->request->config->get('featured_set_name'))); # Enforce access control on set if (sizeof($va_access_values) && !in_array($t_featured->get("access"), $va_access_values)) { $t_featured = new ca_sets(); } $va_featured = array(); if (is_array($va_row_ids = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values)))) { $va_featured_ids = array_keys($va_row_ids); // These are the object ids in the set foreach ($va_featured_ids as $vn_f_object_id) { $t_object = new ca_objects($vn_f_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_featured[$vn_f_object_id] = $va_reps["tags"]["preview"]; } } else { # --- get random objects $va_random_ids = $t_object->getRandomItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (is_array($va_random_ids) && sizeof($va_random_ids) > 0) { $va_random = array(); foreach ($va_random_ids as $va_item_info) { $vn_rand_object_id = $va_item_info['object_id']; $t_object->load($vn_rand_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_random[$vn_rand_object_id] = $va_reps["tags"]["preview"]; } $va_featured = $va_random; } } $this->view->setVar('featured', $va_featured); # --- most viewed $va_most_viewed_ids = $t_object->getMostViewedItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (is_array($va_most_viewed_ids) && sizeof($va_most_viewed_ids) > 0) { $va_most_viewed = array(); foreach ($va_most_viewed_ids as $va_item_info) { $vn_r_object_id = $va_item_info['object_id']; $t_object->load($vn_r_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_most_viewed[$vn_r_object_id] = $va_reps["tags"]["preview"]; } } $this->view->setVar('most_viewed', $va_most_viewed); # --- recently added $va_recently_added_ids = $t_object->getRecentlyAddedItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (is_array($va_recently_added_ids) && sizeof($va_recently_added_ids) > 0) { $va_recently_added = array(); foreach ($va_recently_added_ids as $va_item_info) { $vn_r_object_id = $va_item_info['object_id']; $t_object->load($vn_r_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"]; } } $this->view->setVar('recently_added', $va_recently_added); $this->render('Favorites/favorites_landing_html.php'); }
/** * Displays site stats */ public function Index() { $this->view->setVar("num_objects", $this->numObjects()); $this->view->setVar("num_members", $this->numEntities(array($this->opn_member_institution_id))); $this->view->setVar("num_entities", $this->numEntities(array($this->opn_individual_id, $this->opn_family_id, $this->opn_organization_id))); $this->view->setVar("num_reps", $this->numReps()); $this->view->setVar("oldest_date", $this->oldestDate()); $this->view->setVar("median_date", $this->medianDate()); $vs_version = "preview"; $t_object = new ca_objects(); // $va_user_favorites_items = array_reverse($t_object->getHighestRated(null, 3, $this->opa_access_values)); // $va_user_favorites = array(); // if(is_array($va_user_favorites_items) && (sizeof($va_user_favorites_items) > 0)){ // foreach($va_user_favorites_items as $vn_user_favorite_id){ // $t_object->load($vn_user_favorite_id); // $va_rep = $t_object->getPrimaryRepresentation(array($vs_version), null, array('return_with_access' => $this->opa_access_values)); // $va_user_favorites[$vn_user_favorite_id] = array("image" => $va_rep['tags'][$vs_version], "label" => $t_object->getLabelForDisplay()); // } // } // $this->view->setVar("most_popular", $va_user_favorites); $o_db = new Db(); $q_most_liked = $o_db->query("SELECT ic.row_id, count(*) c\n \t\t\t\t\t\t\t\t\t\t\t\tFROM ca_item_comments ic\n \t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN ca_objects o ON ic.row_id = o.object_id\n \t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN ca_objects_x_object_representations oxr ON oxr.object_id = o.object_id\n \t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN ca_object_representations r ON oxr.representation_id = r.representation_id\n \t\t\t\t\t\t\t\t\t\t\t\tWHERE o.access = 1 AND o.deleted = 0 AND r.access = 1 AND r.deleted = 0\n \t\t\t\t\t\t\t\t\t\t\t\tGROUP BY ic.row_id order by c DESC limit 3;"); $va_user_favorites = array(); if ($q_most_liked->numRows()) { while ($q_most_liked->nextRow()) { #print $q_most_liked->get("row_id")." - "; $t_object->load($q_most_liked->get("row_id")); $va_rep = $t_object->getPrimaryRepresentation(array($vs_version), null, array('return_with_access' => $this->opa_access_values)); $va_user_favorites[$q_most_liked->get("row_id")] = array("image" => $va_rep['tags'][$vs_version], "label" => $t_object->getLabelForDisplay()); } } $this->view->setVar("most_popular", $va_user_favorites); $va_recently_added_items = $t_object->getRecentlyAddedItems(3, array('checkAccess' => $this->opa_access_values, 'hasRepresentations' => 1)); #print_r($va_recently_added_items); $va_recently_added = array(); if (is_array($va_recently_added_items) && sizeof($va_recently_added_items) > 0) { $i = 0; foreach ($va_recently_added_items as $vn_recently_added_info) { if ($i == 3) { break; } $t_object->load($vn_recently_added_info["object_id"]); $va_rep = $t_object->getPrimaryRepresentation(array($vs_version), null, array('return_with_access' => $this->opa_access_values)); if ($va_rep['tags'][$vs_version]) { $va_recently_added[$vn_recently_added_info["object_id"]] = array("image" => $va_rep['tags'][$vs_version], "label" => $t_object->getLabelForDisplay()); $i++; } } } $this->view->setVar("recently_added", $va_recently_added); # --- timestamp for 60 days ago $vn_timestamp = time() - 24 * 60 * 60 * 60; $this->view->setVar("createdLast60Days", $this->recentlyAdded($vn_timestamp)); $this->view->setVar("topThemes", $this->topThemes()); $this->render('dashboard_html.php'); }
public function getFeaturedArtistSlideshow() { $va_featured_ids = array(); $t_featured = new ca_sets(); # --- featured artists set - set name assigned in eastend.conf - plugin conf file $t_featured->load(array('set_code' => $this->opo_plugin_config->get('featured_artists_set_name'))); # Enforce access control on set if (sizeof($this->opa_access_values) == 0 || sizeof($this->opa_access_values) && in_array($t_featured->get("access"), $this->opa_access_values)) { $this->view->setVar('featured_set_id', $t_featured->get("set_id")); $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $this->opa_access_values, 'shuffle' => 1))) ? $va_tmp : array()); // These are the entity ids in the set } if (!is_array($va_featured_ids) || sizeof($va_featured_ids) == 0) { # put random entities in the features variable $o_db = new Db(); $q_entities = $o_db->query("SELECT e.entity_id from ca_entities e WHERE e.access IN (" . implode($this->opa_access_values, ", ") . ") ORDER BY RAND() LIMIT 10"); if ($q_entities->numRows() > 0) { while ($q_entities->nextRow()) { $va_featured_ids[] = $q_entities->get("entity_id"); } } } # --- loop through featured ids and grab the entity's name, portrait, lifespan -lifespans_date, indexing_notes (brief description abouthow they relate to the east end) $t_entity = new ca_entities(); $t_object = new ca_objects(); $va_featured_artists = array(); foreach ($va_featured_ids as $vn_featured_entity_id) { $va_tmp = array(); $t_entity->load($vn_featured_entity_id); $va_tmp["entity_id"] = $vn_featured_entity_id; $va_tmp["lifespan"] = $t_entity->get("lifespans_date"); $va_tmp["indexing_notes"] = $t_entity->get("indexing_notes"); $va_tmp["name"] = $t_entity->getLabelForDisplay(); $va_objects = $t_entity->get("ca_objects", array("returnAsArray" => 1, 'checkAccess' => $this->opa_access_values, 'restrict_to_relationship_types' => array('portrait'))); $va_object = array_shift($va_objects); $t_object->load($va_object["object_id"]); $va_portrait = $t_object->getPrimaryRepresentation(array("abSlideShow")); # --- don't show records with status ars/vaga don't show image if ($t_object->get("ca_objects.object_status") != 348) { if ($t_object->get("ca_objects.object_status") == 349) { $va_tmp["vaga_class"] = "vagaDisclaimer"; } $va_tmp["image"] = $va_portrait["tags"]["abSlideShow"]; $va_tmp["caption"] = $t_object->get("ca_objects.caption"); } $va_featured_artists[$vn_featured_entity_id] = $va_tmp; } $this->view->setVar("featured_artists", $va_featured_artists); $this->render('featured_artists_html.php'); }
} if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) { $t_object = new ca_objects($va_featured_ids[0]); $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'icon', 'tiny'), null, array('return_with_access' => $va_access_values)); $vn_featured_content_id = $va_featured_ids[0]; $vs_featured_content_thumb = $va_rep["tags"]["thumbnail"]; $vs_featured_content_tiny = $va_rep["tags"]["tiny"]; $vs_featured_content_icon = $va_rep["tags"]["icon"]; $vs_featured_content_label = $t_object->getLabelForDisplay(); } else { # if there are no items in the featured set, put a random object in the features variable $va_random_item = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if (sizeof($va_random_item) > 0) { foreach ($va_random_item as $vn_object_id => $va_object_info) { $t_object = new ca_objects($vn_object_id); $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'icon', 'tiny'), null, array('return_with_access' => $va_access_values)); $vn_featured_content_id = $vn_object_id; $vs_featured_content_thumb = $va_rep["tags"]["thumbnail"]; $vs_featured_content_tiny = $va_rep["tags"]["tiny"]; $vs_featured_content_icon = $va_rep["tags"]["icon"]; $vs_featured_content_label = $t_object->getLabelForDisplay(); } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php print $this->request->config->get('html_page_title');
# --- output related object images as links $va_related_artworks = $t_occurrence->get("ca_objects", array("restrict_to_relationship_types" => array("part"), "returnAsArray" => 1, 'checkAccess' => $va_access_values)); if (sizeof($va_related_artworks)) { print "<div class='unit' style='clear:right;'><H3>" . _t("Checklist of Artworks") . "</H3>"; $t_rel_object = new ca_objects(); $i = 0; foreach ($va_related_artworks as $vn_rel_id => $va_info) { if ($i == $vn_num_more_link) { print "<div id='artworkMore' class='relatedMoreItems'>"; } $vn_rel_object_id = $va_info['object_id']; $t_rel_object->load($vn_rel_object_id); print "<div id='relArtwork" . $vn_rel_object_id . "' class='relArtwork' " . ($i / 2 - floor($i / 2) == 0 ? "style='clear:left;'" : "") . ">"; $va_rep = array(); $vs_rep = ""; if ($t_rel_object->getPrimaryRepresentation(array('tiny'), null, array('return_with_access' => $va_access_values))) { $va_rep = $t_rel_object->getPrimaryRepresentation(array('tiny'), null, array('return_with_access' => $va_access_values)); $vs_rep = $va_rep["tags"]["tiny"]; print "<div class='relArtworkImage' id='relArtworkImage" . $vn_rel_object_id . "'>" . caNavLink($this->request, $vs_rep, '', 'Detail', 'Object', 'Show', array('object_id' => $vn_rel_object_id)) . "</div>"; } else { print "<div class='relArtworkImagePlaceHolder'><!-- empty --></div>"; } print "<div>"; if ($t_rel_object->get("ca_objects.idno")) { print "<span class='resultidno'>" . trim($t_rel_object->get("ca_objects.idno")) . "</span><br/>"; } if ($this->request->config->get('allow_detail_for_ca_objects')) { print caNavLink($this->request, "<i>" . $va_info['label'] . "</i>", '', 'Detail', 'Object', 'Show', array('object_id' => $vn_rel_object_id)) . "<br/>"; } else { print "<i>" . $va_info['label'] . "</i><br/>"; }
<?php if ($va_artwork_ids = $t_occurrence->get('ca_objects.object_id', array('checkAccess' => caGetUserAccessValues($this->request), 'restrictToTypes' => array('artwork'), 'returnAsArray' => true))) { ?> <div id="detailRelatedObjects"> <H6>Related Artworks </H6> <div class="jcarousel-wrapper"> <div id="detailScrollButtonNext"><i class="fa fa-angle-right"></i></div> <div id="detailScrollButtonPrevious"><i class="fa fa-angle-left"></i></div> <!-- Carousel --> <div class="jcarousel"> <ul> <?php foreach ($va_artwork_ids as $va_object_id => $va_artwork_id) { $t_object = new ca_objects($va_artwork_id); $va_rep = $t_object->getPrimaryRepresentation(array('library'), null, array('return_with_access' => $va_access_values)); if (strlen($t_object->get('ca_objects.preferred_labels')) > 200) { $va_artwork_title = substr($t_object->get('ca_objects.preferred_labels'), 0, 197) . "..."; } else { $va_artwork_title = $t_object->get('ca_objects.preferred_labels'); } print "<li>"; print "<div class='detailObjectsResult'>" . caNavLink($this->request, $va_rep['tags']['library'], '', '', 'Detail', 'artworks/' . $va_artwork_id) . "</div>"; print "<div class='caption'>" . caNavLink($this->request, $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('artist'))) . "<br/><i>" . $va_artwork_title . "</i>, " . $t_object->get('ca_objects.creation_date'), '', '', 'Detail', 'artworks/' . $va_artwork_id) . "</div>"; if ($t_object->hasField('is_deaccessioned') && $t_object->get('is_deaccessioned') && $t_object->get('deaccession_date', array('getDirectDate' => true)) <= caDateToHistoricTimestamp(_t('now'))) { // If currently deaccessioned then display deaccession message print "<div class='searchDeaccessioned'>" . _t('Deaccessioned %1', $t_object->get('deaccession_date')) . "</div>\n"; #if ($vs_deaccession_notes = $t_object->get('deaccession_notes')) { TooltipManager::add(".inspectorDeaccessioned", $vs_deaccession_notes); } } print "</li>"; }
<?php if ($vo_result) { $t_entity = new ca_entities(); while ($vo_result->nextHit()) { $vn_entity_id = $vo_result->get('ca_entities.entity_id'); $va_labels = $vo_result->getDisplayLabels($this->request); $vs_surname = $vo_result->get("ca_entity_labels.surname"); $vs_letter = mb_strtoupper(mb_substr($vs_surname, 0, 1)); $va_entity_results[$vs_letter]["entities"][] = caNavLink($this->request, join($va_labels, "; "), '', 'Detail', 'Entity', 'Show', array('entity_id' => $vn_entity_id)); if (!$va_entity_results[$vs_letter]["image"]) { $t_entity->load($vn_entity_id); $va_portraits = $t_entity->get("ca_objects", array("restrictToRelationshipTypes" => array("portrait"), "returnAsArray" => 1, 'checkAccess' => $va_access_values)); foreach ($va_portraits as $va_portrait) { $t_object = new ca_objects($va_portrait["object_id"]); if ($t_object->get("object_status") != 348) { if ($va_portrait = $t_object->getPrimaryRepresentation(array('abHeadShot'), null, array('return_with_access' => $va_access_values))) { $vs_vaga_class = ""; if ($t_object->get("object_status") == 349) { $vs_vaga_class = "vagaDisclaimer"; } $va_entity_results[$vs_letter]["image"] = caNavLink($this->request, $va_portrait['tags']['abHeadShot'], $vs_vaga_class, 'Detail', 'Entity', 'Show', array('entity_id' => $vn_entity_id), array("title" => $t_entity->get("ca_entity_labels.displayname"))); break; } } } } } # --- how many to put in each column? $vn_num_results = $vo_result->numHits(); $vn_num_per_col = ceil($vn_num_results / 5); $vn_i = 0;
function Index() { // Remove any browse criteria previously set $this->opo_browse->removeAllCriteria(); parent::Index(true); JavascriptLoadManager::register('imageScroller'); JavascriptLoadManager::register('browsable'); JavascriptLoadManager::register('tabUI'); $t_object = new ca_objects(); $t_featured = new ca_sets(); if ($this->request->config->get("dont_enforce_access_settings")) { $va_access_values = array(); } else { $va_access_values = caGetUserAccessValues($this->request); } # --- featured items set - set name assigned in app.conf $featured_sets = $this->request->config->get('featured_sets'); $len = count($featured_sets); if ($len > 3) { $len = 3; } for ($i = 0; $i < $len; $i++) { $t_featured->load(array('set_code' => $featured_sets[$i])); $set_id = $t_featured->getPrimaryKey(); $set_title = $t_featured->getLabelForDisplay(); $set_desc = $t_featured->getAttributeFromSets('description', array(0 => $set_id)); $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array()); // These are the object ids in the set if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) { $t_object = new ca_objects($va_featured_ids[0]); $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'medium', 'mediumlarge', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values)); $featured_set_id_array[$i] = array('featured_set_code' => $featured_sets[$i], 'featured_content_id' => $va_featured_ids[0], 'featured_content_small' => $va_rep["tags"]["small"], 'featured_content_label' => $set_title, 'featured_content_description' => $set_desc[$set_id][0], 'featured_set_id' => $set_id); } } $this->view->setVar('featured_set_id_array', $featured_set_id_array); # --- user favorites get the highest ranked objects to display $va_user_favorites_items = $t_object->getHighestRated(true, 12, $va_access_values); if (sizeof($va_user_favorites_items) > 0) { if (is_array($va_user_favorites_items) && sizeof($va_user_favorites_items) > 0) { $t_object = new ca_objects($va_user_favorites_items[0]); $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values)); $this->view->setVar('user_favorites_id', $va_user_favorites_items[0]); $this->view->setVar('user_favorites_thumb', $va_rep["tags"]["thumbnail"]); $this->view->setVar('user_favorites_small', $va_rep["tags"]["small"]); $this->view->setVar('user_favorites_preview', $va_rep["tags"]["preview"]); $this->view->setVar('user_favorites_widepreview', $va_rep["tags"]["widepreview"]); } } else { $this->view->setVar('user_favorites_is_random', 1); # if no ranks set, choose a random object $va_random_items = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items)); $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('small', 'thumbnail', 'preview', 'medium', 'widepreview'), array("checkAccess" => $va_access_values)); foreach ($va_random_items as $vn_object_id => $va_object_info) { $va_object_info['title'] = $va_labels[$vn_object_id]; $va_object_info['media'] = $va_media[$vn_object_id]; $va_random_items[$vn_object_id] = $va_object_info; } $this->view->setVar('random_objects', $va_random_items); if (is_array($va_random_items) && sizeof($va_random_items) > 0) { $va_object_info = array_shift($va_random_items); $this->view->setVar('user_favorites_id', $va_object_info['object_id']); $this->view->setVar('user_favorites_thumb', $va_media[$va_object_info['object_id']]["tags"]["thumbnail"]); $this->view->setVar('user_favorites_small', $va_media[$va_object_info['object_id']]["tags"]["small"]); $this->view->setVar('user_favorites_preview', $va_media[$va_object_info['object_id']]["tags"]["preview"]); $this->view->setVar('user_favorites_widepreview', $va_media[$va_object_info['object_id']]["tags"]["widepreview"]); $this->view->setVar('user_favorites_medium', $va_media[$va_object_info['object_id']]["tags"]["medium"]); } } #---- new 'recently added' $t_set = new ca_sets(); $ra_set_code = $this->request->config->get('recently_added_set_id'); $t_set->load(array('set_code' => $ra_set_code)); $set_id = $t_set->getPrimaryKey(); $ra_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('thumbnail', 'preview'), "checkAccess" => 1))); $va_recently_added = array(); foreach ($ra_items as $va_item_info) { $vn_r_object_id = $va_item_info['object_id']; $t_object->load($vn_r_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"]; } # --- get the 12 most recently added objects to display /*$va_recently_added_ids = $t_object->getRecentlyAddedItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); if(is_array($va_recently_added_ids) && sizeof($va_recently_added_ids) > 0){ $va_recently_added = array(); foreach($va_recently_added_ids as $va_item_info){ $vn_r_object_id = $va_item_info['object_id']; $t_object->load($vn_r_object_id); $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values)); $va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"]; } }*/ $this->view->setVar('recently_added', $va_recently_added); $this->render('Splash/splash_html.php'); }
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * This source code is free and modifiable under the terms of * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See * the "license.txt" file for details, or visit the CollectiveAccess web site at * http://www.CollectiveAccess.org * * ---------------------------------------------------------------------- */ $va_ids = $this->getVar('ids'); // this is a search result row $va_access_values = $this->getVar('access_values'); foreach ($va_ids as $vn_id) { $t_object = new ca_objects($vn_id); ?> <div id="mapBalloon"> <?php $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail'), null, array('checkAccess' => $va_access_values)); if ($vs_media_tag = $va_rep['tags']['thumbnail']) { print caNavLink($this->request, $vs_media_tag, '', 'Detail', 'Object', 'Show', array('object_id' => $t_object->get("ca_objects.object_id"))); } ?> <div id="mapBalloonText"> <?php print caNavLink($this->request, '<b>' . $t_object->get("ca_objects.idno") . '</b>: ' . $t_object->get("ca_objects.preferred_labels"), '', 'Detail', 'Object', 'Show', array('object_id' => $t_object->get("ca_objects.object_id"))); ?> </div><!-- end mapBalloonText --> </div><!-- end mapBallon --> <br/> <?php }
} # --- set for share your knowledge box - set name assigned in app.conf - featured_share_set_name $t_featured_share = new ca_sets(); $t_featured_share->load(array('set_code' => $this->request->config->get('featured_share_set_name'))); # Enforce access control on set if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured_share->get("access"), $va_access_values)) { $vn_featured_share_set_id = $t_featured_share->get("set_id"); $va_featured_share_ids = array_keys(is_array($va_tmp = $t_featured_share->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array()); // These are the object ids in the set } if (!is_array($va_featured_share_ids) || sizeof($va_featured_share_ids) == 0) { # put a random object in the features variable $va_featured_share_ids = array_keys($t_object->getRandomItems(10, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1))); } $t_object_share = new ca_objects($va_featured_share_ids[0]); $va_rep = $t_object_share->getPrimaryRepresentation(array('frontpage'), null, array('return_with_access' => $va_access_values)); $vn_featured_share_id = $va_featured_share_ids[0]; $vs_featured_share_image = $va_rep["tags"]["frontpage"]; $vs_featured_share_label = $t_object->getLabelForDisplay(); # --- set for featured member - set name assigned in app.conf - featured_member_set_name - this is an ENTITY set $t_featured_member = new ca_sets(); $t_featured_member->load(array('set_code' => $this->request->config->get('featured_member_set_name'))); # Enforce access control on set if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured_member->get("access"), $va_access_values)) { $vn_featured_member_set_id = $t_featured_member->get("set_id"); $va_featured_member_ids = array_keys(is_array($va_tmp = $t_featured_member->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array()); // These are the entity ids in the set } $t_entity = new ca_entities($va_featured_member_ids[0]); $vn_featured_member_id = $va_featured_member_ids[0]; $vs_featured_member_image = $t_entity->get("mem_inst_image", array("version" => "frontpage", "return" => "tag"));
# --- map if ($this->request->config->get('ca_objects_map_attribute') && $t_object->get($this->request->config->get('ca_objects_map_attribute'))) { $o_map = new GeographicMap(300, 200, 'map'); $o_map->mapFrom($t_object, $this->request->config->get('ca_objects_map_attribute')); print "<div class='unit'>" . $o_map->render('HTML') . "</div>"; } # --- output related object images as links $va_related_objects = $t_object->get("ca_objects", array("returnAsArray" => 1, 'checkAccess' => $va_access_values)); if (sizeof($va_related_objects)) { print "<div class='unit'><div class='unitHeader'>" . _t("Related Objects") . "</div>"; print "<table border='0' cellspacing='0' cellpadding='0' width='100%' id='objDetailRelObjects'>"; $col = 0; $vn_numCols = 4; foreach ($va_related_objects as $vn_rel_id => $va_info) { $t_rel_object = new ca_objects($va_info["object_id"]); $va_reps = $t_rel_object->getPrimaryRepresentation(array('icon', 'small'), null, array('return_with_access' => $va_access_values)); if ($col == 0) { print "<tr>"; } print "<td align='center' valign='middle' class='imageIcon icon" . $va_info["object_id"] . "'>"; print caNavLink($this->request, $va_reps['tags']['icon'], '', 'Detail', 'Object', 'Show', array('object_id' => $va_info["object_id"])); // set view vars for tooltip $this->setVar('tooltip_representation', $va_reps['tags']['small']); $this->setVar('tooltip_title', $va_info['label']); $this->setVar('tooltip_idno', $va_info["idno"]); TooltipManager::add(".icon" . $va_info["object_id"], $this->render('../Results/ca_objects_result_tooltip_html.php')); print "</td>"; $col++; if ($col < $vn_numCols) { print "<td align='center'><!-- empty --></td>"; }
</div> </page_header> <table class="listtable" width="100%" border="0" cellpadding="0" cellspacing="0" align="center"> <?php $tr_count = 0; $vo_result->seek(0); while ($vo_result->nextHit()) { $vn_object_id = $vo_result->get('object_id'); ?> <?php $vn_count = 0; $t_object = new ca_objects($vn_object_id); $thumb_rep = $t_object->getPrimaryRepresentation(array('preview')); // Skip first few columns as needed if ($vn_count < $vn_start) { $vn_count++; continue; } if ($tr_count == 0) { print "<tr>"; } $vs_display_value = $t_display->getDisplayValue($vo_result, $vn_placement_id, array('forReport' => true, 'purify' => true)); print "<td valign='bottom' align='center' width='100'><table cellpadding='0' cellspacing='0' width='100' height='100%' align='center' border='0'><tr align='center' border='0' valign='middle'><td align='center' border='0' valign='middle' style='text-align:center;'>" . $thumb_rep["tags"]["preview"]; print "</td></tr><tr valign='bottom' align='center'><td nowrap='wrap' border='0' align='center' style='word-wrap: break-word; width: 150px; background-color:#eee;' border='1px solid #ccc;'>" . $t_object->get('ca_objects.preferred_labels') . "<br/>" . $t_object->get('ca_objects.idno') . "<br/>" . $t_object->get('ca_collections.preferred_labels'); print "</td></tr></table></td>"; $vn_count++; if ($tr_count == 4) { print "</tr>";
print $t_item->get('ca_object_lots.preferred_labels'); ?> </H4> <H6></H6> </div><!-- end col 12--> </div><!-- end row --> <div class="row"> <div class='col-xs-12 col-sm-6 col-md-6 col-lg-6'> <div class="row"> <?php $va_related_artworks = $t_item->get('ca_objects.object_id', array('checkAccess' => caGetUserAccessValues($this->request), 'returnAsArray' => true)); foreach ($va_related_artworks as $vn_id => $va_related_artwork) { $t_object = new ca_objects($va_related_artwork); $va_reps = $t_object->getPrimaryRepresentation(array('versions' => 'medium'), null, array("checkAccess" => $va_access_values)); print "<div class='col-xs-12 col-sm-6 col-md-6 col-lg-6 relatedLot'>"; print caNavLink($this->request, $va_reps['tags']['medium'], '', '', 'Detail', 'artworks/' . $va_related_artwork); print "<div class='lotCaption'>"; print "<p>" . caNavLink($this->request, $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('artist'))), '', '', 'Detail', 'artworks/' . $va_related_artwork) . "</p>"; print "<p>" . caNavLink($this->request, "<i>" . $t_object->get('ca_objects.preferred_labels') . "</i>, " . $t_object->get('ca_objects.creation_date'), '', '', 'Detail', 'artworks/' . $va_related_artwork) . "</p>"; print "<p>" . $t_object->get('ca_objects.medium') . "</p>"; print "<p>" . $t_object->get('ca_objects.dimensions.display_dimensions') . "</p>"; print "<p>" . $t_object->get('ca_objects.idno') . "</p>"; print "</div><!-- end lotCaption -->"; print "</div>"; } ?> </div><!-- end row -->
function Index($pa_options = null) { // Remove any browse criteria previously set $this->opo_browse->removeAllCriteria(); parent::Index(array('dontRenderView' => true)); JavascriptLoadManager::register('imageScroller'); JavascriptLoadManager::register('browsable'); JavascriptLoadManager::register('tabUI'); JavascriptLoadManager::register('cycle'); $t_object = new ca_objects(); $t_featured = new ca_sets(); if ($this->request->config->get("dont_enforce_access_settings")) { $va_access_values = array(); } else { $va_access_values = caGetUserAccessValues($this->request); } $va_default_versions = array('thumbnail', 'icon', 'small', 'preview', 'medium', 'preview', 'widepreview'); # --- featured items set - set name assigned in app.conf $t_featured->load(array('set_code' => $this->request->config->get('featured_set_name'))); # Enforce access control on set if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_featured->get("access"), $va_access_values)) { $this->view->setVar('featured_set_id', $t_featured->get("set_id")); $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array()); // These are the object ids in the set } if (!is_array($va_featured_ids) || sizeof($va_featured_ids) == 0) { # put a random object in the features variable $va_featured_ids = array_keys($t_object->getRandomItems(10, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1))); } $t_object = new ca_objects($va_featured_ids[0]); $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'medium', 'mediumlarge', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values)); $this->view->setVar('featured_content_id', $va_featured_ids[0]); $this->view->setVar('featured_content_thumb', $va_rep["tags"]["thumbnail"]); $this->view->setVar('featured_content_small', $va_rep["tags"]["small"]); $this->view->setVar('featured_content_mediumlarge', $va_rep["tags"]["mediumlarge"]); $this->view->setVar('featured_content_medium', $va_rep["tags"]["medium"]); $this->view->setVar('featured_content_preview', $va_rep["tags"]["preview"]); $this->view->setVar('featured_content_widepreview', $va_rep["tags"]["widepreview"]); $this->view->setVar('featured_content_label', $t_object->getLabelForDisplay()); $this->view->setVar('featured_content_slideshow_id_list', $va_featured_ids); if (!(bool) $this->request->config->get("splash_disable_highest_rated_objects")) { if (!is_array($va_versions = $this->request->config->getList("splash_highest_rated_display_versions"))) { $va_versions = $va_default_versions; } # --- user favorites get the highest ranked objects to display $va_user_favorites_items = $t_object->getHighestRated(true, 12, $va_access_values); if (sizeof($va_user_favorites_items) > 0) { if (is_array($va_user_favorites_items) && sizeof($va_user_favorites_items) > 0) { $t_object = new ca_objects($va_user_favorites_items[0]); $va_rep = $t_object->getPrimaryRepresentation($va_versions, null, array('return_with_access' => $va_access_values)); $this->view->setVar('user_favorites_id', $va_user_favorites_items[0]); foreach ($va_versions as $vs_version) { $this->view->setVar('user_favorites_' . $vs_version, $va_rep['tags'][$vs_version]); } } } else { $this->view->setVar('user_favorites_is_random', 1); # if no ranks set, choose a random object $va_random_items = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items)); $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), $va_versions, array("checkAccess" => $va_access_values)); foreach ($va_random_items as $vn_object_id => $va_object_info) { $va_object_info['title'] = $va_labels[$vn_object_id]; $va_object_info['media'] = $va_media[$vn_object_id]; $va_random_items[$vn_object_id] = $va_object_info; } $this->view->setVar('random_objects', $va_random_items); if (is_array($va_random_items) && sizeof($va_random_items) > 0) { $va_object_info = reset($va_random_items); $this->view->setVar('user_favorites_id', $va_object_info['object_id']); foreach ($va_versions as $vs_version) { $this->view->setVar('user_favorites_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]); } } } } if (!(bool) $this->request->config->get("splash_disable_recently_added_objects")) { if (!is_array($va_versions = $this->request->config->getList("splash_recently_added_display_versions"))) { $va_versions = $va_default_versions; } # --- get the 12 most recently added objects to display $va_recently_added_items = $t_object->getRecentlyAddedItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_recently_added_items)); $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_recently_added_items), $va_versions, array("checkAccess" => $va_access_values)); foreach ($va_recently_added_items as $vn_object_id => $va_object_info) { $va_object_info['title'] = $va_labels[$vn_object_id]; $va_object_info['media'] = $va_media[$vn_object_id]; $va_recently_added_objects[$vn_object_id] = $va_object_info; } $this->view->setVar('recently_added_objects', $va_recently_added_objects); if (is_array($va_recently_added_objects) && sizeof($va_recently_added_objects) > 0) { $va_object_info = reset($va_recently_added_objects); $this->view->setVar('recently_added_id', $va_object_info['object_id']); foreach ($va_versions as $vs_version) { $this->view->setVar('recently_added_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]); } } } else { $this->view->setVar('recently_added_objects', array()); } # --- get the 12 most viewed objects if (!(bool) $this->request->config->get("splash_disable_most_viewed_objects")) { if (!is_array($va_versions = $this->request->config->getList("splash_most_viewed_display_versions"))) { $va_versions = $va_default_versions; } $va_most_viewed_objects = $t_object->getMostViewedItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_most_viewed_objects)); $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_most_viewed_objects), $va_versions, array("checkAccess" => $va_access_values)); foreach ($va_most_viewed_objects as $vn_object_id => $va_object_info) { $va_object_info['title'] = $va_labels[$vn_object_id]; $va_object_info['media'] = $va_media[$vn_object_id]; $va_most_viewed_objects[$vn_object_id] = $va_object_info; } $this->view->setVar('most_viewed_objects', $va_most_viewed_objects); if (is_array($va_most_viewed_objects) && sizeof($va_most_viewed_objects) > 0) { $va_object_info = reset($va_most_viewed_objects); $this->view->setVar('most_viewed_id', $va_object_info['object_id']); foreach ($va_versions as $vs_version) { $this->view->setVar('most_viewed_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]); } } } if (!(bool) $this->request->config->get("splash_disable_recently_viewed_objects")) { if (!is_array($va_versions = $this->request->config->getList("splash_recently_viewed_display_versions"))) { $va_versions = $va_default_versions; } # --- get the 12 recently viewed objects $va_recently_viewed_objects = $t_object->getRecentlyViewedItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs($va_recently_viewed_objects); $va_media = $t_object->getPrimaryMediaForIDs($va_recently_viewed_objects, $va_versions, array("checkAccess" => $va_access_values)); $va_recently_viewed_objects_for_display = array(); foreach ($va_recently_viewed_objects as $vn_object_id) { $va_recently_viewed_objects_for_display[$vn_object_id] = array('object_id' => $vn_object_id, 'title' => $va_labels[$vn_object_id], 'media' => $va_media[$vn_object_id]); } $this->view->setVar('recently_viewed_objects', $va_recently_viewed_objects_for_display); if (is_array($va_recently_viewed_objects) && sizeof($va_recently_viewed_objects) > 0) { foreach ($va_recently_viewed_objects_for_display as $va_object_info) { if ($va_media[$va_object_info['object_id']]['tags'][$vs_version]) { $this->view->setVar('recently_viewed_id', $va_object_info['object_id']); foreach ($va_versions as $vs_version) { $this->view->setVar('recently_viewed_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]); } break; } } } } else { $this->view->setVar('recently_viewed_objects', array()); } if (!(bool) $this->request->config->get("splash_disable_random_objects")) { if (!is_array($va_versions = $this->request->config->getList("splash_random_display_versions"))) { $va_versions = $va_default_versions; } # --- get random objects $va_random_items = $t_object->getRandomItems(12, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)); $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items)); $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), $va_versions, array("checkAccess" => $va_access_values)); foreach ($va_random_items as $vn_object_id => $va_object_info) { $va_object_info['title'] = $va_labels[$vn_object_id]; $va_object_info['media'] = $va_media[$vn_object_id]; $va_random_items[$vn_object_id] = $va_object_info; } $this->view->setVar('random_objects', $va_random_items); if (is_array($va_random_items) && sizeof($va_random_items) > 0) { $va_object_info = array_shift($va_random_items); $this->view->setVar('random_object_id', $va_object_info['object_id']); foreach ($va_versions as $vs_version) { $this->view->setVar('random_object_' . $vs_version, $va_media[$va_object_info['object_id']]['tags'][$vs_version]); } } } else { $this->view->setVar('random_objects', array()); } $this->render('Splash/splash_html.php'); }
$t_featured = new ca_sets(); $featured_sets = $this->request->config->get('featured_sets'); $len = count($featured_sets); if ($len > 3) { $len = 3; } for ($i = 0; $i < $len; $i++) { $t_featured->load(array('set_code' => $featured_sets[$i])); $set_id = $t_featured->getPrimaryKey(); $set_title = $t_featured->getLabelForDisplay(); $set_desc = $t_featured->getAttributeFromSets('description', array(0 => $set_id)); $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array()); // These are the object ids in the set if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) { $t_object = new ca_objects($va_featured_ids[0]); $va_rep = $t_object->getPrimaryRepresentation(array('preview', 'preview170'), null, array('return_with_access' => $va_access_values)); $featured_set_id_array[$i] = array('featured_set_code' => $featured_sets[$i], 'featured_content_id' => $va_featured_ids[0], 'featured_content_small' => $va_rep["tags"]["preview"], 'featured_content_label' => $set_title, 'featured_content_description' => $set_desc[$set_id][0], 'featured_set_id' => $set_id); } } ?> <?php if (isset($featured_set_id_array)) { ?> <table class="featured-list" cell-padding="0" cell-spacing="0"> <tr> <?php foreach ($featured_set_id_array as $feature_array) { echo '<td>' . caNavLink($this->request, $feature_array['featured_content_small'], 'thumb-link', 'simpleGallery', 'Show', 'displaySet', array('set_id' => $feature_array['featured_set_id'])) . '</td>'; } ?>
?> <div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;"> <a href="#" onclick="caUIBrowsePanel.hideBrowsePanel()" class="browseSelectPanelButton"></a> <div id="splashBrowsePanelContent"> </div> </div> <script type="text/javascript"> var caUIBrowsePanel = caUI.initBrowsePanel({ facetUrl: '<?php print caNavUrl($this->request, '', 'Browse', 'getFacet'); ?> '}); </script><pre> <?php $t_featured = new ca_objects($this->getVar("featured_content_id")); $t_info = $t_featured->getPrimaryRepresentation(array('mediumlarge'), null, array('return_with_access' => $va_access_values)); $vn_image_height = $t_info['info']['mediumlarge']['HEIGHT']; $vn_padding_top_bottom = (450 - $vn_image_height) / 2; ?> </pre> <div id="hpFeatured"> <table cellpadding="0" cellspacing="0"><tr><td valign="middle" align="center"><div> <img src='<?php print $this->request->getThemeUrlPath(); ?> /graphics/ladyliberty.png' border='0'> <?php # print caNavLink($this->request, $this->getVar("featured_content_mediumlarge"), '', 'Detail', 'Object', 'Show', array('object_id' => $this->getVar("featured_content_id"))); ?> </div></td></tr></table> <div id="featuredLabel">
if (is_array($va_items) && sizeof($va_items) > 0) { $ibg = 1; foreach ($va_items as $vn_item_id => $va_item) { $ps_bg_class = ""; if ($ibg == 1) { $ps_bg_class = "bookmarkBg"; $ibg = 0; } else { $ps_bg_class = "bookmarkBg"; $ibg++; } $vs_thumbnail = ""; if ($va_item["tablename"] == "ca_objects") { $t_object_bookmark_item->load($va_item["row_id"]); $va_media = array(); $va_media = $t_object_bookmark_item->getPrimaryRepresentation(array('tiny'), null, array('checkAccess' => $va_access_values)); $vs_thumbnail = $va_media["tags"]["tiny"]; #print_r($va_media); } print "<div class='bookmark " . $ps_bg_class . "'>› "; print caNavLink($this->request, " ", 'removeBookmark', '', 'Bookmarks', 'DeleteItem', array("bookmark_id" => $vn_item_id)); if ($vs_thumbnail) { print caNavLink($this->request, $vs_thumbnail, '', 'Detail', $va_item['controller'], 'Show', array($va_item['primary_key'] => $va_item['row_id'])); } print caNavLink($this->request, $va_item['label'], '', 'Detail', $va_item['controller'], 'Show', array($va_item['primary_key'] => $va_item['row_id'])); print "</div>"; } } ?> </div><!-- end bookmarksList --> </div><!-- leftCol -->