24 require_once(
"./Services/COPage/classes/class.ilPCProfile.php");
 
   25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   44         function ilPCProfileGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = 
"")
 
   55                 $next_class = $this->ctrl->getNextClass($this);
 
   58                 $cmd = $this->ctrl->getCmd();
 
   85                 $tpl->setContent($a_form->getHTML());
 
  103                 $tpl->setContent($a_form->getHTML());
 
  116                 $ilToolbar->addButton($this->lng->txt(
"cont_edit_personal_data"), 
 
  117                         $ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui", 
"jumptoprofile"),
 
  120                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  122                 $form->setFormAction($ilCtrl->getFormAction($this));
 
  125                         $form->setTitle($this->lng->txt(
"cont_insert_profile"));
 
  129                         $form->setTitle($this->lng->txt(
"cont_update_profile"));
 
  133                 $form->addItem($mode);
 
  135                 $mode_inherit = 
new ilRadioOption($this->lng->txt(
"cont_profile_mode_inherit"), 
"inherit");
 
  136                 $mode_inherit->
setInfo($this->lng->txt(
"cont_profile_mode_inherit_info"));
 
  137                 $mode->addOption($mode_inherit);
 
  139                 $mode_manual = 
new ilRadioOption($this->lng->txt(
"cont_profile_mode_manual"), 
"manual");
 
  140                 $mode_manual->
setInfo($this->lng->txt(
"cont_profile_mode_manual_info"));
 
  141                 $mode->addOption($mode_manual);
 
  146                         $mode->setValue(
"inherit");
 
  150                         $mode_value = $this->content_obj->getMode();
 
  151                         $mode->setValue($mode_value);
 
  154                         if($mode_value == 
"manual")
 
  156                                 foreach($this->content_obj->getFields() as $name)
 
  158                                         $prefs[
"public_".$name] = 
"y";
 
  164                 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
 
  165                 foreach ($im_arr as $im)
 
  167                         if(!isset($prefs[
"public_im_".$im]))
 
  169                                 $prefs[
"public_im_".$im] = 
"n";
 
  173                 include_once 
"Services/User/classes/class.ilPersonalProfileGUI.php";
 
  175                 $profile->showPublicProfileFields($form, $prefs, $mode_manual);
 
  180                         $form->addCommandButton(
"create_profile", $this->lng->txt(
"save"));
 
  181                         $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
 
  186                         $form->addCommandButton(
"update", $this->lng->txt(
"save"));
 
  187                         $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
 
  201                 foreach(
$_POST as $name => $value)
 
  203                         if(substr($name, 0, 4) == 
"chk_")
 
  207                                         $fields[] = substr($name, 4);
 
  220                 if($form->checkInput())
 
  223                         $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
  224                         $this->content_obj->setFields($form->getInput(
"mode"),
 
  226                         $this->updated = $this->pg_obj->update();
 
  227                         if ($this->updated === 
true)
 
  229                                 $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);
 
  242                 if($form->checkInput())
 
  244                         $this->content_obj->setFields($form->getInput(
"mode"),
 
  246                         $this->updated = $this->pg_obj->update();
 
  247                         if ($this->updated === 
true)
 
  249                                 $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);
 
  253                 $this->pg_obj->addHierIDs();