23 $lng->loadLanguageModule(
"user");
25 $ilCtrl->saveParameter($this,
"user_id");
26 if (
$_GET[
"back_url"] !=
"")
39 $this->userid = $a_userid;
59 $this->asrows = $a_asrows;
79 $this->additional = $a_additional;
89 return $this->additional;
100 $this->backurl = $a_backurl;
101 $ilCtrl->setParameter($this,
"back_url", rawurlencode($a_backurl));
111 return $this->backurl;
121 $cmd = $ilCtrl->getCmd();
123 return $this->
$cmd();
149 $tpl->setCurrentBlock(
"back_url");
150 $tpl->setVariable(
"TXT_BACK", $lng->txt(
"back"));
152 $tpl->parseCurrentBlock();
157 $tpl->touchBlock(
"table_end");
158 $tpl->setCurrentBlock(
"table_start");
159 $tpl->setVariable(
"USR_PROFILE", $lng->txt(
"profile_of").
" ".
$user->getLogin());
160 $tpl->parseCurrentBlock();
163 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
164 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
168 if (
$user->getPref(
"public_profile") !=
"y" &&
169 (
$user->getPref(
"public_profile") !=
"g" || !$ilSetting->get(
'enable_global_profiles')))
174 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
188 $tpl->setVariable(
'MAIL_USR_LOGIN',urlencode(
$user->getLogin()));
190 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
191 $tpl->setVariable(
"FIRSTNAME",
$user->getUTitle().
" ".
$user->getFirstName());
192 $tpl->setVariable(
"LASTNAME",
$user->getLastName());
195 $tpl->setCurrentBlock(
"vcard");
196 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
197 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
198 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
199 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
203 if (
$user->prefs[
"public_profile"] ==
"g" && $ilSetting->get(
'enable_global_profiles'))
205 $tpl->setCurrentBlock(
"link");
206 $tpl->setVariable(
"TXT_LINK", $lng->txt(
"usr_link_to_profile"));
207 $tpl->setVariable(
"HREF_LINK", ILIAS_HTTP_PATH.
"/goto.php?client=".CLIENT_ID.
"&target=usr_".
$user->getId());
208 $tpl->parseCurrentBlock();
213 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
214 $check_file = $check_dir.
"/usr_images/".
$user->getPref(
"profile_image");
216 if (!@is_file($check_file))
218 $imagefile = $check_file =
222 if (
$user->getPref(
"public_upload")==
"y" && $imagefile !=
"")
226 $tpl->setCurrentBlock(
"image");
227 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
228 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
229 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
230 $tpl->parseCurrentBlock();
234 if (
$user->getPref(
"public_street") ==
"y" ||
$user->getPref(
"public_zipcode") ==
"y"
235 ||
$user->getPref(
"public_city") ==
"y" ||
$user->getPref(
"public_countr") ==
"y")
237 $tpl->setCurrentBlock(
"address");
238 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
239 $val_arr = array (
"getStreet" =>
"street",
240 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country");
241 foreach ($val_arr as
$key => $value)
244 if (
$user->getPref(
"public_".$value) ==
"y")
246 $tpl->setVariable(strtoupper($value),
$user->$key());
249 $tpl->parseCurrentBlock();
253 if (
$user->getPref(
"public_institution") ==
"y" ||
$user->getPref(
"public_department") ==
"y")
255 $tpl->setCurrentBlock(
"inst_dep");
257 if (
$user->getPref(
"public_institution") ==
"y")
259 $h = $lng->txt(
"institution");
260 $v =
$user->getInstitution();
263 if (
$user->getPref(
"public_department") ==
"y")
265 $h.= $sep.$lng->txt(
"department");
266 $v.= $sep.$user->getDepartment();
268 $tpl->setVariable(
"TXT_INST_DEP", $h);
269 $tpl->setVariable(
"INST_DEP", $v);
270 $tpl->parseCurrentBlock();
275 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
276 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
278 foreach ($val_arr as
$key => $value)
281 if (
$user->getPref(
"public_".$value) ==
"y")
283 $v.= $sep.$lng->txt($value).
": ".
$user->$key();
287 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
289 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
291 foreach ($im_arr as $im_name)
293 if ($im_id =
$user->getInstantMessengerId($im_name))
295 if (
$user->getPref(
"public_im_".$im_name) !=
"n")
297 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
305 $tpl->parseCurrentBlock(
"contact");
306 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
307 $tpl->setVariable(
"CONTACT", $v);
308 $tpl->parseCurrentBlock();
313 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
315 foreach ($val_arr as
$key => $value)
318 if (
$user->getPref(
"public_".$value) ==
"y")
320 $tpl->setCurrentBlock(
"profile_data");
321 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
322 $tpl->setVariable(
"DATA",
$user->$key());
323 $tpl->parseCurrentBlock();
329 if (
$user->getPref(
"public_delicious") ==
"y")
331 $tpl->setCurrentBlock(
"delicious_row");
332 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
333 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
335 $tpl->setVariable(
"DEL_ACCOUNT",
$user->getDelicious());
336 $tpl->parseCurrentBlock();
340 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
342 &&
$user->getLatitude() !=
"")
344 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
346 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
349 $map_gui->setMapId(
"user_map");
350 $map_gui->setWidth(
"350px");
351 $map_gui->setHeight(
"230px");
352 $map_gui->setLatitude(
$user->getLatitude());
353 $map_gui->setLongitude(
$user->getLongitude());
354 $map_gui->setZoom(
$user->getLocationZoom());
355 $map_gui->setEnableNavigationControl(
true);
356 $map_gui->addUserMarker(
$user->getId());
358 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
362 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
364 $user_defined_data =
$user->getUserDefinedData();
365 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
368 if (
$user->prefs[
"public_udf_".$definition[
"field_id"]] ==
"y")
370 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
372 $tpl->setCurrentBlock(
"udf_data");
373 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
374 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
375 $tpl->parseCurrentBlock();
382 if (is_array($additional))
384 foreach($additional as
$key => $val)
386 $tpl->setCurrentBlock(
"profile_data");
387 $tpl->setVariable(
"TXT_DATA",
$key);
388 $tpl->setVariable(
"DATA", $val);
389 $tpl->parseCurrentBlock();
408 require_once
"./Services/User/classes/class.ilvCard.php";
411 if (
$user->getPref(
"public_profile") !=
"y" &&
412 $user->getPref(
"public_profile") !=
"g")
417 $vcard->setName(
$user->getLastName(),
$user->getFirstName(),
"",
$user->getUTitle());
418 $vcard->setNickname(
$user->getLogin());
421 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image");
422 if (
$user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
424 $fh = fopen($imagefile,
"r");
427 $image = fread($fh, filesize($imagefile));
429 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
431 if (preg_match(
"/^image/", $mimetype))
435 $vcard->setPhoto($image,
$type);
439 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
440 "getStreet" =>
"street",
441 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
442 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
443 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
444 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip");
448 foreach ($val_arr as
$key => $value)
451 if (
$user->getPref(
"public_".$value) ==
"y")
456 $org[0] =
$user->$key();
459 $org[1] =
$user->$key();
462 $adr[2] =
$user->$key();
465 $adr[5] =
$user->$key();
468 $adr[3] =
$user->$key();
471 $adr[6] =
$user->$key();
486 $vcard->setEmail(
$user->$key());
489 $vcard->setNote(
$user->$key());
497 $vcard->setOrganization(join(
";", $org));
501 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
504 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());
512 global
$tpl, $ilUser;
514 $user_id = (int)
$_GET[
"user_id"];
521 if ($ilUser->getId() == ANONYMOUS_USER_ID &&
$user->getPref(
"public_profile") !=
"g")
525 $tpl->getStandardTemplate();
526 $tpl->setContent($this->
getHTML());