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);     
 
  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':
 
  217                                if(isset($_REQUEST[
'osd_id']))
 
  219                                        require_once 
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
 
  223                                require_once 
'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
 
  225                                $ilCtrl->setReturn($this, 
'view');
 
  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() &&
 
  360                        $this->getPublicPref($user, 
"public_birthday") == 
"y")
 
  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"));
 
  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();
 
  472                        $tpl->setCurrentBlock(
"org_units");
 
  473                        $tpl->setVariable(
"TXT_ORG_UNITS", 
$lng->txt(
"objs_orgu"));
 
  474                        $tpl->setVariable(
"ORG_UNITS", $user->getOrgUnitsRepresentation());
 
  475                        $tpl->parseCurrentBlock();
 
  479                if ($this->
getPublicPref($user, 
"public_institution") == 
"y" ||
 
  482                        $tpl->setCurrentBlock(
"inst_dep");
 
  484                        if ($this->
getPublicPref($user, 
"public_institution") == 
"y")
 
  486                                $h = 
$lng->txt(
"institution");
 
  487                                $v = $user->getInstitution();
 
  492                                $h.= $sep.$lng->txt(
"department");
 
  493                                $v.= $sep.$user->getDepartment();
 
  495                        $tpl->setVariable(
"TXT_INST_DEP", 
$h);
 
  496                        $tpl->setVariable(
"INST_DEP", $v);
 
  497                        $tpl->parseCurrentBlock();
 
  502                        "getPhoneOffice" => 
"phone_office", 
"getPhoneHome" => 
"phone_home",
 
  503                        "getPhoneMobile" => 
"phone_mobile", 
"getFax" => 
"fax", 
"getEmail" => 
"email");
 
  505                foreach ($val_arr as $key => $value)
 
  510                                $v.= $sep.$lng->txt($value).
": ".$user->$key();
 
  516                        $tpl->parseCurrentBlock(
"contact");
 
  517                        $tpl->setVariable(
"TXT_CONTACT", 
$lng->txt(
"contact"));
 
  518                        $tpl->setVariable(
"CONTACT", $v);
 
  519                        $tpl->parseCurrentBlock();
 
  524                        "getHobby" => 
"hobby",
 
  525                        "getGeneralInterestsAsText" => 
"interests_general",
 
  526                        "getOfferingHelpAsText" => 
"interests_help_offered",
 
  527                        "getLookingForHelpAsText" => 
"interests_help_looking",
 
  528                        "getMatriculation" => 
"matriculation",
 
  529                        "getClientIP" => 
"client_ip");
 
  531                foreach ($val_arr as $key => $value)
 
  536                                $tpl->setCurrentBlock(
"profile_data");
 
  537                                $tpl->setVariable(
"TXT_DATA", 
$lng->txt($value));
 
  538                                $tpl->setVariable(
"DATA", $user->$key());
 
  539                                $tpl->parseCurrentBlock();
 
  544                include_once(
"./Services/Link/classes/class.ilLink.php");
 
  545                include_once(
"./Modules/Portfolio/classes/class.ilObjPortfolio.php");
 
  551                if (count($port) > 0)
 
  553                        foreach ($port as $u)
 
  555                                $tpl->setCurrentBlock(
"portfolio");
 
  556                                foreach ($u as $link => 
$title)
 
  559                                        $tpl->setVariable(
"HREF_PORTFOLIO", $link);
 
  561                                        $tpl->parseCurrentBlock();
 
  564                        $tpl->setCurrentBlock(
"portfolios");
 
  567                                $lng->loadLanguageModule(
"prtf");
 
  568                                $tpl->setVariable(
"TXT_PORTFOLIO", 
$lng->txt(
"prtf_portfolios"));
 
  572                                $tpl->setVariable(
"TXT_PORTFOLIO", 
$lng->txt(
"portfolio"));
 
  574                        $tpl->parseCurrentBlock();
 
  578                include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
 
  581                        $user->getLatitude() != 
"")
 
  583                        $tpl->setVariable(
"TXT_LOCATION", 
$lng->txt(
"location"));
 
  586                        $map_gui->setMapId(
"user_map")
 
  589                                        ->setLatitude($user->getLatitude())
 
  590                                        ->setLongitude($user->getLongitude())
 
  591                                        ->setZoom($user->getLocationZoom())
 
  592                                        ->setEnableNavigationControl(
true)
 
  593                                        ->addUserMarker($user->getId());
 
  595                        $tpl->setVariable(
"MAP_CONTENT", $map_gui->getHTML());
 
  599                include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  601                $user_defined_data = $user->getUserDefinedData();
 
  602                foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
 
  605                        if ($this->
getPublicPref($user, 
"public_udf_".$definition[
"field_id"]) == 
"y")
 
  607                                if ($user_defined_data[
"f_".$definition[
"field_id"]] != 
"")
 
  609                                        $tpl->setCurrentBlock(
"udf_data");
 
  610                                        $tpl->setVariable(
"TXT_UDF_DATA", $definition[
"field_name"]);
 
  611                                        $tpl->setVariable(
"UDF_DATA", $user_defined_data[
"f_".$definition[
"field_id"]]);
 
  612                                        $tpl->parseCurrentBlock();
 
  623                                $tpl->setCurrentBlock(
"profile_data");
 
  624                                $tpl->setVariable(
"TXT_DATA", $key);
 
  625                                $tpl->setVariable(
"DATA", $val);
 
  626                                $tpl->parseCurrentBlock();
 
  631                        $this->
getUserId() != $ilUser->getId() &&
 
  636                        require_once 
'Services/Contact/BuddySystem/classes/class.ilBuddySystemLinkButton.php';
 
  638                        $tpl->setVariable(
'BUDDY_HTML', $button->getHtml());
 
  642                include_once 
"Services/Badge/classes/class.ilBadgeAssignment.php";              
 
  646                        $has_public_badge = 
false;
 
  651                        include_once 
"Services/Badge/classes/class.ilBadgeRenderer.php";                                        
 
  652                        foreach($user_badges as $ass)
 
  655                                if($ass->getPosition())
 
  664                                                $tpl->setCurrentBlock(
"badge_bl");
 
  665                                                $tpl->setVariable(
"BADGE", $renderer->getHTML());
 
  666                                                $tpl->parseCurrentBlock();              
 
  670                                                $tpl->setCurrentBlock(
"badge_hidden_item_bl");
 
  671                                                $tpl->setVariable(
"BADGE_HIDDEN", $renderer->getHTML());
 
  672                                                $tpl->parseCurrentBlock();      
 
  675                                        $has_public_badge = 
true;
 
  681                                $lng->loadLanguageModule(
"badge");
 
  682                                $tpl->setVariable(
"BADGE_HIDDEN_TXT_MORE", 
$lng->txt(
"badge_profile_more"));
 
  683                                $tpl->setVariable(
"BADGE_HIDDEN_TXT_LESS", 
$lng->txt(
"badge_profile_less"));
 
  684                                $tpl->touchBlock(
"badge_js_bl");
 
  687                        if($has_public_badge)
 
  689                                $tpl->setVariable(
"TXT_BADGES", 
$lng->txt(
"obj_bdga"));
 
  696                        include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
 
  698                        $goto = $goto->getHTML();                                       
 
  701                return $tpl->get().$goto;
 
  716                require_once 
"./Services/User/classes/class.ilvCard.php";
 
  720                if ($user->getPref(
"public_profile") != 
"y" &&
 
  721                        $user->getPref(
"public_profile") != 
"g" &&
 
  722                        $_GET[
"baseClass"] != 
"ilsharedresourceGUI")
 
  727                $vcard->setName($user->getLastName(), $user->getFirstName(), 
"", $user->getUTitle());
 
  728                $vcard->setNickname($user->getLogin());
 
  731                $imagefile = $webspace_dir.
"/usr_images/".$user->getPref(
"profile_image");
 
  732                if ($user->getPref(
"public_upload")==
"y" && @is_file($imagefile))
 
  734                        $fh = fopen($imagefile, 
"r");
 
  737                                $image = fread(
$fh, filesize($imagefile));
 
  739                                require_once 
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
 
  741                                if (preg_match(
"/^image/", $mimetype))
 
  745                                $vcard->setPhoto($image, $type);
 
  749                $val_arr = array(
"getOrgUnitsRepresentation" => 
"org_units", 
"getInstitution" => 
"institution",
 
  750                        "getDepartment" => 
"department", 
"getStreet" => 
"street",
 
  751                        "getZipcode" => 
"zipcode", 
"getCity" => 
"city", 
"getCountry" => 
"country",
 
  752                        "getPhoneOffice" => 
"phone_office", 
"getPhoneHome" => 
"phone_home",
 
  753                        "getPhoneMobile" => 
"phone_mobile", 
"getFax" => 
"fax", 
"getEmail" => 
"email",
 
  754                        "getHobby" => 
"hobby", 
"getMatriculation" => 
"matriculation",
 
  755                        "getClientIP" => 
"client_ip", 
"dummy" => 
"location");
 
  759                foreach ($val_arr as $key => $value)
 
  762                        if ($user->getPref(
"public_".$value) == 
"y")
 
  767                                                $org[0] = $user->$key();
 
  770                                                $org[1] = $user->$key();
 
  773                                                $adr[2] = $user->$key();
 
  776                                                $adr[5] = $user->$key();
 
  779                                                $adr[3] = $user->$key();
 
  782                                                $adr[6] = $user->$key();
 
  797                                                $vcard->setEmail($user->$key());
 
  800                                                $vcard->setNote($user->$key());
 
  803                                                $vcard->setPosition($user->getLatitude(), $user->getLongitude());
 
  811                        $vcard->setOrganization(join(
";", $org));
 
  815                        $vcard->setAddress($adr[0], $adr[1], $adr[2], $adr[3], $adr[4], $adr[5], $adr[6]);
 
  835                if (
$ilUser->getId() == ANONYMOUS_USER_ID && $user->getPref(
"public_profile") != 
"g")
 
  838                        if($user->getPref(
"public_profile") == 
"y")
 
  847                        if(strtolower(
$ilCtrl->getCmd()) == strtolower(
'approveContactRequest'))
 
  849                                ilUtil::redirect(
'login.php?cmd=force_login&target=usr_' . $a_user_id . 
'_contact_approved');
 
  851                        else if(strtolower(
$ilCtrl->getCmd()) == strtolower(
'ignoreContactRequest'))
 
  853                                ilUtil::redirect(
'login.php?cmd=force_login&target=usr_' . $a_user_id . 
'_contact_ignored');
 
  864                $tpl->resetHeaderBlock();
 
  866                include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  880                include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";                              
 
  884                        include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
 
  886                        if($access_handler->checkAccess(
"read", 
"", $portfolio_id))
 
  888                                return $portfolio_id;
 
  897                $multi_fields = array(
"interests_general", 
"interests_help_offered", 
"interests_help_looking");
 
  898                if(in_array($a_field_id, $multi_fields) && $a_term)
 
  913                                $result[$cnt]        = 
new stdClass();
 
  920                        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
  923                                $result[$cnt]        = 
new stdClass();
 
  936                $field_id = (string)$_REQUEST[
"f"];
 
  937                $term = (string)$_REQUEST[
"term"];
 
  941                include_once 
'Services/JSON/classes/class.ilJsonUtil.php';
 
  950        protected function approveContactRequest()
 
  957                if(isset($_REQUEST[
'osd_id']))
 
  959                        $ilCtrl->setParameterByClass(
'ilBuddySystemGUI', 
'osd_id', $_REQUEST[
'osd_id']);
 
  962                $ilCtrl->setParameterByClass(
'ilBuddySystemGUI', 
'user_id', $this->
getUserId());
 
  963                $ilCtrl->redirectByClass(array(
'ilPublicUserProfileGUI', 
'ilBuddySystemGUI'), 
'link');
 
  969        protected function ignoreContactRequest()
 
  976                if(isset($_REQUEST[
'osd_id']))
 
  978                        $ilCtrl->setParameterByClass(
'ilBuddySystemGUI', 
'osd_id', $_REQUEST[
'osd_id']);
 
  981                $ilCtrl->setParameterByClass(
'ilBuddySystemGUI', 
'user_id', $this->
getUserId());
 
  982                $ilCtrl->redirectByClass(array(
'ilPublicUserProfileGUI', 
'ilBuddySystemGUI'), 
'ignore');
 
An exception for terminatinating execution or to throw for unit testing.
static getInstancesByUserId($a_user_id)
static formatDate(ilDateTime $date)
Format a date @access public.
static encode($mixed, $suppress_native=false)
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static isActivated()
Checks whether Map feature is activated.
static getMapGUI()
Get an instance of the GUI class.
static removeNotification($notification_osd_id)
Removes a notifcation and triggers a follow up notification to remove the notification from the brows...
Portfolio view gui class.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static findInterests($a_term, $a_user_id=null, $a_field_id=null)
getPref($a_keyword)
get a user preference
static _isAnonymous($usr_id)
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
Class for permanent links.
Access handler for portfolio.
GUI class for public user profile presentation.
setEmbedded($a_value, $a_offline=false)
setUserId($a_userid)
Set User ID.
deliverVCard()
Deliver vcard information.
setBackUrl($a_backurl)
Set Back Link URL.
setAdditional($a_additional)
Set Additonal Information.
getAdditional()
Get Additonal Information.
handleBackUrl($a_is_portfolio=false)
static validateUser($a_user_id)
Check if given user id is valid.
static getAutocompleteResult($a_field_id, $a_term)
getBackUrl()
Get Back Link URL.
getProfilePortfolio()
Check if current profile portfolio is accessible.
setCustomPrefs(array $a_prefs)
Set custom preferences for public profile fields.
getEmbeddable($a_add_goto=false)
get public profile html code
__construct($a_user_id=0)
Constructor.
getPublicPref(ilObjUser $a_user, $a_id)
Get user preference for public profile.
executeCommand()
Execute Command.
static findSkills($a_term)
Find skills.
special template class to simplify handling of ITX/PEAR
static _getInstance()
Get instance.
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 getWebspaceDir($mode="filesystem")
get webspace directory
static redirect($a_script)
http redirect to other script
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']