24require_once(
"./Services/COPage/classes/class.ilPCProfile.php");
25require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
49 public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
53 $this->tpl =
$DIC[
"tpl"];
54 $this->ctrl =
$DIC->ctrl();
55 $this->toolbar =
$DIC->toolbar();
65 $next_class = $this->ctrl->getNextClass($this);
68 $cmd = $this->ctrl->getCmd();
70 switch ($next_class) {
93 $tpl->setContent($a_form->getHTML());
110 $tpl->setContent($a_form->getHTML());
124 $is_template = ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder"));
127 $ilToolbar->addButton(
128 $this->lng->txt(
"cont_edit_personal_data"),
129 $ilCtrl->getLinkTargetByClass(
"ildashboardgui",
"jumptoprofile"),
135 $lng_suffix =
"_template";
138 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
140 $form->setFormAction($ilCtrl->getFormAction($this));
142 $form->setTitle($this->lng->txt(
"cont_insert_profile"));
144 $form->setTitle($this->lng->txt(
"cont_update_profile"));
148 $form->addItem($mode);
150 $mode_inherit =
new ilRadioOption($this->lng->txt(
"cont_profile_mode_inherit"),
"inherit");
151 $mode_inherit->setInfo($this->lng->txt(
"cont_profile_mode" . $lng_suffix .
"_inherit_info"));
152 $mode->addOption($mode_inherit);
154 $mode_manual =
new ilRadioOption($this->lng->txt(
"cont_profile_mode_manual"),
"manual");
155 $mode_manual->setInfo($this->lng->txt(
"cont_profile_mode_manual_info"));
156 $mode->addOption($mode_manual);
160 $mode->setValue(
"inherit");
162 $mode_value = $this->content_obj->getMode();
163 $mode->setValue($mode_value);
166 if ($mode_value ==
"manual") {
167 foreach ($this->content_obj->getFields() as
$name) {
168 $prefs[
"public_" .
$name] =
"y";
174 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
177 $form->addCommandButton(
"create_profile", $this->lng->txt(
"save"));
178 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
180 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
181 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
196 if (substr(
$name, 0, 4) ==
"chk_") {
198 $fields[] = substr(
$name, 4);
211 if ($form->checkInput()) {
213 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
214 $this->content_obj->setFields(
215 $form->getInput(
"mode"),
216 $this->getFieldsValues()
218 $this->updated = $this->pg_obj->update();
219 if ($this->updated ===
true) {
220 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
233 if ($form->checkInput()) {
234 $this->content_obj->setFields(
235 $form->getInput(
"mode"),
236 $this->getFieldsValues()
238 $this->updated = $this->pg_obj->update();
239 if ($this->updated ===
true) {
240 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
244 $this->pg_obj->addHierIDs();
An exception for terminatinating execution or to throw for unit testing.
create()
Create new personal data.
edit(ilPropertyFormGUI $a_form=null)
Edit personal data form.
__construct(&$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.
executeCommand()
execute command
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc