field--field_sedes.tpl.php 6.63 KB
<?php
/**
* @file field.tpl.php
* Default template implementation to display the value of a field.
*
* This file is not used and is here as a starting point for customization only.
* @see theme_field()
*
* Available variables:
* - $items: An array of field values. Use render() to output them.
* - $label: The item label.
* - $label_hidden: Whether the label display is set to 'hidden'.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the
* following:
* - field: The current template type, i.e., "theming hook".
* - field-name-[field_name]: The current field name. For example, if the
* field name is "field_description" it would result in
* "field-name-field-description".
* - field-type-[field_type]: The current field type. For example, if the
* field type is "text" it would result in "field-type-text".
* - field-label-[label_display]: The current label position. For example, if
* the label position is "above" it would result in "field-label-above".
*
* Other variables:
* - $element['#object']: The entity to which the field is attached.
* - $element['#view_mode']: View mode, e.g. 'full', 'teaser'...
* - $element['#field_name']: The field name.
* - $element['#field_type']: The field type.
* - $element['#field_language']: The field language.
* - $element['#field_translatable']: Whether the field is translatable or not.
* - $element['#label_display']: Position of label display, inline, above, or
* hidden.
* - $field_name_css: The css-compatible field name.
* - $field_type_css: The css-compatible field type.
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
*
* @see template_preprocess_field()
* @see theme_field()
*
* @ingroup themeable
*/
?>
<!--
THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY.
See http://api.drupal.org/api/function/theme_field/7 for details.
After copying this file to your theme's folder and customizing it, remove this
HTML comment.
-->

<?php
/**
* @file field.tpl.php
* Default template implementation to display the value of a field.
*
* This file is not used and is here as a starting point for customization only.
* @see theme_field()
*
* Available variables:
* - $items: An array of field values. Use render() to output them.
* - $label: The item label.
* - $label_hidden: Whether the label display is set to 'hidden'.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the
* following:
* - field: The current template type, i.e., "theming hook".
* - field-name-[field_name]: The current field name. For example, if the
* field name is "field_description" it would result in
* "field-name-field-description".
* - field-type-[field_type]: The current field type. For example, if the
* field type is "text" it would result in "field-type-text".
* - field-label-[label_display]: The current label position. For example, if
* the label position is "above" it would result in "field-label-above".
*
* Other variables:
* - $element['#object']: The entity to which the field is attached.
* - $element['#view_mode']: View mode, e.g. 'full', 'teaser'...
* - $element['#field_name']: The field name.
* - $element['#field_type']: The field type.
* - $element['#field_language']: The field language.
* - $element['#field_translatable']: Whether the field is translatable or not.
* - $element['#label_display']: Position of label display, inline, above, or
* hidden.
* - $field_name_css: The css-compatible field name.
* - $field_type_css: The css-compatible field type.
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
*
* @see template_preprocess_field()
* @see theme_field()
*
* @ingroup themeable
*/
?>
<!--
THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY.
See http://api.drupal.org/api/function/theme_field/7 for details.
After copying this file to your theme's folder and customizing it, remove this
HTML comment.
-->
<div class="title1">
<h1>Sedes donde se imparte</h1>
<hr>
</br>
</div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<style>

.lightbox-processed{ margin:0px}

</style>	

<div id="map_canvas_for" style="width:100%; height:250px"></div>

<div id="puntos_for" style="display:none">

<?php foreach ($items as $delta => $item): ?>    
	<div class="punto_for">
    <div id="name"><?php print $item["#options"]["entity"]->name ?></div>
    <div id="description"><?php print $item["#options"]["entity"]->description ?></div>
    <div id="longitud"><?php print $item["#options"]["entity"]->field_longitud["und"][0]["value"] ?></div>
    <div id="latitud"><?php print $item["#options"]["entity"]->field_latitud["und"][0]["value"] ?></div>
    </div>
<?php endforeach; ?>
    
  </div>
<script>

var myZona = new Array();
var marker = new Array();
var contentString = new Array();
var infowindow = new Array();

jQuery(document).ready(function() {  
	pintaMapa("map_canvas_for");
});

/**
* 
* 
**/

function pintaMapa(destID) {
	
	var ptoCentro = new google.maps.LatLng(8.918667, -67.423326); //CALABOZO, aprox!!!
	var myOptions = {
		zoom: 6,
		center: ptoCentro,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	var map = new google.maps.Map(document.getElementById(destID), myOptions);
	
	var i = 0;
	var puntos = jQuery("#puntos_for .punto_for")	
	jQuery.each ( puntos, function() {
	//$.each ( $puntos, function(key, val) {
		var titulo = jQuery(this).find("#name").text();
		var url = jQuery(this).find("#name").text();
		myZona[i] = new google.maps.LatLng(jQuery(this).find("#latitud").text(), jQuery(this).find("#longitud").text()); 
		contentString[i] = '<div class="google-content">'+
			'<h2>' + titulo + '</h2>'+
			'<div class="bodyContent">'+
			'<p>' +  jQuery(this).find("#description").text() + '</p>'+
			'</div>'+
			'</div>';		
		infowindow[i] = new google.maps.InfoWindow({ content: contentString[i] });
		marker[i] = new google.maps.Marker({ position: myZona[i], map: map, title: titulo });
		marker[i].setIcon('http://localhost/sitio-ubv/sites/all/themes/jollyness/assets/images/ico_sede.png');
		eval ( "google.maps.event.addListener( marker[" + i + "], 'click', function() { infowindow["+i+"].open( map, marker["+i+"] ); })");
		i++;
	});
}

</script>