38 $ilCtrl->saveParameter($this,
array(
"user_id",
"back_url",
"user"));
39 if (
$_GET[
"back_url"] !=
"") {
43 $lng->loadLanguageModule(
"user");
53 $this->userid = $a_userid;
73 $this->additional = $a_additional;
96 $parts = parse_url($a_backurl);
101 $this->backurl = $a_backurl;
102 $ilCtrl->setParameter($this,
"back_url", rawurlencode($a_backurl));
117 global $ilMainMenu, $ilTabs,
$lng;
125 $back =
'ilias.php?baseClass=ilPersonalDesktopGUI';
128 if ((
bool) $a_is_portfolio) {
129 $ilMainMenu->setTopBarBack($back);
132 $ilTabs->clearTargets();
133 $ilTabs->setBackTarget(
147 $this->custom_prefs = $a_prefs;
161 if (!$this->custom_prefs) {
162 return $a_user->
getPref($a_id);
164 return $this->custom_prefs[$a_id];
170 $this->embedded = (bool) $a_value;
171 $this->offline = (bool) $a_offline;
181 if (!self::validateUser($this->
getUserId())) {
185 $next_class = $ilCtrl->getNextClass($this);
186 $cmd = $ilCtrl->getCmd();
188 $tpl->getStandardTemplate();
190 switch ($next_class) {
191 case "ilobjportfoliogui":
196 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
199 $gui->setPermaLink($this->
getUserId(),
"usr");
200 $ilCtrl->forwardCommand($gui);
204 case 'ilbuddysystemgui':
205 if (isset($_REQUEST[
'osd_id'])) {
206 require_once
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
210 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
212 $ilCtrl->setReturn($this,
'view');
213 $ilCtrl->forwardCommand($gui);
216 $ret = $this->$cmd();
217 $tpl->setContent(
$ret);
222 if (strtolower(
$_GET[
"baseClass"]) ==
"ilpublicuserprofilegui") {
242 if ($this->embedded) {
249 if (!$user->getActive() ||
250 !$user->checkTimeLimit()) {
255 $ilCtrl->redirectByClass(
"ilobjportfoliogui",
"preview");
264 $current = $user->getPref(
"public_profile");
267 if ($user->getPref(
"public_profile") ==
"g" && !$ilSetting->get(
'enable_global_profiles')) {
272 (
$current !=
"g" || !$ilSetting->get(
'enable_global_profiles')) &&
273 !$this->custom_prefs) {
299 "tpl.usr_public_profile.html",
305 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
306 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
308 if (!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID) {
309 $ref_url = str_replace(
"&",
"&", $this->
getBackUrl());
311 $ref_url = basename(
$_SERVER[
'REQUEST_URI']);
314 $tpl->setCurrentBlock(
"mail");
315 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
316 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
323 array(
'type' =>
'new',
'rcp_to' => $user->getLogin())
326 $tpl->parseCurrentBlock();
331 $first_name .= $user->getUTitle() .
" ";
333 $first_name .= $user->getFirstName();
336 $sal = $lng->txt(
"salutation_" . $user->getGender()) .
" ";
337 $tpl->setVariable(
"SALUTATION", $sal);
340 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
341 $tpl->setVariable(
"FIRSTNAME", $first_name);
342 $tpl->setVariable(
"LASTNAME", $user->getLastName());
344 if ($user->getBirthday() &&
347 $tpl->setCurrentBlock(
"bday_bl");
348 $tpl->setVariable(
"TXT_BIRTHDAY", $lng->txt(
"birthday"));
350 $tpl->parseCurrentBlock();
353 if (!$this->offline) {
355 $tpl->setCurrentBlock(
"vcard");
356 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
357 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
358 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
359 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
364 $random = new \ilRandom();
365 $imagefile = $webspace_dir .
"/usr_images/" . $user->getPref(
"profile_image") .
"?dummy=" . $random->int(1, 999999);
366 $check_file = $check_dir .
"/usr_images/" . $user->getPref(
"profile_image");
368 if (!@is_file($check_file)) {
369 $imagefile = $check_file =
370 ilObjUser::_getPersonalPicturePath($user->getId(),
"small",
false,
true);
373 if ($this->offline) {
374 $imagefile = basename($imagefile);
377 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"" &&
378 ($ilUser->getId() != ANONYMOUS_USER_ID || $user->getPref(
"public_profile") ==
"g")) {
381 $tpl->setCurrentBlock(
"image");
382 $tpl->setVariable(
"TXT_IMAGE", $lng->txt(
"image"));
383 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
384 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
385 $tpl->parseCurrentBlock();
394 $val_arr =
array(
"getStreet" =>
"street",
395 "getZipcode" =>
"zipcode",
397 "getCountry" =>
"country",
398 "getSelectedCountry" =>
"sel_country");
399 foreach ($val_arr as
$key => $value) {
401 if ($this->
getPublicPref($user,
"public_" . $value) ==
"y") {
402 $address_value = $user->$key();
405 if (trim($address_value) !=
"") {
408 $address[0] = $address_value;
413 $address[1] .=
" " . $address_value;
417 $lng->loadLanguageModule(
"meta");
418 $address[2] = $lng->txt(
"meta_c_" . $address_value);
422 $address[2] = $address_value;
428 if (
sizeof($address)) {
429 $tpl->setCurrentBlock(
"address_line");
430 foreach ($address as $line) {
432 $tpl->setVariable(
"TXT_ADDRESS_LINE", trim($line));
433 $tpl->parseCurrentBlock();
436 $tpl->setCurrentBlock(
"address");
437 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
438 $tpl->parseCurrentBlock();
443 if ($this->
getPublicPref($user,
"public_org_units") ==
"y") {
444 $tpl->setCurrentBlock(
"org_units");
445 $tpl->setVariable(
"TXT_ORG_UNITS", $lng->txt(
"objs_orgu"));
446 $tpl->setVariable(
"ORG_UNITS", $user->getOrgUnitsRepresentation());
447 $tpl->parseCurrentBlock();
451 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
453 $tpl->setCurrentBlock(
"inst_dep");
455 if ($this->
getPublicPref($user,
"public_institution") ==
"y") {
456 $h = $lng->txt(
"institution");
457 $v = $user->getInstitution();
460 if ($this->
getPublicPref($user,
"public_department") ==
"y") {
461 $h.= $sep . $lng->txt(
"department");
462 $v.= $sep . $user->getDepartment();
464 $tpl->setVariable(
"TXT_INST_DEP",
$h);
465 $tpl->setVariable(
"INST_DEP", $v);
466 $tpl->parseCurrentBlock();
471 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
472 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
"getSecondEmail" =>
"second_email");
474 foreach ($val_arr as
$key => $value) {
476 if ($this->
getPublicPref($user,
"public_" . $value) ==
"y") {
477 $v.= $sep . $lng->txt($value) .
": " . $user->$key();
482 $tpl->parseCurrentBlock(
"contact");
483 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
484 $tpl->setVariable(
"CONTACT", $v);
485 $tpl->parseCurrentBlock();
490 "getHobby" =>
"hobby",
491 "getGeneralInterestsAsText" =>
"interests_general",
492 "getOfferingHelpAsText" =>
"interests_help_offered",
493 "getLookingForHelpAsText" =>
"interests_help_looking",
494 "getMatriculation" =>
"matriculation",
495 "getClientIP" =>
"client_ip");
497 foreach ($val_arr as
$key => $value) {
499 if ($this->
getPublicPref($user,
"public_" . $value) ==
"y") {
500 $tpl->setCurrentBlock(
"profile_data");
501 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
502 $tpl->setVariable(
"DATA", $user->$key());
503 $tpl->parseCurrentBlock();
508 include_once(
"./Services/Link/classes/class.ilLink.php");
509 include_once(
"./Modules/Portfolio/classes/class.ilObjPortfolio.php");
515 if (count($port) > 0) {
516 foreach ($port as $u) {
517 $tpl->setCurrentBlock(
"portfolio");
518 foreach ($u as $link =>
$title) {
520 $tpl->setVariable(
"HREF_PORTFOLIO", $link);
522 $tpl->parseCurrentBlock();
525 $tpl->setCurrentBlock(
"portfolios");
527 $lng->loadLanguageModule(
"prtf");
528 $tpl->setVariable(
"TXT_PORTFOLIO", $lng->txt(
"prtf_portfolios"));
530 $tpl->setVariable(
"TXT_PORTFOLIO", $lng->txt(
"portfolio"));
532 $tpl->parseCurrentBlock();
536 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
539 $user->getLatitude() !=
"") {
540 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
543 $map_gui->setMapId(
"user_map")
546 ->setLatitude($user->getLatitude())
547 ->setLongitude($user->getLongitude())
548 ->setZoom($user->getLocationZoom())
549 ->setEnableNavigationControl(
true)
550 ->addUserMarker($user->getId());
552 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
556 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
558 $user_defined_data = $user->getUserDefinedData();
559 foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
561 if ($this->
getPublicPref($user,
"public_udf_" . $definition[
"field_id"]) ==
"y") {
562 if ($user_defined_data[
"f_" . $definition[
"field_id"]] !=
"") {
563 $tpl->setCurrentBlock(
"udf_data");
564 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
565 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_" . $definition[
"field_id"]]);
566 $tpl->parseCurrentBlock();
575 $tpl->setCurrentBlock(
"profile_data");
576 $tpl->setVariable(
"TXT_DATA",
$key);
577 $tpl->setVariable(
"DATA", $val);
578 $tpl->parseCurrentBlock();
583 $this->
getUserId() != $ilUser->getId() &&
584 !$ilUser->isAnonymous() &&
587 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemLinkButton.php';
589 $tpl->setVariable(
'BUDDY_HTML', $button->getHtml());
593 include_once
"Services/Badge/classes/class.ilBadgeAssignment.php";
596 $has_public_badge =
false;
601 include_once
"Services/Badge/classes/class.ilBadgeRenderer.php";
602 foreach ($user_badges as $ass) {
604 if ($ass->getPosition()) {
611 $tpl->setCurrentBlock(
"badge_bl");
612 $tpl->setVariable(
"BADGE", $renderer->getHTML());
613 $tpl->parseCurrentBlock();
615 $tpl->setCurrentBlock(
"badge_hidden_item_bl");
616 $tpl->setVariable(
"BADGE_HIDDEN", $renderer->getHTML());
617 $tpl->parseCurrentBlock();
620 $has_public_badge =
true;
625 $lng->loadLanguageModule(
"badge");
626 $tpl->setVariable(
"BADGE_HIDDEN_TXT_MORE", $lng->txt(
"badge_profile_more"));
627 $tpl->setVariable(
"BADGE_HIDDEN_TXT_LESS", $lng->txt(
"badge_profile_less"));
628 $tpl->touchBlock(
"badge_js_bl");
631 if ($has_public_badge) {
632 $tpl->setVariable(
"TXT_BADGES", $lng->txt(
"obj_bdga"));
638 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
643 return $tpl->get() . $goto;
657 require_once
"./Services/User/classes/class.ilvCard.php";
661 if ($user->getPref(
"public_profile") !=
"y" &&
662 $user->getPref(
"public_profile") !=
"g" &&
663 $_GET[
"baseClass"] !=
"ilsharedresourceGUI") {
667 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
668 $vcard->setNickname($user->getLogin());
671 $imagefile = $webspace_dir .
"/usr_images/" . $user->getPref(
"profile_image");
672 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile)) {
673 $fh = fopen($imagefile,
"r");
675 $image = fread(
$fh, filesize($imagefile));
677 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
679 if (preg_match(
"/^image/", $mimetype)) {
682 $vcard->setPhoto($image,
$type);
686 $val_arr =
array(
"getOrgUnitsRepresentation" =>
"org_units",
"getInstitution" =>
"institution",
687 "getDepartment" =>
"department",
"getStreet" =>
"street",
688 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
689 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
690 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
691 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
692 "getClientIP" =>
"client_ip",
"dummy" =>
"location");
696 foreach ($val_arr as
$key => $value) {
698 if ($user->getPref(
"public_" . $value) ==
"y") {
701 $org[0] = $user->$key();
704 $org[1] = $user->$key();
707 $adr[2] = $user->$key();
710 $adr[5] = $user->$key();
713 $adr[3] = $user->$key();
716 $adr[6] = $user->$key();
731 $vcard->setEmail($user->$key());
734 $vcard->setNote($user->$key());
737 $vcard->setPosition($user->getLatitude(), $user->getLongitude());
744 $vcard->setOrganization(join(
";", $org));
747 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
772 if (strtolower(
$ilCtrl->getCmd()) == strtolower(
'approveContactRequest')) {
773 $ilCtrl->redirectToURL(
'login.php?cmd=force_login&target=usr_' . $usrId .
'_contact_approved');
774 } elseif (strtolower(
$ilCtrl->getCmd()) == strtolower(
'ignoreContactRequest')) {
775 $ilCtrl->redirectToURL(
'login.php?cmd=force_login&target=usr_' . $usrId .
'_contact_ignored');
778 if ($user->getPref(
"public_profile") !=
"g") {
780 if ($user->getPref(
"public_profile") ==
"y") {
781 $ilCtrl->redirectToURL(
"login.php?cmd=force_login&target=usr_" . $usrId);
795 $tpl->resetHeaderBlock();
797 include_once(
"./Services/User/classes/class.ilUserUtil.php");
799 $tpl->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->
getUserId(),
"xsmall"));
811 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
814 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
816 if ($access_handler->checkAccess(
"read",
"", $portfolio_id)) {
817 return $portfolio_id;
826 $multi_fields =
array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
827 if (in_array($a_field_id, $multi_fields) && $a_term) {
830 if ($ilUser && $ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
831 $user_id = $ilUser->getId();
839 $result[$cnt] =
new stdClass();
846 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
848 $result[$cnt] =
new stdClass();
860 $field_id = (
string) $_REQUEST[
"f"];
861 $term = (
string) $_REQUEST[
"term"];
863 $result = self::getAutocompleteResult($field_id, $term);
865 include_once
'Services/JSON/classes/class.ilJsonUtil.php';
874 protected function approveContactRequest()
881 if (isset($_REQUEST[
'osd_id'])) {
882 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'osd_id', $_REQUEST[
'osd_id']);
885 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'user_id', $this->
getUserId());
886 $ilCtrl->redirectByClass(
array(
'ilPublicUserProfileGUI',
'ilBuddySystemGUI'),
'link');
892 protected function ignoreContactRequest()
899 if (isset($_REQUEST[
'osd_id'])) {
900 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'osd_id', $_REQUEST[
'osd_id']);
903 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'user_id', $this->
getUserId());
904 $ilCtrl->redirectByClass(
array(
'ilPublicUserProfileGUI',
'ilBuddySystemGUI'),
'ignore');
static removeNotification($notification_osd_id)
Removes a notifcation and triggers a follow up notification to remove the notification from the brows...
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Class for permanent links.
static _getInstance()
Get instance.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
deliverVCard()
Deliver vcard information.
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static getAutocompleteResult($a_field_id, $a_term)
getAdditional()
Get Additonal Information.
setUserId($a_userid)
Set User ID.
getPref($a_keyword)
get a user preference
getBackUrl()
Get Back Link URL.
setAdditional($a_additional)
Set Additonal Information.
getHTML()
Get HTML for link.
getProfilePortfolio()
Check if current profile portfolio is accessible.
GUI class for public user profile presentation.
static getMapGUI()
Get an instance of the GUI class.
Portfolio view gui class.
setBackUrl($a_backurl)
Set Back Link URL.
static encode($mixed, $suppress_native=false)
static findSkills($a_term)
Find skills.
executeCommand()
Execute Command.
special template class to simplify handling of ITX/PEAR
setCustomPrefs(array $a_prefs)
Set custom preferences for public profile fields.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
getEmbeddable($a_add_goto=false)
get public profile html code
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static validateUser($usrId)
Check if given user id is valid.
__construct($a_user_id=0)
Constructor.
static isActivated()
Checks whether Map feature is activated.
static _isAnonymous($usr_id)
Access handler for portfolio.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static findInterests($a_term, $a_user_id=null, $a_field_id=null)
static redirect($a_script)
static getWebspaceDir($mode="filesystem")
get webspace directory
static getInstancesByUserId($a_user_id)
handleBackUrl($a_is_portfolio=false)
getPublicPref(ilObjUser $a_user, $a_id)
Get user preference for public profile.
setEmbedded($a_value, $a_offline=false)