44 $ilCtrl->saveParameter($this,
"user_id");
45 if (
$_GET[
"back_url"] !=
"")
58 $this->userid = $a_userid;
78 $this->asrows = $a_asrows;
98 $this->additional = $a_additional;
108 return $this->additional;
119 $this->backurl = $a_backurl;
120 $ilCtrl->setParameter($this,
"back_url", rawurlencode($a_backurl));
130 return $this->backurl;
140 $cmd = $ilCtrl->getCmd();
142 return $this->
$cmd();
168 $tpl->setCurrentBlock(
"back_url");
169 $tpl->setVariable(
"TXT_BACK", $lng->txt(
"back"));
171 $tpl->parseCurrentBlock();
176 $tpl->touchBlock(
"table_end");
177 $tpl->setCurrentBlock(
"table_start");
178 $tpl->setVariable(
"USR_PROFILE", $lng->txt(
"profile_of").
" ".
$user->getLogin());
179 $tpl->parseCurrentBlock();
182 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
183 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
187 if (
$user->getPref(
"public_profile") !=
"y")
192 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
206 $tpl->setVariable(
'MAIL_USR_LOGIN',urlencode(
$user->getLogin()));
208 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
209 $tpl->setVariable(
"FIRSTNAME",
$user->getFirstName());
210 $tpl->setVariable(
"LASTNAME",
$user->getLastName());
212 $tpl->setCurrentBlock(
"vcard");
213 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
214 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
215 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
216 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
221 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image");
222 $check_file = $check_dir.
"/usr_images/".
$user->getPref(
"profile_image");
224 if (
$user->getPref(
"public_upload")==
"y" && @is_file($check_file))
228 $tpl->setCurrentBlock(
"image");
229 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
230 $tpl->setVariable(
"IMAGE_PATH", $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image").
"?dummy=".rand(1,999999));
231 $tpl->parseCurrentBlock();
234 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
235 "getStreet" =>
"street",
236 "getZipcode" =>
"zip",
"getCity" =>
"city",
"getCountry" =>
"country",
237 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
238 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
239 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
241 foreach ($val_arr as $key => $value)
244 if (
$user->getPref(
"public_".$value) ==
"y")
246 $tpl->setCurrentBlock(
"profile_data");
247 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
248 $tpl->setVariable(
"DATA",
$user->$key());
249 $tpl->parseCurrentBlock();
255 if ($d_set->get(
"user_profile") ==
"1" &&
$user->getPref(
"public_delicious") ==
"y")
257 $tpl->setCurrentBlock(
"delicious_row");
258 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
259 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
261 $tpl->setVariable(
"DEL_ACCOUNT",
$user->getDelicious());
262 $tpl->parseCurrentBlock();
266 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
268 &&
$user->getLatitude() !=
"")
270 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
272 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
275 $map_gui->setMapId(
"user_map");
276 $map_gui->setWidth(
"350px");
277 $map_gui->setHeight(
"230px");
278 $map_gui->setLatitude(
$user->getLatitude());
279 $map_gui->setLongitude(
$user->getLongitude());
280 $map_gui->setZoom(
$user->getLocationZoom());
281 $map_gui->setEnableNavigationControl(
true);
282 $map_gui->addUserMarker(
$user->getId());
284 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
288 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
290 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype");
292 foreach ($im_arr as $im_name)
294 if ($im_id =
$user->getInstantMessengerId($im_name))
296 $tpl->setCurrentBlock(
"profile_data");
297 $tpl->setVariable(
"TXT_DATA", $lng->txt(
'im_'.$im_name));
299 $tpl->setVariable(
"TXT_ICON", $lng->txt(
"im_".$im_name.
"_icon"));
300 $tpl->setVariable(
"DATA", $im_id);
301 $tpl->parseCurrentBlock();
308 if (is_array($additional))
310 foreach($additional as $key => $val)
312 $tpl->setCurrentBlock(
"profile_data");
313 $tpl->setVariable(
"TXT_DATA", $key);
314 $tpl->setVariable(
"DATA", $val);
315 $tpl->parseCurrentBlock();
334 require_once
"./Services/User/classes/class.ilvCard.php";
337 if (
$user->getPref(
"public_profile")!=
"y")
342 $vcard->setName(
$user->getLastName(),
$user->getFirstName(),
"",
$user->getUTitle());
343 $vcard->setNickname(
$user->getLogin());
346 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image");
347 if (
$user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
349 $fh = fopen($imagefile,
"r");
352 $image = fread($fh, filesize($imagefile));
354 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
356 if (preg_match(
"/^image/", $mimetype))
360 $vcard->setPhoto($image, $type);
364 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
365 "getStreet" =>
"street",
366 "getZipcode" =>
"zip",
"getCity" =>
"city",
"getCountry" =>
"country",
367 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
368 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
369 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
373 foreach ($val_arr as $key => $value)
376 if (
$user->getPref(
"public_".$value) ==
"y")
381 $org[0] =
$user->$key();
384 $org[1] =
$user->$key();
387 $adr[2] =
$user->$key();
390 $adr[5] =
$user->$key();
393 $adr[3] =
$user->$key();
396 $adr[6] =
$user->$key();
411 $vcard->setEmail(
$user->$key());
414 $vcard->setNote(
$user->$key());
422 $vcard->setOrganization(join(
";", $org));
426 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
429 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());