Пример #1
0
 /**
  * Displays map of all member inst
  */
 public function Index()
 {
     $o_search = new EntitySearch();
     #$o_search->setTypeRestrictions(array($this->opn_member_institution_id));
     $o_search->addResultFilter("ca_entities.access", "IN", join(',', $this->opa_access_values));
     //$qr_res = $o_search->search("*", array('sort' => 'ca_entity_labels.name', 'sort_direction' => 'asc'));
     $qr_res = $o_search->search("ca_entities.type_id:" . $this->opn_member_institution_id);
     // This is fastest
     $o_map = new GeographicMap(900, 500, 'map');
     $va_map_stats = $o_map->mapFrom($qr_res, "georeference", array("ajaxContentUrl" => caNavUrl($this->request, "NovaMuse", "MemberMap", "getMapItemInfo"), "request" => $this->request, "checkAccess" => $this->opa_access_values));
     $this->view->setVar("map", $o_map->render('HTML', array('delimiter' => "<br/>")));
     $this->render('member_map_html.php');
 }
Пример #2
0
 /**
  * Generate maps output in specified format
  *
  * @param array $pa_viz_settings Array of visualization settings taken from visualization.conf
  * @param string $ps_format Specifies format to generate output in. Currently only 'HTML' is supported.
  * @param array $pa_options Array of options to use when rendering output. Supported options are:
  *		width =
  *		height =
  *		mapType - type of map to render; valid values are 'ROADMAP', 'SATELLITE', 'HYBRID', 'TERRAIN'; if not specified 'google_maps_default_type' setting in app.conf is used; if that is not set default is 'SATELLITE'
  *		showNavigationControls - if true, navigation controls are displayed; default is to use 'google_maps_show_navigation_controls' setting in app.conf
  *		showScaleControls -  if true, scale controls are displayed; default is to use 'google_maps_show_scale_controls' setting in app.conf
  *		showMapTypeControls -  if true, map type controls are displayed; default is to use 'google_maps_show_map_type_controls' setting in app.conf
  *		minZoomLevel - Minimum zoom level to allow; leave null if you don't want to enforce a limit
  *		maxZoomLevel - Maximum zoom level to allow; leave null if you don't want to enforce a limit
  *		zoomLevel - Zoom map to specified level rather than fitting all markers into view; leave null if you don't want to specify a zoom level. IF this option is set minZoomLevel and maxZoomLevel will be ignored.
  *		pathColor - 
  *		pathWeight -
  *		pathOpacity - 
  *		request = current request; required for generation of editor links
  */
 public function render($pa_viz_settings, $ps_format = 'HTML', $pa_options = null)
 {
     if (!($vo_data = $this->getData())) {
         return null;
     }
     $po_request = isset($pa_options['request']) && $pa_options['request'] ? $pa_options['request'] : null;
     list($vs_width, $vs_height) = $this->_parseDimensions(caGetOption('width', $pa_options, 500), caGetOption('height', $pa_options, 500));
     $o_map = new GeographicMap($vs_width, $vs_height, $pa_options['id']);
     $this->opn_num_items_rendered = 0;
     foreach ($pa_viz_settings['sources'] as $vs_source_code => $va_source_info) {
         $vs_color = $va_source_info['color'];
         if (method_exists($vo_data, "seek")) {
             $vo_data->seek(0);
         }
         $va_opts = array('renderLabelAsLink' => false, 'request' => $po_request, 'color' => $vs_color);
         $va_opts['labelTemplate'] = $va_source_info['display']['title_template'];
         if (isset($va_source_info['display']['ajax_content_url']) && $va_source_info['display']['ajax_content_url']) {
             $va_opts['ajaxContentUrl'] = $va_source_info['display']['ajax_content_url'];
         } else {
             $va_opts['contentTemplate'] = $va_source_info['display']['description_template'];
         }
         $va_ret = $o_map->mapFrom($vo_data, $va_source_info['data'], $va_opts);
         if (is_array($va_ret) && isset($va_ret['items'])) {
             $this->opn_num_items_rendered += (int) $va_ret['items'];
         }
     }
     return $o_map->render($ps_format, $pa_options);
 }
Пример #3
0
 /**
  * Generate maps output in specified format
  *
  * @param array $pa_viz_settings Array of visualization settings taken from visualization.conf
  * @param string $ps_format Specifies format to generate output in. Currently only 'HTML' is supported.
  * @param array $pa_options Array of options to use when rendering output. Supported options are:
  *		width =
  *		height =
  *		mapType - type of map to render; valid values are 'ROADMAP', 'SATELLITE', 'HYBRID', 'TERRAIN'; if not specified 'google_maps_default_type' setting in app.conf is used; if that is not set default is 'SATELLITE'
  *		showNavigationControls - if true, navigation controls are displayed; default is to use 'google_maps_show_navigation_controls' setting in app.conf
  *		showScaleControls -  if true, scale controls are displayed; default is to use 'google_maps_show_scale_controls' setting in app.conf
  *		showMapTypeControls -  if true, map type controls are displayed; default is to use 'google_maps_show_map_type_controls' setting in app.conf
  *		minZoomLevel - Minimum zoom level to allow; leave null if you don't want to enforce a limit
  *		maxZoomLevel - Maximum zoom level to allow; leave null if you don't want to enforce a limit
  *		zoomLevel - Zoom map to specified level rather than fitting all markers into view; leave null if you don't want to specify a zoom level. IF this option is set minZoomLevel and maxZoomLevel will be ignored.
  *		pathColor - 
  *		pathWeight -
  *		pathOpacity - 
  *		request = current request; required for generation of editor links
  */
 public function render($pa_viz_settings, $ps_format = 'HTML', $pa_options = null)
 {
     if (!($vo_data = $this->getData())) {
         return null;
     }
     $po_request = isset($pa_options['request']) && $pa_options['request'] ? $pa_options['request'] : null;
     if (!isset($pa_options['width']) || (int) $pa_options['width'] < 50) {
         $pa_options['width'] = 500;
     }
     if (!isset($pa_options['height']) || (int) $pa_options['height'] < 50) {
         $pa_options['height'] = 500;
     }
     $o_map = new GeographicMap($pa_options['width'], $pa_options['height'], $pa_options['id']);
     $this->opn_num_items_rendered = 0;
     foreach ($pa_viz_settings['sources'] as $vs_source_code => $va_source_info) {
         $va_ret = $o_map->mapFrom($vo_data, $va_source_info['data'], array('request' => $po_request, 'labelTemplate' => "<p class='vizTitle'>" . $va_source_info['display']['title_template'] . "</div>", 'renderLabelAsLink' => true, 'contentTemplate' => "<p>" . $va_source_info['display']['description_template'] . "</p>"));
         if (is_array($va_ret) && isset($va_ret['items'])) {
             $this->opn_num_items_rendered += (int) $va_ret['items'];
         }
     }
     return $o_map->render($ps_format, $pa_options);
 }
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * 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
 *
 * ----------------------------------------------------------------------
 */
AssetLoadManager::register("maps");
$vo_result = $this->getVar('result');
$vn_num_hits = $this->getVar('num_hits');
$va_access_values = $this->getVar('access_values');
if ($vo_result && $this->request->config->get('ca_objects_map_attribute')) {
    $o_map = new GeographicMap(740, 450, 'map2');
    $va_map_stats = $o_map->mapFrom($vo_result, $this->request->config->get('ca_objects_map_attribute'), array("ajaxContentUrl" => caNavUrl($this->request, $this->request->getModulePath(), $this->request->getController(), 'getMapItemInfo'), 'request' => $this->request, 'checkAccess' => $va_access_values));
    // map_stats is an array with two keys: 'points' = number of unique markers; 'items' = number of results hits than were plotted at least once on the map
    if ($va_map_stats['points'] > 0) {
        if ($va_map_stats['items'] < $vn_num_hits) {
            ?>
			<script type="text/javascript">
				jQuery('div.searchNav').html('<?php 
            print _t("%1 of %2 results have been mapped.  To see all results chose a different display.", $va_map_stats['items'], $vn_num_hits) . "</div>";
            ?>
');
			</script>
<?php 
        } else {
            ?>
			<script type="text/javascript">
    # --- vocabulary terms
    $va_terms = $t_occurrence->get("ca_list_items", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
    if (sizeof($va_terms) > 0) {
        print "<div class='unit'><h2>" . _t("Subject") . (sizeof($va_terms) > 1 ? "s" : "") . "</h2>";
        foreach ($va_terms as $va_term_info) {
            print "<div>" . caNavLink($this->request, $va_term_info['label'], '', '', 'Search', 'Index', array('search' => $va_term_info['label'])) . "</div>";
        }
        print "</div><!-- end unit -->";
    }
    ?>
	</div><!-- end leftCol -->
			</div>
	<div id="rightColMap">
		<!-- end resultBox -->
<?php 
    # --- map
    #if($this->request->config->get('ca_occurrences_map_attribute') && $t_occurrence->get($this->request->config->get('ca_occurrences_map_attribute'))){
    #	$o_map = new GeographicMap(300, 200, 'map');
    #	$o_map->mapFrom($t_occurrence, $this->request->config->get('ca_occurrences_map_attribute'));
    #	print "<div class='unit'>".$o_map->render('HTML')."</div>";
    #}
    if ($t_occurrence->get("ca_occurrences.georeference") || $t_occurrence->get("ca_occurrences.georeference")) {
        $o_map = new GeographicMap(550, 400, 'map');
        $o_map->mapFrom($t_occurrence, "ca_occurrences.georeference");
        print "<div class='unit'>" . $o_map->render('HTML') . "</div>";
    }
    ?>
	</div><!-- end rightCol -->
</div><!-- end detailBody -->
<?php 
}
Пример #6
0
 /**
  *
  */
 public function __call($ps_function, $pa_args)
 {
     AssetLoadManager::register("panel");
     AssetLoadManager::register("mediaViewer");
     AssetLoadManager::register("carousel");
     AssetLoadManager::register("readmore");
     AssetLoadManager::register("maps");
     $ps_function = strtolower($ps_function);
     $ps_id = urldecode($this->request->getActionExtra());
     if (!isset($this->opa_detail_types[$ps_function]) || !isset($this->opa_detail_types[$ps_function]['table']) || !($vs_table = $this->opa_detail_types[$ps_function]['table'])) {
         // invalid detail type – throw error
         die("Invalid detail type");
     }
     $t_table = $this->opo_datamodel->getInstanceByTableName($vs_table, true);
     if (($vb_use_identifiers_in_urls = caUseIdentifiersInUrls()) && substr($ps_id, 0, 3) == "id:") {
         $va_tmp = explode(":", $ps_id);
         $ps_id = (int) $va_tmp[1];
         $vb_use_identifiers_in_urls = false;
     }
     if (!$t_table->load($vb_use_identifiers_in_urls && $t_table->getProperty('ID_NUMBERING_ID_FIELD') ? $t_table->hasField('deleted') ? array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id, 'deleted' => 0) : array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id) : ($t_table->hasField('deleted') ? array($t_table->primaryKey() => (int) $ps_id, 'deleted' => 0) : array($t_table->primaryKey() => (int) $ps_id)))) {
         // invalid id - throw error
         die("Invalid id");
     }
     // Printables
     // 	merge displays with drop-in print templates
     //
     $va_export_options = caGetAvailablePrintTemplates('summary', array('table' => $t_table->tableName()));
     $this->view->setVar('export_formats', $va_export_options);
     $va_options = array();
     foreach ($va_export_options as $vn_i => $va_format_info) {
         $va_options[$va_format_info['name']] = $va_format_info['code'];
     }
     // Get current display list
     $t_display = new ca_bundle_displays();
     foreach (caExtractValuesByUserLocale($t_display->getBundleDisplays(array('table' => $this->ops_tablename, 'user_id' => $this->request->getUserID(), 'access' => __CA_BUNDLE_DISPLAY_READ_ACCESS__, 'checkAccess' => caGetUserAccessValues($this->request)))) as $va_display) {
         $va_options[$va_display['name']] = "_display_" . $va_display['display_id'];
     }
     ksort($va_options);
     $this->view->setVar('export_format_select', caHTMLSelect('export_format', $va_options, array('class' => 'searchToolsSelect'), array('value' => $this->view->getVar('current_export_format'), 'width' => '150px')));
     #
     # Enforce access control
     #
     if (sizeof($this->opa_access_values) && $t_table->hasField('access') && !in_array($t_table->get("access"), $this->opa_access_values)) {
         $this->notification->addNotification(_t("This item is not available for view"), "message");
         $this->response->setRedirect(caNavUrl($this->request, "", "", "", ""));
         return;
     }
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . $t_table->getTypeName() . ": " . $t_table->get('preferred_labels') . (($vs_idno = $t_table->get($t_table->getProperty('ID_NUMBERING_ID_FIELD'))) ? " [{$vs_idno}]" : ""));
     $vs_type = $t_table->getTypeCode();
     $this->view->setVar('detailType', $vs_table);
     $this->view->setVar('item', $t_table);
     $this->view->setVar('itemType', $vs_type);
     caAddPageCSSClasses(array($vs_table, $ps_function, $vs_type));
     // Do we need to pull in the multisearch result set?
     if (ResultContext::getLastFind($this->request, $vs_table, array('noSubtype' => true)) === 'multisearch') {
         $o_context = new ResultContext($this->request, $vs_table, 'multisearch', $ps_function);
         $o_context->setAsLastFind();
         $o_context->saveContext();
     } else {
         $o_context = ResultContext::getResultContextForLastFind($this->request, $vs_table);
     }
     $this->view->setVar('previousID', $vn_previous_id = $o_context->getPreviousID($t_table->getPrimaryKey()));
     $this->view->setVar('nextID', $vn_next_id = $o_context->getNextID($t_table->getPrimaryKey()));
     $this->view->setVar('previousURL', caDetailUrl($this->request, $vs_table, $vn_previous_id));
     $this->view->setVar('nextURL', caDetailUrl($this->request, $vs_table, $vn_next_id));
     $this->view->setVar('resultsURL', ResultContext::getResultsUrlForLastFind($this->request, $vs_table));
     $va_options = isset($this->opa_detail_types[$ps_function]['options']) && is_array($this->opa_detail_types[$ps_function]['options']) ? $this->opa_detail_types[$ps_function]['options'] : array();
     $this->view->setVar('previousLink', $vn_previous_id > 0 ? caDetailLink($this->request, caGetOption('previousLink', $va_options, _t('Previous')), '', $vs_table, $vn_previous_id) : '');
     $this->view->setVar('nextLink', $vn_next_id > 0 ? caDetailLink($this->request, caGetOption('nextLink', $va_options, _t('Next')), '', $vs_table, $vn_next_id) : '');
     $this->view->setVar('resultsLink', ResultContext::getResultsLinkForLastFind($this->request, $vs_table, caGetOption('resultsLink', $va_options, _t('Back'))));
     $this->view->setVar('commentsEnabled', (bool) $va_options['enableComments']);
     //
     //
     //
     if (method_exists($t_table, 'getPrimaryRepresentationInstance')) {
         if ($pn_representation_id = $this->request->getParameter('representation_id', pInteger)) {
             $t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
             $t_representation->load($pn_representation_id);
         } else {
             $t_representation = $t_table->getPrimaryRepresentationInstance(array("checkAccess" => $this->opa_access_values));
         }
         if ($t_representation) {
             $this->view->setVar("t_representation", $t_representation);
             $this->view->setVar("representation_id", $t_representation->get("representation_id"));
         } else {
             $t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
         }
         $this->view->setVar("representationViewer", caObjectDetailMedia($this->request, $t_table->getPrimaryKey(), $t_representation, $t_table, array("primaryOnly" => caGetOption('representationViewerPrimaryOnly', $va_options, false), "dontShowPlaceholder" => caGetOption('representationViewerDontShowPlaceholder', $va_options, false))));
     }
     //
     // map
     //
     if (!is_array($va_map_attributes = caGetOption('map_attributes', $va_options, array())) || !sizeof($va_map_attributes)) {
         if ($vs_map_attribute = caGetOption('map_attribute', $va_options, false)) {
             $va_map_attributes = array($vs_map_attribute);
         }
     }
     $this->view->setVar("map", "");
     if (is_array($va_map_attributes) && sizeof($va_map_attributes)) {
         $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
         $vn_mapped_count = 0;
         foreach ($va_map_attributes as $vs_map_attribute) {
             if ($t_table->get($vs_map_attribute)) {
                 $o_map->mapFrom($t_table, $vs_map_attribute);
                 $vn_mapped_count++;
             }
         }
         if ($vn_mapped_count > 0) {
             $this->view->setVar("map", $o_map->render('HTML'));
         }
     }
     //
     // comments, tags, rank
     //
     $this->view->setVar('averageRank', $t_table->getAverageRating(true));
     $this->view->setVar('numRank', $t_table->getNumRatings(true));
     #
     # User-generated comments, tags and ratings
     #
     $va_user_comments = $t_table->getComments(null, true);
     $va_comments = array();
     if (is_array($va_user_comments)) {
         foreach ($va_user_comments as $va_user_comment) {
             if ($va_user_comment["comment"] || $va_user_comment["media1"] || $va_user_comment["media2"] || $va_user_comment["media3"] || $va_user_comment["media4"]) {
                 # TODO: format date based on locale
                 $va_user_comment["date"] = date("n/j/Y", $va_user_comment["created_on"]);
                 # -- get name of commenter
                 if ($va_user_comment["user_id"]) {
                     $t_user = new ca_users($va_user_comment["user_id"]);
                     $va_user_comment["author"] = $t_user->getName();
                 } elseif ($va_user_comment["name"]) {
                     $va_user_comment["author"] = $va_user_comment["name"];
                 }
                 $va_comments[] = $va_user_comment;
             }
         }
     }
     $this->view->setVar('comments', $va_comments);
     $va_user_tags = $t_table->getTags(null, true);
     $va_tags = array();
     if (is_array($va_user_tags)) {
         foreach ($va_user_tags as $va_user_tag) {
             if (!in_array($va_user_tag["tag"], $va_tags)) {
                 $va_tags[] = $va_user_tag["tag"];
             }
         }
     }
     $this->view->setVar('tags_array', $va_tags);
     $this->view->setVar('tags', implode(", ", $va_tags));
     $this->view->setVar("itemComments", caDetailItemComments($this->request, $t_table->getPrimaryKey(), $t_table, $va_comments, $va_tags));
     //
     // share link
     //
     $this->view->setVar("shareLink", "<a href='#' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, '', 'Detail', 'ShareForm', array("tablename" => $t_table->tableName(), "item_id" => $t_table->getPrimaryKey())) . "\"); return false;'>Share</a>");
     // find view
     //		first look for type-specific view
     if (!$this->viewExists($vs_path = "Details/{$vs_table}_{$vs_type}_html.php")) {
         // If no type specific view use the default
         $vs_path = "Details/{$vs_table}_default_html.php";
     }
     switch ($ps_view = $this->request->getParameter('view', pString)) {
         case 'pdf':
             $this->_genExport($t_table, $this->request->getParameter("export_format", pString), 'Detail', 'Detail');
             break;
         default:
             //
             // Tag substitution
             //
             // Views can contain tags in the form {{{tagname}}}. Some tags, such as "itemType" and "detailType" are defined by
             // the detail controller. More usefully, you can pull data from the item being detailed by using a valid "get" expression
             // as a tag (Eg. {{{ca_objects.idno}}}. Even more usefully for some, you can also use a valid bundle display template
             // (see http://docs.collectiveaccess.org/wiki/Bundle_Display_Templates) as a tag. The template will be evaluated in the
             // context of the item being detailed.
             //
             $va_defined_vars = array_keys($this->view->getAllVars());
             // get list defined vars (we don't want to copy over them)
             $va_tag_list = $this->getTagListForView($vs_path);
             // get list of tags in view
             foreach ($va_tag_list as $vs_tag) {
                 if (in_array($vs_tag, $va_defined_vars)) {
                     continue;
                 }
                 if (strpos($vs_tag, "^") !== false || strpos($vs_tag, "<") !== false) {
                     $this->view->setVar($vs_tag, $t_table->getWithTemplate($vs_tag, array('checkAccess' => $this->opa_access_values)));
                 } elseif (strpos($vs_tag, ".") !== false) {
                     $this->view->setVar($vs_tag, $t_table->get($vs_tag, array('checkAccess' => $this->opa_access_values)));
                 } else {
                     $this->view->setVar($vs_tag, "?{$vs_tag}");
                 }
             }
             $this->render($vs_path);
             break;
     }
 }
								visibleHotSpotBackgrounds: "always",
								hotSpotScrollingInterval: 45
							});
						});
					</script>
<?php 
    }
    ?>
				</div><!-- end ex_related_list -->
<?php 
}
# --- places
$va_places = $t_occurrence->get("ca_places", array("restrictToRelationshipTypes" => array("site"), "returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_places) > 0) {
    $vn_map_height = 97;
    if (!$vn_descriptionOutput || !$vn_scrollEntities) {
        $vn_map_height = 200;
    }
    $va_place_info = array_pop($va_places);
    $t_place = new ca_places($va_place_info['place_id']);
    $o_map = new GeographicMap(238, $vn_map_height, 'map');
    $o_map->mapFrom($t_place, "ca_places.georeference", array("request" => $this->request, "checkAccess" => $va_access_values, 'contentTemplate' => "^ca_places.preferred_labels.name"));
    print "<div class='captionSmall'>" . $o_map->render('HTML');
    print ($this->request->config->get('allow_detail_for_ca_places') ? caNavLink($this->request, $va_place_info['label'], '', 'Detail', 'Place', 'Show', array('place_id' => $va_place_info['place_id'])) : $va_place_info['label']) . "</div>";
}
?>
			</div>
		
		
		
		</div><!-- end ex_content -->
Пример #8
0
 /**
  *
  */
 public function GetAction()
 {
     $pn_action_id = $this->request->getParameter('action_id', pInteger);
     $pn_silo_id = $this->request->getParameter('silo_id', pInteger);
     $t_action = new ca_occurrences($pn_action_id);
     $va_action = array();
     $va_action["objects"] = $t_action->get('ca_objects', array("restrict_to_relationship_types" => array("display", "secondary"), "returnAsArray" => 1, 'checkAccess' => $this->opa_access_values));
     $va_action["label"] = $t_action->getLabelforDisplay();
     $va_action["georeference"] = $t_action->get('ca_occurrences.georeference.geocode');
     # --- get a bigger map if there are no objects to show
     if (is_array($va_action["objects"]) && sizeof($va_action["objects"]) > 0) {
         $o_map = new GeographicMap(250, 128, 'mapAction' . $pn_action_id . 'Silo' . $pn_silo_id);
     } else {
         $o_map = new GeographicMap(500, 300, 'mapAction' . $pn_action_id . 'Silo' . $pn_silo_id);
     }
     $o_map->mapFrom($t_action, "ca_occurrences.georeference.geocode");
     $vs_map = $o_map->render('HTML');
     $va_action["map"] = $vs_map;
     $va_action["description"] = $t_action->get('description');
     $va_action["occurrence_id"] = $t_action->get('occurrence_id');
     $va_action["entities"] = $t_action->get('ca_entities', array("returnAsArray" => 1, 'checkAccess' => $this->opa_access_values, 'sort' => 'surname'));
     $va_action["collections"] = $t_action->get('ca_collections', array("returnAsArray" => 1, 'checkAccess' => $this->opa_access_values));
     $va_action["occurrences"] = $t_action->get('ca_occurrences', array("returnAsArray" => 1, 'checkAccess' => $this->opa_access_values));
     $va_action["date"] = $t_action->get('date', array('template' => "^dates_value"));
     # --- get next and previous ids
     $o_cache = caGetCacheObject('MetabolicChronology', 3600);
     $va_silos = $o_cache->load('silo_list');
     $va_silo_actionmap = $va_silos[$pn_silo_id]['actionmap'];
     $pn_previous_id = "";
     $pn_next_id = "";
     foreach ($va_silo_actionmap as $i => $va_action_info) {
         if ($va_action_info["id"] == $pn_action_id) {
             $pn_previous_id = $va_silo_actionmap[$i - 1]["id"];
             $pn_next_id = $va_silo_actionmap[$i + 1]["id"];
             break;
         }
     }
     $this->view->setVar('previous_id', $pn_previous_id);
     $this->view->setVar('next_id', $pn_next_id);
     $this->view->setVar('action', $va_action);
     $this->view->setVar('silo_id', $pn_silo_id);
     $this->render('action_info_html.php');
 }
Пример #9
0
?>
	</div><!-- end leftCol -->
	<div id="rightColMap">
<?php 
# --- map
# --- plot circle based on point for tracks and verts
$o_config = caGetDetailConfig();
$va_types = $o_config->getAssoc('detailTypes');
$va_options = $va_types["place"]["options"];
$vs_map_attribute = caGetOption('map_attribute', $va_options, false);
if ($vs_map_attribute && $t_place->get($vs_map_attribute)) {
    $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
    $o_map->mapFrom($t_place, $vs_map_attribute);
    print $o_map->render('HTML', array("obscure" => true, "circle" => true, "radius" => 20000, "fillColor" => "#000000", "pathColor" => "#000000", "zoomLevel" => 5));
} else {
    $qr_hits = ca_places::createResultSet($va_hierarchy_ids);
    if ($qr_hits->numHits()) {
        while ($qr_hits->nextHit()) {
            if ($qr_hits->get($vs_map_attribute)) {
                $t_place->load($qr_hits->get("place_id"));
                $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
                $o_map->mapFrom($t_place, $vs_map_attribute);
                print $o_map->render('HTML', array("obscure" => true, "circle" => true, "radius" => 20000, "fillColor" => "#000000", "pathColor" => "#000000", "zoomLevel" => 5));
                break;
            }
        }
    }
}
?>
	</div><!-- end rightColMap -->
</div><!-- end detailBody -->
Пример #10
0
            print "<div>" . caNavLink($this->request, $va_term_info['label'], '', '', 'Search', 'Index', array('search' => $va_term_info['label'])) . "</div>";
        }
        print "</div><!-- end unit -->";
    }
    # --- map
    ?>
	</div><!-- end rightCol -->
			
	<div id="leftCol">
		<div id="resultBox">
<?php 
}
// set parameters for paging controls view
$this->setVar('other_paging_parameters', array('place_id' => $vn_place_id));
if ($t_place->get('ca_places.georeference.geocode')) {
    $o_map = new GeographicMap(355, 270, 'map');
    $o_map->mapFrom($t_place, 'ca_places.georeference.geocode');
    print "<div style='padding-bottom:15px;'>" . $o_map->render('HTML') . "</div>";
}
print $this->render('related_objects_grid.php');
if (!$this->request->isAjax()) {
    ?>
		</div><!-- end resultBox -->


	</div><!-- end leftCol -->

	<div id='bottomBar'>
<?php 
    if ($this->request->isLoggedIn()) {
        print caNavLink($this->request, _t("Bookmark item +"), '', '', 'Bookmarks', 'addBookmark', array('row_id' => $vn_place_id, 'tablename' => 'ca_places'));
Пример #11
0
}
if ($va_external_links = $t_object->get("ca_objects.external_link.link_url", array("returnAsArray" => 1))) {
    print "<p>";
    foreach ($va_external_links as $va_external_link) {
        $vs_link_text = "";
        $vs_link_text = $va_external_link["link_text"];
        if (!$vs_link_text) {
            $vs_link_text = $va_external_link["link_url"];
        }
        print "<span class='caption'><a href='" . $va_external_link["link_url"] . "' target='_blank'>" . $vs_link_text . "</a></span><br/>";
    }
    print "</p>";
}
# --- 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(200, 200, 'map');
    $o_map->mapFrom($t_object, $this->request->config->get('ca_objects_map_attribute'), array("request" => $this->request, "checkAccess" => $va_access_values, 'contentTemplate' => "^ca_objects.preferred_labels.name"));
    print "<p class='caption'>" . $o_map->render('HTML') . "</p>";
}
?>
		</div> <!--end art_detail_info-->
		</div>
	</div><!--end art_content-->


<?php 
# --- $x is a hack to hide comment form - not sure if this is needed
if ($x && !$this->request->config->get('dont_allow_registration_and_login')) {
    # --- user data --- comments - ranking - tagging
    ?>
			
Пример #12
0
        # only show the first 5 and have a more link
        if ($i == 5) {
            print "<div id='moreChildrenLink'><a href='#' onclick='\$(\"#moreChildren\").slideDown(250); \$(\"#moreChildrenLink\").hide(1); return false;'>[" . _t("More") . "]</a></div><!-- end moreChildrenLink -->";
            print "<div id='moreChildren' style='display:none;'>";
        }
        print "<div>" . caNavLink($this->request, $va_child['name'], '', 'Detail', 'Object', 'Show', array('object_id' => $va_child['object_id'])) . "</div>";
        $i++;
        if ($i == sizeof($va_children)) {
            print "</div><!-- end moreChildren -->";
        }
    }
    print "</div><!-- end unit -->";
}
# --- 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(306, 200, 'map');
    $o_map->mapFrom($t_object, $this->request->config->get('ca_objects_map_attribute'));
    print "<div class='collapseListHeading'><a href='#' onclick='\$(\"#itemMap\").slideToggle(250); return false;'>" . _t("Map") . "</a></div><!-- end collapseListHeading -->";
    print "<div id='itemMap' style='display:none;'>";
    print "<div id='detailMap'>" . $o_map->render('HTML') . "</div>";
    print "</div><!-- end map -->";
}
$va_entities = $t_object->get("ca_entities", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
$va_occurrences = $t_object->get("ca_occurrences", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
$va_places = $t_object->get("ca_places", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
$va_collections = $t_object->get("ca_collections", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_entities) || sizeof($va_occurrences) || sizeof($va_places) || sizeof($va_collections)) {
    print "<div class='collapseListHeading'><a href='#' onclick='\$(\"#relatedAuthorities\").slideToggle(250); return false;'>" . _t("Related Information") . "</a></div><!-- end collapseListHeading -->";
    print "<div id='relatedAuthorities' class='listItems' style='display:none;'>";
    # --- entities
    if (sizeof($va_entities) > 0) {
Пример #13
0
</span>
			<ul><?php 
            print $vs_places_for_display;
            ?>
</ul>
		</div></div><!--end ad_col 2 -->
<?php 
        }
    }
    $o_place_search = new PlaceSearch();
    $qr_places = $o_place_search->search("ca_entities.entity_id: " . $vn_entity_id, array("checkAccess" => $va_access_values));
    #while($qr_places->nextHit()){
    #	print $qr_places->get("ca_place_labels.name");
    #}
    if ($qr_places->numHits()) {
        $o_map = new GeographicMap(355, 225, 'map');
        $va_map_stats = $o_map->mapFrom($qr_places, "georeference", array("request" => $this->request, "checkAccess" => $va_access_values, 'contentTemplate' => "^ca_places.preferred_labels.name"));
        if ($va_map_stats['points'] > 0) {
            print '<div class="ad_gmap">' . $o_map->render('HTML', array('delimiter' => "<br/>")) . '</div><!-- end ad_gmap -->';
        }
    }
    ?>
<div class="clear padded"></div>
<div id="ad_comments">
<?php 
    $va_comments = $this->getVar("comments");
    if (is_array($va_comments) && sizeof($va_comments) > 0) {
        ?>
	<div id="ad_comments_list"><div class="ad_comments_list_bg">
<?php 
        # --- user data --- comments --- images
Пример #14
0
            ?>
</h2>
<?php 
            foreach ($va_object_list as $vn_rel_object_id => $va_info) {
                print "<div>" . ($this->request->config->get('allow_detail_for_ca_objects') ? caNavLink($this->request, $va_info["idno"], '', 'Detail', 'Object', 'Show', array('object_id' => $vn_rel_object_id)) : $va_info["label"]) . " (" . $va_info['relationship_typename'] . ")</div>";
            }
            print "</div><!-- end unit -->";
        }
    }
    ?>
	</div><!-- end leftCol -->
			</div>
	<div id="rightColMap">
		<!-- end resultBox -->
<?php 
    # --- map
    #if($this->request->config->get('ca_places_map_attribute') && $t_place->get($this->request->config->get('ca_places_map_attribute'))){
    #	$o_map = new GeographicMap(300, 200, 'map');
    #	$o_map->mapFrom($t_place, $this->request->config->get('ca_places_map_attribute'));
    #	print "<div class='unit'>".$o_map->render('HTML')."</div>";
    #}
    if ($t_place->get("ca_places.publicGeoreference") || $t_place->get("ca_places.publicGeoreference")) {
        $o_map = new GeographicMap(550, 400, 'map');
        $o_map->mapFrom($t_place, "ca_places.publicGeoreference");
        print "<div class='unit'>" . $o_map->render('HTML') . "</div>";
    }
    ?>
	</div><!-- end rightCol -->
</div><!-- end detailBody -->
<?php 
}
 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * 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
 *
 * ----------------------------------------------------------------------
 */
$vo_result = $this->getVar('result');
$vn_num_hits = $this->getVar('num_hits');
if ($vo_result && $this->request->config->get('ca_objects_map_attribute')) {
    $o_map = new GeographicMap(320, 400, 'map');
    $va_map_stats = $o_map->mapFrom($vo_result, $this->request->config->get('ca_objects_map_attribute'), array("contentView" => "Results/ca_objects_results_map_balloon_html.php", 'request' => $this->request));
    // map_stats is an array with two keys: 'points' = number of unique markers; 'items' = number of results hits than were plotted at least once on the map
    if ($va_map_stats['points'] > 0) {
        if ($va_map_stats['items'] < $vn_num_hits) {
            ?>
			<script type="text/javascript">
				jQuery('div.searchNav').html('<?php 
            print _t("%1 of %2 results have been mapped.  To see all results chose a different display by clicking the \"Options\" link below.", $va_map_stats['items'], $vn_num_hits) . "</div>";
            ?>
');
			</script>
<?php 
        } else {
            ?>
			<script type="text/javascript">
Пример #16
0
        print "<div>" . ($this->request->config->get('allow_detail_for_ca_collections') ? caNavLink($this->request, $va_collection_info['label'], '', 'Detail', 'Collection', 'Show', array('collection_id' => $va_collection_info['collection_id'])) : $va_collection_info['label']) . " (" . $va_collection_info['relationship_typename'] . ")</div>";
    }
    print "</div><!-- end unit -->";
}
# --- vocabulary terms
$va_terms = $t_object->get("ca_list_items", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_terms) > 0) {
    print "<div class='unit'><div class='unitHeader'>" . _t("Subject") . (sizeof($va_terms) > 1 ? "s" : "") . "</div>";
    foreach ($va_terms as $va_term_info) {
        print "<div>" . caNavLink($this->request, ucwords($va_term_info['label']), '', '', 'Search', 'Index', array('search' => $va_term_info['label'])) . "</div>";
    }
    print "</div><!-- end unit -->";
}
# --- 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>";
        foreach ($va_subjects as $va_term) {
            $va_subject_links[] = caNavLink($this->request, $va_term["label"], '', '', 'Browse', 'clearAndAddCriteria', array('target' => 'ca_collections', 'facet' => 'subject_facet', 'id' => $va_term['item_id']));
        }
        print implode(", ", $va_subject_links);
        ?>
					</div><!-- end unit -->
<?php 
        TooltipManager::add("#subject", "<div class='infoTooltip'>Term(s) identifying what the work or collection is about.</div>");
    }
    # --- places
    #$va_geonames = $t_collection->getAttributesByElement('geonames');
    $va_geoferences = $t_collection->getAttributesByElement('georeference');
    #if((is_array($va_geonames) && (sizeof($va_geonames) > 0)) || (is_array($va_geoferences) && (sizeof($va_geoferences) > 0))){
    if (is_array($va_geoferences) && sizeof($va_geoferences) > 0) {
        print "\n<div class='unit'><div class='infoButton' id='place'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Place(s)") . "</div>";
        $o_map = new GeographicMap(390, 300, 'map');
        $o_map->mapFrom($t_collection, 'georeference');
        print "<div class='collectionMap'>" . $o_map->render('HTML') . "</div>";
        print "<div class='collectionMapLabel'>";
        // foreach($va_geonames as $o_geoname) {
        // 					foreach($o_geoname->getValues() as $o_value) {
        // 						$va_coord = $o_value->getDisplayValue(array('coordinates' => true));
        // 						//print caNavLink($this->request, trim($va_coord['label']), '', '', 'Search', 'Index', array('search' => '"'.trim($va_coord['label']).'"', 'target' => 'ca_collections'));
        // 					}
        // 					print "<br/>";
        // 				}
        foreach ($va_geoferences as $o_georeference) {
            foreach ($o_georeference->getValues() as $o_value) {
                $va_coord = $o_value->getDisplayValue(array('coordinates' => true));
                //print caNavLink($this->request, trim($va_coord['label']), '', '', 'Search', 'Index', array('search' => '"'.trim($va_coord['label']).'"', 'target' => 'ca_collections'));
                print caNavLink($this->request, trim($va_coord['label']), '', '', 'Browse', 'clearAndAddCriteria', array('target' => 'ca_collections', 'facet' => 'geoloc_facet', 'id' => trim($va_coord['label'])));
Пример #18
0
        print "<div>" . ($this->request->config->get('allow_detail_for_ca_object_lots') ? caNavLink($this->request, $va_object_lot_info['label'], '', 'Detail', 'ObjectLots', 'Show', array('lot_id' => $va_object_lot_info['lot_id'])) : $va_object_lot_info['label']) . " (" . $va_object_lot_info['relationship_typename'] . ")</div>";
    }
    print "</div><!-- end unit -->";
}
# --- vocabulary terms
$va_terms = $t_object->get("ca_list_items", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_terms) > 0) {
    print "<div class='unit'><h2>" . _t("Subject") . (sizeof($va_terms) > 1 ? "s" : "") . "</h2>";
    foreach ($va_terms as $va_term_info) {
        print "<div>" . caNavLink($this->request, $va_term_info['label'], '', '', 'Search', 'Index', array('search' => $va_term_info['label'])) . "</div>";
    }
    print "</div><!-- end unit -->";
}
# --- 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(230, 200, 'map');
    $o_map->mapFrom($t_object, $this->request->config->get('ca_objects_map_attribute'));
    print "<div class='unit' style='margin-top:15px; margin-bottom:20px;'>" . $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'><h2>" . _t("Related Objects") . "</h2>";
    print "<div id='objDetailRelObjects'>";
    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));
        print "<div 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']);