/**
  * Add fields to form
  *
  * @param ilPropertyformGUI $form
  * @param array $prefs
  * @param object $parent
  * @param bool $a_anonymized
  */
 public function showPublicProfileFields(ilPropertyformGUI $form, array $prefs, $parent = null, $anonymized = false)
 {
     global $ilUser;
     $birthday = $ilUser->getBirthday();
     if ($birthday) {
         $birthday = ilDatePresentation::formatDate(new ilDate($birthday, IL_CAL_DATE));
     }
     $gender = $ilUser->getGender();
     if ($gender) {
         $gender = $this->lng->txt("gender_" . $gender);
     }
     if ($ilUser->getSelectedCountry() != "") {
         $this->lng->loadLanguageModule("meta");
         $txt_sel_country = $this->lng->txt("meta_c_" . $ilUser->getSelectedCountry());
     }
     // profile picture
     $pic = ilObjUser::_getPersonalPicturePath($ilUser->getId(), "xsmall", true, true);
     if ($pic) {
         $pic = "<img src=\"" . $pic . "\" />";
     }
     // personal data
     $val_array = array("title" => $ilUser->getUTitle(), "birthday" => $birthday, "gender" => $gender, "upload" => $pic, "interests_general" => $ilUser->getGeneralInterestsAsText(), "interests_help_offered" => $ilUser->getOfferingHelpAsText(), "interests_help_looking" => $ilUser->getLookingForHelpAsText(), "institution" => $ilUser->getInstitution(), "department" => $ilUser->getDepartment(), "street" => $ilUser->getStreet(), "zipcode" => $ilUser->getZipcode(), "city" => $ilUser->getCity(), "country" => $ilUser->getCountry(), "sel_country" => $txt_sel_country, "phone_office" => $ilUser->getPhoneOffice(), "phone_home" => $ilUser->getPhoneHome(), "phone_mobile" => $ilUser->getPhoneMobile(), "fax" => $ilUser->getFax(), "email" => $ilUser->getEmail(), "hobby" => $ilUser->getHobby(), "matriculation" => $ilUser->getMatriculation(), "delicious" => $ilUser->getDelicious());
     // location
     include_once "./Services/Maps/classes/class.ilMapUtil.php";
     if (ilMapUtil::isActivated()) {
         $val_array["location"] = "";
     }
     foreach ($val_array as $key => $value) {
         if ($anonymized) {
             $value = null;
         }
         if ($this->userSettingVisible($key)) {
             // public setting
             if ($key == "upload") {
                 $cb = new ilCheckboxInputGUI($this->lng->txt("personal_picture"), "chk_" . $key);
             } else {
                 $cb = new ilCheckboxInputGUI($this->lng->txt($key), "chk_" . $key);
             }
             if ($prefs["public_" . $key] == "y") {
                 $cb->setChecked(true);
             }
             //$cb->setInfo($value);
             $cb->setOptionTitle($value);
             if (!$parent) {
                 $form->addItem($cb);
             } else {
                 $parent->addSubItem($cb);
             }
         }
     }
     $im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
     if ($this->userSettingVisible("instant_messengers")) {
         foreach ($im_arr as $im) {
             // public setting
             $cb = new ilCheckboxInputGUI($this->lng->txt("im_" . $im), "chk_im_" . $im);
             //$cb->setInfo($ilUser->getInstantMessengerId($im));
             $cb->setOptionTitle($ilUser->getInstantMessengerId($im));
             if ($prefs["public_im_" . $im] != "n") {
                 $cb->setChecked(true);
             }
             if (!$parent) {
                 $form->addItem($cb);
             } else {
                 $parent->addSubItem($cb);
             }
         }
     }
     // additional defined user data fields
     $user_defined_data = array();
     if (!$anonymized) {
         $user_defined_data = $ilUser->getUserDefinedData();
     }
     foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
         // public setting
         $cb = new ilCheckboxInputGUI($definition["field_name"], "chk_udf_" . $definition["field_id"]);
         $cb->setOptionTitle($user_defined_data["f_" . $definition["field_id"]]);
         if ($prefs["public_udf_" . $definition["field_id"]] == "y") {
             $cb->setChecked(true);
         }
         if (!$parent) {
             $form->addItem($cb);
         } else {
             $parent->addSubItem($cb);
         }
     }
 }