24require_once(
"./Services/COPage/classes/class.ilPCProfile.php");
25require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
44 function ilPCProfileGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
46 parent::ilPageContentGUI($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 $is_template = ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder"));
120 $ilToolbar->addButton($this->lng->txt(
"cont_edit_personal_data"),
121 $ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumptoprofile"),
128 $lng_suffix =
"_template";
131 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
133 $form->setFormAction(
$ilCtrl->getFormAction($this));
136 $form->setTitle($this->lng->txt(
"cont_insert_profile"));
140 $form->setTitle($this->lng->txt(
"cont_update_profile"));
144 $form->addItem($mode);
146 $mode_inherit =
new ilRadioOption($this->lng->txt(
"cont_profile_mode_inherit"),
"inherit");
147 $mode_inherit->setInfo($this->lng->txt(
"cont_profile_mode".$lng_suffix.
"_inherit_info"));
148 $mode->addOption($mode_inherit);
150 $mode_manual =
new ilRadioOption($this->lng->txt(
"cont_profile_mode_manual"),
"manual");
151 $mode_manual->setInfo($this->lng->txt(
"cont_profile_mode_manual_info"));
152 $mode->addOption($mode_manual);
157 $mode->setValue(
"inherit");
161 $mode_value = $this->content_obj->getMode();
162 $mode->setValue($mode_value);
165 if($mode_value ==
"manual")
167 foreach($this->content_obj->getFields() as $name)
169 $prefs[
"public_".$name] =
"y";
175 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
176 foreach ($im_arr as $im)
178 if(!isset($prefs[
"public_im_".$im]))
180 $prefs[
"public_im_".$im] =
"n";
184 include_once
"Services/User/classes/class.ilPersonalProfileGUI.php";
186 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
191 $form->addCommandButton(
"create_profile", $this->lng->txt(
"save"));
192 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
197 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
198 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
212 foreach(
$_POST as $name => $value)
214 if(substr($name, 0, 4) ==
"chk_")
218 $fields[] = substr($name, 4);
231 if($form->checkInput())
234 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
235 $this->content_obj->setFields($form->getInput(
"mode"),
236 $this->getFieldsValues());
237 $this->updated = $this->pg_obj->update();
238 if ($this->updated ===
true)
240 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
253 if($form->checkInput())
255 $this->content_obj->setFields($form->getInput(
"mode"),
256 $this->getFieldsValues());
257 $this->updated = $this->pg_obj->update();
258 if ($this->updated ===
true)
260 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
264 $this->pg_obj->addHierIDs();
& executeCommand()
execute command
create()
Create new personal data.
edit(ilPropertyFormGUI $a_form=null)
Edit personal data form.
ilPCProfileGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
initForm($a_insert=false)
Init profile form.
getFieldsValues()
Gather field values.
insert(ilPropertyFormGUI $a_form=null)
Insert new personal data form.
update()
Update personal data.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
GUI class for personal profile.
This class represents an option in a radio group.