<div class='col-md-6 col-lg-6'>
					<H4>{{{^ca_places.preferred_labels.name}}}</H4>
					{{{<ifdef code="ca_places.description"><br/>^ca_places.description<br/></ifdef>}}}<br/>
<?php 
print "<p>" . caNavLink($this->request, _t("View all related objects"), "btn btn-default", "", "Browse", "objects", array("facet" => "place_facet", "id" => $t_item->get("place_id"))) . "</p>";
$t_object_thumb = new ca_objects();
$va_entities = $t_item->get("ca_entities", array("returnAsArray" => true, "checkAccess" => $va_access_values));
if (sizeof($va_entities)) {
    if (sizeof($va_entities) == 1) {
        print "<H6>Related person/organisation</H6>";
    } else {
        print "<H6>Related people/organisations</H6>";
    }
    $t_rel_entity = new ca_entities();
    foreach ($va_entities as $va_entity) {
        $t_rel_entity->load($va_entity["entity_id"]);
        $t_object_thumb->load($t_rel_entity->get("ca_objects.object_id", array("restrictToRelationshipTypes" => array("cover"), "checkAccess" => $va_access_values)));
        $vs_thumb = $t_object_thumb->get("ca_object_representations.media.icon", array("checkAccess" => $va_access_values));
        if ($vs_thumb) {
            print "<div class='row'><div class='col-sm-3 col-md-3 col-lg-3'>" . $vs_thumb . "</div>\n";
            print "<div class='col-sm-9 col-md-9 col-lg-9'>\n";
        }
        print $t_rel_entity->getWithTemplate("<b><l>^ca_entities.preferred_labels.displayname</l></b>");
        if ($vs_brief_description = $t_rel_entity->get("ca_entities.brief_description")) {
            print "<br/>" . $vs_brief_description;
        }
        if ($vs_thumb) {
            print "</div></div><!-- end row -->";
        } else {
            print "<br/>";
        }
 * 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_entity_ids = $this->getVar("entity_ids");
$t_entity = new ca_entities();
?>
	<div id="memberMapBalloonContainer">
<?php 
foreach ($va_entity_ids as $vn_entity_id) {
    $t_entity->load($vn_entity_id);
    print "<H1>" . $t_entity->getLabelForDisplay() . "</H1>";
    if ($t_entity->get("biography")) {
        print "<p>";
        print $t_entity->get("biography");
        print "</p>";
    }
    if ($t_entity->get("ca_entities.external_link.url_entry")) {
        print "<p>";
        print "<a href='" . $t_entity->get("ca_entities.external_link.url_entry") . "' target='_blank'>" . $t_entity->get("ca_entities.external_link.url_entry") . "</a>";
        print "</p>";
    }
    print "<p>" . caNavLink($this->request, _t("More") . " &rsaquo;", '', 'Detail', 'Entity', 'Show', array('entity_id' => $t_entity->get("ca_entities.entity_id"))) . "</p>";
}
?>
	</div><!-- end memberMapBalloonContainer -->
    }
}
?>
		<div id="art_detail_info" <?php 
print $vn_info_width ? "style='width:" . $vn_info_width . "px;'" : "";
?>
>	
<?php 
# --- creator
$va_creator = $t_object->get("ca_entities", array("restrictToRelationshipTypes" => array("maker", "artist"), "returnAsArray" => 1, 'checkAccess' => $va_access_values, 'sort' => 'surname'));
$t_creator = new ca_entities();
if (sizeof($va_creator) > 0) {
    foreach ($va_creator as $va_entity) {
        $vs_creator = $this->request->config->get('allow_detail_for_ca_entities') ? caNavLink($this->request, $va_entity["label"], '', 'Detail', 'Entity', 'Show', array('entity_id' => $va_entity["entity_id"])) : $va_entity["label"];
        # --- load the entity record for the creator so can grab the portrait
        $t_creator->load($va_entity["entity_id"]);
    }
    # --- get the portrait of the creator
    // 			$va_portraits = $t_creator->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($va_portrait = $t_object->getPrimaryRepresentation(array('tiny'), null, array('return_with_access' => $va_access_values))){
    // 					print "<div id='portrait'>".$va_portrait['tags']['tiny']."</div><!-- end portrait -->";
    // 					break;
    // 				}
    // 			}
    if ($t_creator->get("lifespans_date")) {
        if (strstr($t_creator->get("lifespans_date"), "after")) {
            $vs_lifespan = str_replace("after", "born", $t_creator->get("lifespans_date"));
        } else {
            $vs_lifespan = $t_creator->get("lifespans_date");
 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');
 }
 /**
  * 
  */
 public function get()
 {
     if (!is_object($t_entity = $this->_checkEntity())) {
         return $t_entity;
     }
     $vn_id = $t_entity->getPrimaryKey();
     $t_list = new ca_lists();
     $vn_yes_id = $t_list->getItemIDFromList("yes_no", "yes");
     $vn_no_id = $t_list->getItemIDFromList("yes_no", "no");
     $vn_male_id = $t_list->getItemIDFromList("genders", "male");
     $vn_female_id = $t_list->getItemIDFromList("genders", "female");
     // get victim info
     $va_data = array('id' => $vn_id, 'forename' => $t_entity->get('ca_entities.preferred_labels.forename'), 'other_forenames' => $t_entity->get('ca_entities.preferred_labels.other_forenames'), 'surname' => $t_entity->get('ca_entities.preferred_labels.surname'), 'middlename' => $t_entity->get('ca_entities.preferred_labels.middlename'), 'displayname' => $t_entity->get('ca_entities.preferred_labels.displayname'), 'prefix' => $t_entity->get('ca_entities.preferred_labels.prefix'), 'suffix' => $t_entity->get('ca_entities.preferred_labels.suffix'), 'gender' => $t_entity->get('ca_entities.gender') == $vn_male_id ? "M" : "F", 'pregnant' => $t_entity->get('ca_entities.pregnant') == $vn_yes_id ? 1 : 0, 'final_text_bio' => $t_entity->get('ca_entities.final_text_bio'), 'lifespan' => $t_entity->get('ca_entities.lifespan', array('dateFormat' => 'iso8601')), 'lifespan_as_text' => $t_entity->get('ca_entities.lifetime_text'), 'last_modification' => $t_entity->get('ca_entities.lastModified', array("dateFormat" => 'iso8601')));
     $va_nonpreferred_labels = $t_entity->get('ca_entities.nonpreferred_labels', array('returnAsArray' => true, 'assumeDisplayField' => false));
     foreach ($va_nonpreferred_labels as $va_label) {
         $va_data['alternate_names'][] = $va_label;
     }
     // add place info
     $va_places = $t_entity->getRelatedItems('ca_places');
     $t_place = new ca_places();
     $va_place_type_list = $t_place->getTypeList();
     $va_place_type_idnos = array();
     foreach ($va_place_type_list as $vn_type_id => $va_type) {
         if (!$va_type['is_enabled']) {
             continue;
         }
         $va_place_type_idnos[] = $va_type['idno'];
     }
     $va_data['place_types'] = $va_place_type_idnos;
     foreach ($va_places as $vn_relation_id => $va_rel_info) {
         if ($t_place->load($va_rel_info['place_id'])) {
             $va_place_ids = $t_place->get('ca_places.hierarchy.place_id', array('returnAsArray' => true));
             array_shift($va_place_ids);
             $vn_i = 0;
             foreach ($va_place_ids as $vn_id) {
                 if ($t_place->load($vn_id)) {
                     if (!($vs_type_name = $va_place_type_list[$vn_place_type_id = $t_place->get('type_id')]['idno'])) {
                         $vs_type_name = $vn_place_type_id;
                     }
                     $va_data['locations'][$va_rel_info['relationship_type_code']][$vs_type_name] = $t_place->get('ca_places.preferred_labels.name');
                     $vn_i++;
                 }
             }
         }
     }
     // add affiliations
     $va_entities = $t_entity->getRelatedItems('ca_entities', array('restrict_to_relationship_types' => array('employer', 'affiliation')));
     $t_rel_entity = new ca_entities();
     $va_units = array();
     foreach ($va_entities as $vn_relation_id => $va_rel_info) {
         if ($t_rel_entity->load($va_rel_info['entity_id'])) {
             $va_display_names = $t_rel_entity->get('ca_entities.hierarchy.preferred_labels.displayname', array('returnAsArray' => true));
             if ($va_rel_info['relationship_type_code'] == 'affiliation') {
                 if (sizeof($va_display_names) > 1) {
                     $va_units[] = array_pop($va_display_names);
                 }
             } else {
                 if (sizeof($va_display_names) > 1) {
                     array_pop($va_display_names);
                 }
             }
             $va_data['affiliations'][$va_rel_info['relationship_type_code']][] = array('displayname' => $va_display_names, 'id' => $va_rel_info['entity_id'], 'aliases' => array_values($t_rel_entity->get('ca_entities.nonpreferred_labels.displayname', array('returnAsArray' => true))));
         }
     }
     // add group
     $va_data['affiliations']['group'][] = array('displayname' => array($t_entity->get('ca_entities.groupName')), 'id' => -1, 'aliases' => array());
     // Map bottom level of two level affiliation to fake "unit" relationship
     // This let's the Memorial Table CMS easily make the unit value searchable
     foreach ($va_units as $vs_unit) {
         $va_data['affiliations']['unit'][] = array('displayname' => array($vs_unit), 'id' => -1, 'aliases' => array());
     }
     return $this->makeResponse($va_data);
 }