field--field_sedes.tpl.php
6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?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>