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));
122 global $ilMainMenu, $ilTabs,
$lng;
131 $back =
'ilias.php?baseClass=ilPersonalDesktopGUI';
134 if((
bool)$a_is_portfolio)
136 $ilMainMenu->setTopBarBack($back);
141 $ilTabs->clearTargets();
142 $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);
216 case 'ilbuddysystemgui':
219 require_once
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
223 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
225 $ilCtrl->setReturn($this,
'view');
226 $ilCtrl->forwardCommand($gui);
230 $tpl->setContent(
$ret);
235 if (strtolower(
$_GET[
"baseClass"]) ==
"ilpublicuserprofilegui")
264 if(!$user->getActive() ||
265 !$user->checkTimeLimit())
272 $ilCtrl->redirectByClass(
"ilobjportfoliogui",
"preview");
285 $current = $user->getPref(
"public_profile");
288 if($user->getPref(
"public_profile") ==
"g" && !$ilSetting->get(
'enable_global_profiles'))
293 if ($current !=
"y" &&
294 ($current !=
"g" || !$ilSetting->get(
'enable_global_profiles')) &&
295 !$this->custom_prefs)
325 $tpl->setVariable(
"ROWCOL1",
"tblrow1");
326 $tpl->setVariable(
"ROWCOL2",
"tblrow2");
328 if(!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID)
330 $ref_url = str_replace(
"&",
"&", $this->
getBackUrl());
333 $ref_url = basename(
$_SERVER[
'REQUEST_URI']);
336 $tpl->setCurrentBlock(
"mail");
337 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
338 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
342 $ref_url,
'', array(), array(
'type' =>
'new',
'rcp_to' => $user->getLogin())
345 $tpl->parseCurrentBlock();
351 $first_name .= $user->getUTitle().
" ";
353 $first_name .= $user->getFirstName();
355 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
356 $tpl->setVariable(
"FIRSTNAME", $first_name);
357 $tpl->setVariable(
"LASTNAME", $user->getLastName());
359 if($user->getBirthday() &&
363 $tpl->setCurrentBlock(
"bday_bl");
364 $tpl->setVariable(
"TXT_BIRTHDAY", $lng->txt(
"birthday"));
366 $tpl->parseCurrentBlock();
372 $tpl->setCurrentBlock(
"vcard");
373 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
374 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
375 $ilCtrl->setParameter($this,
"user", $this->
getUserId());
376 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this,
"deliverVCard"));
381 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
382 $check_file = $check_dir.
"/usr_images/".$user->getPref(
"profile_image");
384 if (!@is_file($check_file))
386 $imagefile = $check_file =
392 $imagefile = basename($imagefile);
395 if ($this->
getPublicPref($user,
"public_upload")==
"y" && $imagefile !=
"" &&
396 ($ilUser->getId() != ANONYMOUS_USER_ID || $user->getPref(
"public_profile") ==
"g"))
400 $tpl->setCurrentBlock(
"image");
401 $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
402 $tpl->setVariable(
"IMAGE_PATH", $imagefile);
403 $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
404 $tpl->parseCurrentBlock();
414 $val_arr = array (
"getStreet" =>
"street",
415 "getZipcode" =>
"zipcode",
417 "getCountry" =>
"country",
418 "getSelectedCountry" =>
"sel_country");
419 foreach ($val_arr as $key => $value)
424 $address_value = $user->$key();
427 if (trim($address_value) !=
"")
432 $address[0] = $address_value;
437 $address[1] .=
" ".$address_value;
441 $lng->loadLanguageModule(
"meta");
442 $address[2] = $lng->txt(
"meta_c_".$address_value);
446 $address[2] = $address_value;
454 $tpl->setCurrentBlock(
"address_line");
455 foreach($address as $line)
459 $tpl->setVariable(
"TXT_ADDRESS_LINE", trim($line));
460 $tpl->parseCurrentBlock();
463 $tpl->setCurrentBlock(
"address");
464 $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
465 $tpl->parseCurrentBlock();
470 if ($this->
getPublicPref($user,
"public_institution") ==
"y" ||
473 $tpl->setCurrentBlock(
"inst_dep");
475 if ($this->
getPublicPref($user,
"public_institution") ==
"y")
477 $h = $lng->txt(
"institution");
478 $v = $user->getInstitution();
483 $h.= $sep.$lng->txt(
"department");
484 $v.= $sep.$user->getDepartment();
486 $tpl->setVariable(
"TXT_INST_DEP",
$h);
487 $tpl->setVariable(
"INST_DEP", $v);
488 $tpl->parseCurrentBlock();
493 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
494 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email");
496 foreach ($val_arr as $key => $value)
501 $v.= $sep.$lng->txt($value).
": ".$user->$key();
505 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
507 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
509 foreach ($im_arr as $im_name)
511 if ($im_id = $user->getInstantMessengerId($im_name))
513 if ($this->
getPublicPref($user,
"public_im_".$im_name) !=
"n")
515 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
523 $tpl->parseCurrentBlock(
"contact");
524 $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
525 $tpl->setVariable(
"CONTACT", $v);
526 $tpl->parseCurrentBlock();
531 "getHobby" =>
"hobby",
532 "getGeneralInterestsAsText" =>
"interests_general",
533 "getOfferingHelpAsText" =>
"interests_help_offered",
534 "getLookingForHelpAsText" =>
"interests_help_looking",
535 "getMatriculation" =>
"matriculation",
536 "getClientIP" =>
"client_ip");
538 foreach ($val_arr as $key => $value)
543 $tpl->setCurrentBlock(
"profile_data");
544 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
545 $tpl->setVariable(
"DATA", $user->$key());
546 $tpl->parseCurrentBlock();
551 include_once(
"./Services/Link/classes/class.ilLink.php");
552 include_once(
"./Modules/Portfolio/classes/class.ilObjPortfolio.php");
558 if (count($port) > 0)
560 foreach ($port as $u)
562 $tpl->setCurrentBlock(
"portfolio");
563 foreach ($u as $link => $title)
566 $tpl->setVariable(
"HREF_PORTFOLIO", $link);
567 $tpl->setVariable(
"TITLE_PORTFOLIO", $title);
568 $tpl->parseCurrentBlock();
571 $tpl->setCurrentBlock(
"portfolios");
574 $lng->loadLanguageModule(
"prtf");
575 $tpl->setVariable(
"TXT_PORTFOLIO", $lng->txt(
"prtf_portfolios"));
579 $tpl->setVariable(
"TXT_PORTFOLIO", $lng->txt(
"portfolio"));
581 $tpl->parseCurrentBlock();
588 $tpl->setCurrentBlock(
"delicious_row");
589 $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
590 $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
592 $tpl->setVariable(
"DEL_ACCOUNT", $user->getDelicious());
593 $tpl->parseCurrentBlock();
597 include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
600 $user->getLatitude() !=
"")
602 $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
605 $map_gui->setMapId(
"user_map")
608 ->setLatitude($user->getLatitude())
609 ->setLongitude($user->getLongitude())
610 ->setZoom($user->getLocationZoom())
611 ->setEnableNavigationControl(
true)
612 ->addUserMarker($user->getId());
614 $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
618 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
620 $user_defined_data = $user->getUserDefinedData();
621 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
624 if ($this->
getPublicPref($user,
"public_udf_".$definition[
"field_id"]) ==
"y")
626 if ($user_defined_data[
"f_".$definition[
"field_id"]] !=
"")
628 $tpl->setCurrentBlock(
"udf_data");
629 $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
630 $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
631 $tpl->parseCurrentBlock();
642 $tpl->setCurrentBlock(
"profile_data");
643 $tpl->setVariable(
"TXT_DATA", $key);
644 $tpl->setVariable(
"DATA", $val);
645 $tpl->parseCurrentBlock();
650 $this->
getUserId() != $ilUser->getId() &&
651 !$ilUser->isAnonymous() &&
655 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystemLinkButton.php';
657 $tpl->setVariable(
'BUDDY_HTML', $button->getHtml());
663 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
668 return $tpl->get().$goto;
683 require_once
"./Services/User/classes/class.ilvCard.php";
687 if ($user->getPref(
"public_profile") !=
"y" &&
688 $user->getPref(
"public_profile") !=
"g" &&
689 $_GET[
"baseClass"] !=
"ilsharedresourceGUI")
694 $vcard->setName($user->getLastName(), $user->getFirstName(),
"", $user->getUTitle());
695 $vcard->setNickname($user->getLogin());
698 $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
699 if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
701 $fh = fopen($imagefile,
"r");
704 $image = fread($fh, filesize($imagefile));
706 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
708 if (preg_match(
"/^image/", $mimetype))
712 $vcard->setPhoto($image, $type);
716 $val_arr = array(
"getInstitution" =>
"institution",
"getDepartment" =>
"department",
717 "getStreet" =>
"street",
718 "getZipcode" =>
"zipcode",
"getCity" =>
"city",
"getCountry" =>
"country",
719 "getPhoneOffice" =>
"phone_office",
"getPhoneHome" =>
"phone_home",
720 "getPhoneMobile" =>
"phone_mobile",
"getFax" =>
"fax",
"getEmail" =>
"email",
721 "getHobby" =>
"hobby",
"getMatriculation" =>
"matriculation",
"getClientIP" =>
"client_ip",
722 "dummy" =>
"location");
726 foreach ($val_arr as $key => $value)
729 if ($user->getPref(
"public_".$value) ==
"y")
734 $org[0] = $user->$key();
737 $org[1] = $user->$key();
740 $adr[2] = $user->$key();
743 $adr[5] = $user->$key();
746 $adr[3] = $user->$key();
749 $adr[6] = $user->$key();
764 $vcard->setEmail($user->$key());
767 $vcard->setNote($user->$key());
770 $vcard->setPosition($user->getLatitude(), $user->getLongitude());
778 $vcard->setOrganization(join(
";", $org));
782 $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
802 if ($ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") !=
"g")
805 if($user->getPref(
"public_profile") ==
"y")
812 if($ilUser->isAnonymous())
814 if(strtolower($ilCtrl->getCmd()) == strtolower(
'approveContactRequest'))
816 ilUtil::redirect(
'login.php?cmd=force_login&target=usr_' . $a_user_id .
'_contact_approved');
818 else if(strtolower($ilCtrl->getCmd()) == strtolower(
'ignoreContactRequest'))
820 ilUtil::redirect(
'login.php?cmd=force_login&target=usr_' . $a_user_id .
'_contact_ignored');
831 $tpl->resetHeaderBlock();
833 include_once(
"./Services/User/classes/class.ilUserUtil.php");
847 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
851 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
853 if($access_handler->checkAccess(
"read",
"", $portfolio_id))
855 return $portfolio_id;
864 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
865 if(in_array($a_field_id, $multi_fields) && $a_term)
869 if($ilUser && $ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
871 $user_id = $ilUser->getId();
880 $result[$cnt] =
new stdClass();
887 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
890 $result[$cnt] =
new stdClass();
906 $result = self::getAutocompleteResult($field_id, $term);
908 include_once
'Services/JSON/classes/class.ilJsonUtil.php';
917 protected function approveContactRequest()
926 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'osd_id',
$_REQUEST[
'osd_id']);
929 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'user_id', $this->
getUserId());
930 $ilCtrl->redirectByClass(array(
'ilPublicUserProfileGUI',
'ilBuddySystemGUI'),
'link');
936 protected function ignoreContactRequest()
945 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'osd_id',
$_REQUEST[
'osd_id']);
948 $ilCtrl->setParameterByClass(
'ilBuddySystemGUI',
'user_id', $this->
getUserId());
949 $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
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
deliverVCard()
Deliver vcard information.
static getAutocompleteResult($a_field_id, $a_term)
getAdditional()
Get Additonal Information.
setUserId($a_userid)
Set User ID.
static validateUser($a_user_id)
Check if given user id is valid.
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 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)
Default behaviour is:
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.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
executeCommand()
Execute Command.
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
setCustomPrefs(array $a_prefs)
Set custom preferences for public profile fields.
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
getEmbeddable($a_add_goto=false)
get public profile html code
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct($a_user_id=0)
Constructor.
static isActivated()
Checks whether Map feature is activated.
static _isAnonymous($usr_id)
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
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)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
static redirect($a_script)
http redirect to other script
static getWebspaceDir($mode="filesystem")
get webspace directory
handleBackUrl($a_is_portfolio=false)
getPublicPref(ilObjUser $a_user, $a_id)
Get user preference for public profile.
setEmbedded($a_value, $a_offline=false)