25                 $lng->loadLanguageModule(
"user");
 
   27                 $ilCtrl->saveParameter($this, array(
"user_id",
"back_url", 
"user"));
 
   28                 if (
$_GET[
"back_url"] != 
"")
 
   41                 $this->userid = $a_userid;
 
   61                 $this->asrows = $a_asrows;
 
   81                 $this->additional = $a_additional;
 
  102                 $this->backurl = $a_backurl;
 
  103                 $ilCtrl->setParameter($this, 
"back_url", rawurlencode($a_backurl));
 
  113                 return $this->backurl;
 
  124                 if (
$_GET[
"baseClass"] != 
"ilPublicUserProfileGUI")
 
  126                         $cmd = $ilCtrl->getCmd();
 
  132                         $user_id = (int) 
$_GET[
"user_id"];
 
  139                         if ($ilUser->getId() == ANONYMOUS_USER_ID && 
$user->getPref(
"public_profile") != 
"g")
 
  143                         $cmd = $ilCtrl->getCmd();
 
  146                         $tpl->getStandardTemplate();
 
  147                         $tpl->setContent(
$ret);
 
  188                         $tpl->touchBlock(
"table_end");
 
  189                         $tpl->setCurrentBlock(
"table_start");
 
  190                         $tpl->setVariable(
"USR_PROFILE", $lng->txt(
"profile_of").
" ".
$user->getLogin());
 
  191                         $tpl->parseCurrentBlock();
 
  194                 $tpl->setVariable(
"ROWCOL1", 
"tblrow1");
 
  195                 $tpl->setVariable(
"ROWCOL2", 
"tblrow2");
 
  199                 if (
$user->getPref(
"public_profile") != 
"y" &&
 
  200                         (
$user->getPref(
"public_profile") != 
"g" || !$ilSetting->get(
'enable_global_profiles')))
 
  205                 $tpl->setVariable(
"TXT_MAIL", $lng->txt(
"send_mail"));
 
  219         require_once 
'Services/Mail/classes/class.ilMailFormCall.php';
 
  223                 if(
$user->getPref(
"public_title") == 
"y")
 
  225                         $first_name .= 
$user->getUTitle().
" ";
 
  227                 $first_name .= 
$user->getFirstName();
 
  229                 $tpl->setVariable(
"TXT_NAME", $lng->txt(
"name"));
 
  230                 $tpl->setVariable(
"FIRSTNAME", $first_name);
 
  231                 $tpl->setVariable(
"LASTNAME", 
$user->getLastName());
 
  234                 $tpl->setCurrentBlock(
"vcard");
 
  235                 $tpl->setVariable(
"TXT_VCARD", $lng->txt(
"vcard"));
 
  236                 $tpl->setVariable(
"TXT_DOWNLOAD_VCARD", $lng->txt(
"vcard_download"));
 
  237                 $ilCtrl->setParameter($this, 
"user", $this->
getUserId());
 
  238                 $tpl->setVariable(
"HREF_VCARD", $ilCtrl->getLinkTarget($this, 
"deliverVCard"));
 
  242                 if (
$user->prefs[
"public_profile"] == 
"g" && $ilSetting->get(
'enable_global_profiles'))
 
  244                         $tpl->setCurrentBlock(
"link");
 
  245                         $tpl->setVariable(
"TXT_LINK", $lng->txt(
"usr_link_to_profile"));
 
  246                         include_once(
"./classes/class.ilLink.php");
 
  247                         $tpl->setVariable(
"HREF_LINK",
 
  249                         $tpl->parseCurrentBlock();
 
  254                 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image").
"?dummy=".rand(1,999999);
 
  255                 $check_file = $check_dir.
"/usr_images/".
$user->getPref(
"profile_image");
 
  257                 if (!@is_file($check_file))
 
  259                         $imagefile = $check_file =
 
  263                 if (
$user->getPref(
"public_upload")==
"y" && $imagefile != 
"")
 
  267                         $tpl->setCurrentBlock(
"image");
 
  268                         $tpl->setVariable(
"TXT_IMAGE",$lng->txt(
"image"));
 
  269                         $tpl->setVariable(
"IMAGE_PATH", $imagefile);
 
  270                         $tpl->setVariable(
"IMAGE_ALT", $lng->txt(
"personal_picture"));
 
  271                         $tpl->parseCurrentBlock();
 
  275                 if (
$user->getPref(
"public_street") == 
"y" || 
$user->getPref(
"public_zipcode") == 
"y" 
  276                         || 
$user->getPref(
"public_city") == 
"y" || 
$user->getPref(
"public_countr") == 
"y")
 
  278                         $tpl->setCurrentBlock(
"address");
 
  279                         $tpl->setVariable(
"TXT_ADDRESS", $lng->txt(
"address"));
 
  280                         $val_arr = array (
"getStreet" => 
"street",
 
  281                         "getZipcode" => 
"zipcode", 
"getCity" => 
"city", 
"getCountry" => 
"country", 
"getSelectedCountry" => 
"sel_country");
 
  282                         foreach ($val_arr as $key => $value)
 
  285                                 if (
$user->getPref(
"public_".$value) == 
"y")
 
  287                                         if (
$user->$key() != 
"")
 
  289                                                 if ($value == 
"sel_country")
 
  291                                                         $lng->loadLanguageModule(
"meta");
 
  292                                                         $tpl->setVariable(
"COUNTRY",
 
  293                                                                 $lng->txt(
"meta_c_".$user->$key()));
 
  297                                                         $tpl->setVariable(strtoupper($value), 
$user->$key());
 
  302                         $tpl->parseCurrentBlock();
 
  306                 if (
$user->getPref(
"public_institution") == 
"y" || 
$user->getPref(
"public_department") == 
"y")
 
  308                         $tpl->setCurrentBlock(
"inst_dep");
 
  310                         if (
$user->getPref(
"public_institution") == 
"y")
 
  312                                 $h = $lng->txt(
"institution");
 
  313                                 $v = 
$user->getInstitution();
 
  316                         if (
$user->getPref(
"public_department") == 
"y")
 
  318                                 $h.= $sep.$lng->txt(
"department");
 
  319                                 $v.= $sep.$user->getDepartment();
 
  321                         $tpl->setVariable(
"TXT_INST_DEP", $h);
 
  322                         $tpl->setVariable(
"INST_DEP", $v);
 
  323                         $tpl->parseCurrentBlock();
 
  328                         "getPhoneOffice" => 
"phone_office", 
"getPhoneHome" => 
"phone_home",
 
  329                         "getPhoneMobile" => 
"phone_mobile", 
"getFax" => 
"fax", 
"getEmail" => 
"email");
 
  331                 foreach ($val_arr as $key => $value)
 
  334                         if (
$user->getPref(
"public_".$value) == 
"y")
 
  336                                 $v.= $sep.$lng->txt($value).
": ".
$user->$key();
 
  340                 if ($ilSetting->get(
"usr_settings_hide_instant_messengers") != 1)
 
  342                         $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
 
  344                         foreach ($im_arr as $im_name)
 
  346                                 if ($im_id = 
$user->getInstantMessengerId($im_name))
 
  348                                         if (
$user->getPref(
"public_im_".$im_name) != 
"n")
 
  350                                                 $v.= $sep.$lng->txt(
'im_'.$im_name).
": ".$im_id;
 
  358                         $tpl->parseCurrentBlock(
"contact");
 
  359                         $tpl->setVariable(
"TXT_CONTACT", $lng->txt(
"contact"));
 
  360                         $tpl->setVariable(
"CONTACT", $v);
 
  361                         $tpl->parseCurrentBlock();
 
  366                         "getHobby" => 
"hobby", 
"getMatriculation" => 
"matriculation", 
"getClientIP" => 
"client_ip");
 
  368                 foreach ($val_arr as $key => $value)
 
  371                         if (
$user->getPref(
"public_".$value) == 
"y")
 
  373                                 $tpl->setCurrentBlock(
"profile_data");
 
  374                                 $tpl->setVariable(
"TXT_DATA", $lng->txt($value));
 
  375                                 $tpl->setVariable(
"DATA", 
$user->$key());
 
  376                                 $tpl->parseCurrentBlock();
 
  382                 if (
$user->getPref(
"public_delicious") == 
"y")
 
  384                         $tpl->setCurrentBlock(
"delicious_row");
 
  385                         $tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
 
  386                         $tpl->setVariable(
"TXT_DEL_ICON", $lng->txt(
"delicious"));
 
  388                         $tpl->setVariable(
"DEL_ACCOUNT", 
$user->getDelicious());
 
  389                         $tpl->parseCurrentBlock();
 
  393                 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
 
  395                         && 
$user->getLatitude() != 
"")
 
  397                         $tpl->setVariable(
"TXT_LOCATION", $lng->txt(
"location"));
 
  399                         include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
 
  402                         $map_gui->setMapId(
"user_map");
 
  403                         $map_gui->setWidth(
"350px");
 
  404                         $map_gui->setHeight(
"230px");
 
  405                         $map_gui->setLatitude(
$user->getLatitude());
 
  406                         $map_gui->setLongitude(
$user->getLongitude());
 
  407                         $map_gui->setZoom(
$user->getLocationZoom());
 
  408                         $map_gui->setEnableNavigationControl(
true);
 
  409                         $map_gui->addUserMarker(
$user->getId());
 
  411                         $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
 
  415                 include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  417                 $user_defined_data = 
$user->getUserDefinedData();
 
  418                 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
  421                         if (
$user->prefs[
"public_udf_".$definition[
"field_id"]] == 
"y")
 
  423                                 if ($user_defined_data[
"f_".$definition[
"field_id"]] != 
"")
 
  425                                         $tpl->setCurrentBlock(
"udf_data");
 
  426                                         $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
 
  427                                         $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
 
  428                                         $tpl->parseCurrentBlock();
 
  439                                 $tpl->setCurrentBlock(
"profile_data");
 
  440                                 $tpl->setVariable(
"TXT_DATA", $key);
 
  441                                 $tpl->setVariable(
"DATA", $val);
 
  442                                 $tpl->parseCurrentBlock();
 
  461                 require_once 
"./Services/User/classes/class.ilvCard.php";
 
  464                 if (
$user->getPref(
"public_profile") != 
"y" &&
 
  465                         $user->getPref(
"public_profile") != 
"g")
 
  470                 $vcard->setName(
$user->getLastName(), 
$user->getFirstName(), 
"", 
$user->getUTitle());
 
  471                 $vcard->setNickname(
$user->getLogin());
 
  474                 $imagefile = $webspace_dir.
"/usr_images/".
$user->getPref(
"profile_image");
 
  475                 if (
$user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
 
  477                         $fh = fopen($imagefile, 
"r");
 
  480                                 $image = fread($fh, filesize($imagefile));
 
  482                                 require_once 
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
 
  484                                 if (preg_match(
"/^image/", $mimetype))
 
  488                                 $vcard->setPhoto($image, $type);
 
  492                 $val_arr = array(
"getInstitution" => 
"institution", 
"getDepartment" => 
"department",
 
  493                         "getStreet" => 
"street",
 
  494                         "getZipcode" => 
"zipcode", 
"getCity" => 
"city", 
"getCountry" => 
"country",
 
  495                         "getPhoneOffice" => 
"phone_office", 
"getPhoneHome" => 
"phone_home",
 
  496                         "getPhoneMobile" => 
"phone_mobile", 
"getFax" => 
"fax", 
"getEmail" => 
"email",
 
  497                         "getHobby" => 
"hobby", 
"getMatriculation" => 
"matriculation", 
"getClientIP" => 
"client_ip");
 
  501                 foreach ($val_arr as $key => $value)
 
  504                         if (
$user->getPref(
"public_".$value) == 
"y")
 
  509                                                 $org[0] = 
$user->$key();
 
  512                                                 $org[1] = 
$user->$key();
 
  515                                                 $adr[2] = 
$user->$key();
 
  518                                                 $adr[5] = 
$user->$key();
 
  521                                                 $adr[3] = 
$user->$key();
 
  524                                                 $adr[6] = 
$user->$key();
 
  539                                                 $vcard->setEmail(
$user->$key());
 
  542                                                 $vcard->setNote(
$user->$key());
 
  550                         $vcard->setOrganization(join(
";", $org));
 
  554                         $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
 
  557                 ilUtil::deliverData(utf8_decode($vcard->buildVCard()), $vcard->getFilename(), $vcard->getMimetype());
 
  565                 global 
$tpl, $ilUser;
 
  567                 $user_id = (int) 
$_GET[
"user_id"];
 
  574                 if ($ilUser->getId() == ANONYMOUS_USER_ID && 
$user->getPref(
"public_profile") != 
"g")
 
  578                 $tpl->getStandardTemplate();
 
  579                 $tpl->setContent($this->
getHTML());
 
  590                 global $ilUser, 
$tpl;
 
  594                 include_once(
"./Services/User/classes/class.ilExtPublicProfilePageGUI.php");
 
  596                 if ($page_gui->getPageObject()->getUserId() == $this->
getUserId())
 
  598                         $tpl->setCurrentBlock(
"ContentStyle");
 
  599                         $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  601                         $tpl->parseCurrentBlock();
 
  603                         return $page_gui->preview();
 
  616                 include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  626                         $ilTabs->clearTargets();
 
  627                         $ilTabs->setBackTarget($lng->txt(
"back"),
 
  631                 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
 
  633                 if (count($pages) > 0)
 
  635                         $ilTabs->addTab(
"profile",
 
  636                                 $lng->txt(
"profile"),
 
  637                                 $ilCtrl->getLinkTarget($this, 
"getHTML"));
 
  640                 foreach ($pages as $p)
 
  642                         $ilCtrl->setParameter($this, 
"user_page", $p[
"id"]);
 
  643                         $ilTabs->addTab(
"user_page_".$p[
"id"],
 
  645                                 $ilCtrl->getLinkTarget($this, 
"showUserPage"));
 
  648                 $ilTabs->activateTab($a_active);