24 require_once(
"./Services/COPage/classes/class.ilPCProfile.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
44 function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
46 parent::__construct($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";
174 include_once
"Services/User/classes/class.ilPersonalProfileGUI.php";
176 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
181 $form->addCommandButton(
"create_profile", $this->lng->txt(
"save"));
182 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
187 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
188 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
202 foreach(
$_POST as $name => $value)
204 if(substr($name, 0, 4) ==
"chk_")
208 $fields[] = substr($name, 4);
221 if($form->checkInput())
224 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
225 $this->content_obj->setFields($form->getInput(
"mode"),
227 $this->updated = $this->pg_obj->update();
228 if ($this->updated ===
true)
230 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
243 if($form->checkInput())
245 $this->content_obj->setFields($form->getInput(
"mode"),
247 $this->updated = $this->pg_obj->update();
248 if ($this->updated ===
true)
250 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
254 $this->pg_obj->addHierIDs();
This class represents an option in a radio group.
create()
Create new personal data.
getPageConfig()
Get Page Config.
setInfo($a_info)
Set Info.
initForm($a_insert=false)
Init profile form.
insert(ilPropertyFormGUI $a_form=null)
Insert new personal data form.
executeCommand()
execute command
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getFieldsValues()
Gather field values.
edit(ilPropertyFormGUI $a_form=null)
Edit personal data form.
displayValidationError()
display validation errors
Create styles array
The data for the language used.
update()
Update personal data.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
GUI class for personal profile.