41 $ilCtrl->saveParameter($this, array(
"user_id",
"back_url",
"user"));
42 if (
$_GET[
"back_url"] !=
"")
47 $lng->loadLanguageModule(
"user");
57 $this->userid = $a_userid;
77 $this->additional = $a_additional;
100 $parts = parse_url($a_backurl);
106 $this->backurl = $a_backurl;
107 $ilCtrl->setParameter($this,
"back_url", rawurlencode($a_backurl));
112 global $ilMainMenu, $ilTabs,
$lng;
121 $back =
'ilias.php?baseClass=ilPersonalDesktopGUI';
124 if((
bool)$a_is_portfolio)
126 $ilMainMenu->setTopBarBack($back);
131 $ilTabs->clearTargets();
132 $ilTabs->setBackTarget($lng->txt(
"back"),
154 $this->custom_prefs = $a_prefs;
168 if(!$this->custom_prefs)
170 return $a_user->
getPref($a_id);
174 return $this->custom_prefs[$a_id];
180 $this->embedded = (bool)$a_value;
181 $this->offline = (bool)$a_offline;
191 if(!self::validateUser($this->
getUserId()))
196 $next_class = $ilCtrl->getNextClass($this);
197 $cmd = $ilCtrl->getCmd();
199 $tpl->getStandardTemplate();
203 case "ilobjportfoliogui":
209 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
212 $gui->setPermaLink($this->
getUserId(),
"usr");
213 $ilCtrl->forwardCommand($gui);
219 $tpl->setContent(
$ret);
224 if (strtolower(
$_GET[
"baseClass"]) ==
"ilpublicuserprofilegui")
253 if(!$user->getActive() ||
254 !$user->checkTimeLimit())
261 $ilCtrl->redirectByClass(
"ilobjportfoliogui",
"preview");
273 if ($user->getPref(
"public_profile") !=
"y" &&
274 ($user->getPref(
"public_profile") !=
"g" || !$ilSetting->get(
'enable_global_profiles')) &&
275 !$this->custom_prefs)
305 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
306 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
308 if(!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID)
310 $ref_url = str_replace(
"&",
"&", $this->
getBackUrl());
313 $ref_url = basename($_SERVER[
'REQUEST_URI']);
316 $tpl->setCurrentBlock(
"mail");
317 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
318 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
320 $tpl->parseCurrentBlock();
326 $first_name .= $user->getUTitle().
" ";
328 $first_name .= $user->getFirstName();
330 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
331 $tpl->setVariable(
"FIRSTNAME", $first_name);
332 $tpl->setVariable(
"LASTNAME", $user->getLastName());
337 $tpl->setCurrentBlock(
"vcard");
338 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
339 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
340 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
341 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
346 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
347 $check_file = $check_dir.
"/usr_images/".$user->getPref(
"profile_image");
349 if (!@is_file($check_file))
351 $imagefile = $check_file =
357 $imagefile = basename($imagefile);
360 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"")
364 $tpl->setCurrentBlock(
"image");
365 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
366 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
367 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
368 $tpl->parseCurrentBlock();
378 $val_arr = array (
"getStreet" =>
"street",
379 "getZipcode" =>
"zipcode",
381 "getCountry" =>
"country",
382 "getSelectedCountry" =>
"sel_country");
383 foreach ($val_arr as $key => $value)
388 $address_value = $user->$key();
391 if (trim($address_value) !=
"")
396 $address[0] = $address_value;
401 $address[1] .=
" ".$address_value;
405 $lng->loadLanguageModule(
"meta");
406 $address[2] = $lng->txt(
"meta_c_".$address_value);
410 $address[2] = $address_value;
418 $tpl->setCurrentBlock(
"address_line");
419 foreach($address as $line)
423 $tpl->setVariable(
"TXT_ADDRESS_LINE", trim($line));
424 $tpl->parseCurrentBlock();
427 $tpl->setCurrentBlock(
"address");
428 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
429 $tpl->parseCurrentBlock();
434 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
437 $tpl->setCurrentBlock(
"inst_dep");
439 if ($this->
getPublicPref($user,
"public_institution") ==
"y")
441 $h = $lng->txt(
"institution");
442 $v = $user->getInstitution();
447 $h.= $sep.$lng->txt(
"department");
448 $v.= $sep.$user->getDepartment();
450 $tpl->setVariable(
"TXT_INST_DEP", $h);
451 $tpl->setVariable(
"INST_DEP", $v);
452 $tpl->parseCurrentBlock();
457 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
458 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
460 foreach ($val_arr as $key => $value)
465 $v.= $sep.$lng->txt($value).
": ".$user->$key();
469 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
471 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
473 foreach ($im_arr as $im_name)
475 if ($im_id = $user->getInstantMessengerId($im_name))
477 if ($this->
getPublicPref($user,
"public_im_".$im_name) !=
"n")
479 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
487 $tpl->parseCurrentBlock(
"contact");
488 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
489 $tpl->setVariable(
"CONTACT", $v);
490 $tpl->parseCurrentBlock();
495 "getHobby" =>
"hobby",
496 "getGeneralInterestsAsText" =>
"interests_general",
497 "getOfferingHelpAsText" =>
"interests_help_offered",
498 "getLookingForHelpAsText" =>
"interests_help_looking",
499 "getMatriculation" =>
"matriculation",
500 "getClientIP" =>
"client_ip");
502 foreach ($val_arr as $key => $value)
507 $tpl->setCurrentBlock(
"profile_data");
508 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
509 $tpl->setVariable(
"DATA", $user->$key());
510 $tpl->parseCurrentBlock();
518 $tpl->setCurrentBlock(
"delicious_row");
519 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
520 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
522 $tpl->setVariable(
"DEL_ACCOUNT", $user->getDelicious());
523 $tpl->parseCurrentBlock();
527 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
530 $user->getLatitude() !=
"")
532 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
535 $map_gui->setMapId(
"user_map")
538 ->setLatitude($user->getLatitude())
539 ->setLongitude($user->getLongitude())
540 ->setZoom($user->getLocationZoom())
541 ->setEnableNavigationControl(
true)
542 ->addUserMarker($user->getId());
544 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
548 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
550 $user_defined_data = $user->getUserDefinedData();
551 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
554 if ($this->
getPublicPref($user,
"public_udf_".$definition[
"field_id"]) ==
"y")
556 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
558 $tpl->setCurrentBlock(
"udf_data");
559 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
560 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
561 $tpl->parseCurrentBlock();
572 $tpl->setCurrentBlock(
"profile_data");
573 $tpl->setVariable(
"TXT_DATA", $key);
574 $tpl->setVariable(
"DATA", $val);
575 $tpl->parseCurrentBlock();
582 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
587 return $tpl->get().$goto;
602 require_once
"./Services/User/classes/class.ilvCard.php";
606 if ($user->getPref(
"public_profile") !=
"y" &&
607 $user->getPref(
"public_profile") !=
"g" &&
608 $_GET[
"baseClass"] !=
"ilsharedresourceGUI")
613 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
614 $vcard->setNickname($user->getLogin());
617 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
618 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
620 $fh = fopen($imagefile,
"r");
623 $image = fread($fh, filesize($imagefile));
625 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
627 if (preg_match(
"/^image/", $mimetype))
631 $vcard->setPhoto($image, $type);
635 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
636 "getStreet" =>
"street",
637 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
638 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
639 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
640 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip",
641 "dummy" =>
"location");
645 foreach ($val_arr as $key => $value)
648 if ($user->getPref(
"public_".$value) ==
"y")
653 $org[0] = $user->$key();
656 $org[1] = $user->$key();
659 $adr[2] = $user->$key();
662 $adr[5] = $user->$key();
665 $adr[3] = $user->$key();
668 $adr[6] = $user->$key();
683 $vcard->setEmail($user->$key());
686 $vcard->setNote($user->$key());
689 $vcard->setPosition($user->getLatitude(), $user->getLongitude());
697 $vcard->setOrganization(join(
";", $org));
701 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
721 if ($ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") !=
"g")
724 if($user->getPref(
"public_profile") ==
"y")
737 $tpl->resetHeaderBlock();
739 include_once(
"./Services/User/classes/class.ilUserUtil.php");
753 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
757 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
759 if($access_handler->checkAccess(
"read",
"", $portfolio_id))
761 return $portfolio_id;
770 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
771 if(in_array($a_field_id, $multi_fields) && $a_term)
775 if($ilUser && $ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
777 $user_id = $ilUser->getId();
786 $result[$cnt] =
new stdClass();
793 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
796 $result[$cnt] =
new stdClass();
814 include_once
'Services/JSON/classes/class.ilJsonUtil.php';