33 require_once(
"Services/Maps/classes/class.ilMapGUI.php");
53 $this->tpl =
new ilTemplate(
"tpl.google_map.html",
54 true,
true,
"Services/Maps");
56 $tpl->addJavaScript(
"//maps.google.com/maps/api/js?sensor=false",
false);
57 $tpl->addJavaScript(
"Services/Maps/js/ServiceGoogleMaps.js");
61 foreach($this->user_marker as $user_id)
66 if ($user->getLatitude() != 0 && $user->getLongitude() != 0 &&
67 $user->getPref(
"public_location") ==
"y")
69 $this->tpl->setCurrentBlock(
"user_marker");
70 $this->tpl->setVariable(
"UMAP_ID",
72 $this->tpl->setVariable(
"CNT", $cnt);
74 $this->tpl->setVariable(
"ULAT", htmlspecialchars($user->getLatitude()));
75 $this->tpl->setVariable(
"ULONG", htmlspecialchars($user->getLongitude()));
76 $info = htmlspecialchars($user->getFirstName().
" ".$user->getLastName());
78 if ($user->getPref(
"public_institution") ==
"y")
80 $info.= $delim.htmlspecialchars($user->getInstitution());
83 if ($user->getPref(
"public_department") ==
"y")
85 $info.= $delim.htmlspecialchars($user->getDepartment());
88 if ($user->getPref(
"public_street") ==
"y")
90 $info.= $delim.htmlspecialchars($user->getStreet());
92 if ($user->getPref(
"public_zip") ==
"y")
94 $info.= $delim.htmlspecialchars($user->getZipcode());
97 if ($user->getPref(
"public_city") ==
"y")
99 $info.= $delim.htmlspecialchars($user->getCity());
102 if ($user->getPref(
"public_country") ==
"y")
104 $info.= $delim.htmlspecialchars($user->getCountry());
106 $this->tpl->setVariable(
"USER_INFO",
108 $this->tpl->setVariable(
"IMG_USER",
109 $user->getPersonalPicturePath(
"xsmall"));
110 $this->tpl->parseCurrentBlock();
116 $this->tpl->setVariable(
"MAP_ID", $this->
getMapId());
117 $this->tpl->setVariable(
"WIDTH", $this->
getWidth());
118 $this->tpl->setVariable(
"HEIGHT", $this->
getHeight());
119 $this->tpl->setVariable(
"LAT", $this->
getLatitude());
121 $this->tpl->setVariable(
"ZOOM", (
int) $this->
getZoom());
125 $this->tpl->setVariable(
"TYPE_CONTROL", $type_control);
129 $this->tpl->setVariable(
"NAV_CONTROL", $nav_control);
133 $this->tpl->setVariable(
"UPDATE_LISTENER", $update_listener);
137 $this->tpl->setVariable(
"LARGE_CONTROL", $large_map_control);
141 $this->tpl->setVariable(
"CENTRAL_MARKER", $central_marker);
143 return $this->tpl->get();
153 $list_tpl =
new ilTemplate(
"tpl.google_map_user_list.html",
154 true,
true,
"Services/Maps");
157 foreach($this->user_marker as $user_id)
162 $this->css_row = ($this->css_row !=
"tblrow1_mo")
165 if ($user->getLatitude() != 0 && $user->getLongitude() != 0
166 && $user->getPref(
"public_location") ==
"y")
168 $list_tpl->setCurrentBlock(
"item");
169 $list_tpl->setVariable(
"MARKER_CNT", $cnt);
170 $list_tpl->setVariable(
"MAP_ID", $this->
getMapId());
175 $list_tpl->setCurrentBlock(
"item_no_link");
177 $list_tpl->setVariable(
"CSS_ROW", $this->css_row);
178 $list_tpl->setVariable(
"TXT_USER", $user->getLogin());
179 $list_tpl->setVariable(
"IMG_USER",
180 $user->getPersonalPicturePath(
"xxsmall"));
181 $list_tpl->parseCurrentBlock();
182 $list_tpl->touchBlock(
"row");
186 return $list_tpl->get();