public function Index() { $t_occurrence = new ca_occurrences(); if ($this->request->config->get("dont_enforce_access_settings")) { $va_access_values = array(); } else { $va_access_values = caGetUserAccessValues($this->request); } # --- get the most viewed occ records $va_occ_info = array(); $va_most_viewed_occs = $t_occurrence->getMostViewedItems(3, array('checkAccess' => $va_access_values)); foreach ($va_most_viewed_occs as $vn_occurrence_id => $va_occ_info) { $t_occurrence->load($vn_occurrence_id); $va_occ_info['title'] = $t_occurrence->getLabelForDisplay(); $va_preview_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "widepreview", "showMediaInfo" => false, "returnAsArray" => true)); if (sizeof($va_preview_stills) > 0) { $va_occ_info["mediaPreview"] = array_shift($va_preview_stills); } $va_medium_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "medium", "showMediaInfo" => false, "returnAsArray" => true)); if (sizeof($va_medium_stills) > 0) { $va_occ_info["mediaMedium"] = array_shift($va_medium_stills); } $va_occ_info["repository"] = $t_occurrence->get("CLIR2_institution", array('convertCodesToDisplayText' => true)); $va_most_viewed_occs[$vn_occurrence_id] = $va_occ_info; } $this->view->setVar('most_viewed_occs', $va_most_viewed_occs); $this->render('Engage/engage_index_html.php'); }