28 protected \ILIAS\HTTP\Services
$http;
39 $this->tpl =
$DIC[
"tpl"];
40 $this->
ctrl = $DIC->ctrl();
41 $this->
toolbar = $DIC->toolbar();
42 $this->
http = $DIC->http();
49 $next_class = $this->
ctrl->getNextClass($this);
52 $cmd = $this->
ctrl->getCmd();
54 switch ($next_class) {
99 $is_template = ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder"));
103 $this->
lng->txt(
"cont_edit_personal_data"),
104 $ilCtrl->getLinkTargetByClass(
"ildashboardgui",
"jumptoprofile"),
110 $lng_suffix =
"_template";
114 $form->setFormAction($ilCtrl->getFormAction($this));
116 $form->setTitle($this->
lng->txt(
"cont_insert_profile"));
118 $form->setTitle($this->
lng->txt(
"cont_update_profile"));
122 $form->addItem($mode);
124 $mode_inherit =
new ilRadioOption($this->
lng->txt(
"cont_profile_mode_inherit"),
"inherit");
125 $mode_inherit->setInfo($this->
lng->txt(
"cont_profile_mode" . $lng_suffix .
"_inherit_info"));
126 $mode->addOption($mode_inherit);
128 $mode_manual =
new ilRadioOption($this->
lng->txt(
"cont_profile_mode_manual"),
"manual");
129 $mode_manual->setInfo($this->
lng->txt(
"cont_profile_mode_manual_info"));
130 $mode->addOption($mode_manual);
134 $mode->setValue(
"inherit");
136 $mode_value = $this->content_obj->getMode();
137 $mode->setValue($mode_value);
140 if ($mode_value ==
"manual") {
141 foreach ($this->content_obj->getFields() as $name) {
142 $prefs[
"public_" . $name] =
true;
148 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
151 $form->addCommandButton(
"create", $this->
lng->txt(
"save"));
152 $form->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
154 $form->addCommandButton(
"update", $this->
lng->txt(
"save"));
155 $form->addCommandButton(
"cancelUpdate", $this->
lng->txt(
"cancel"));
167 foreach ($this->
http->request()->getParsedBody() as $name => $value) {
168 if (substr($name, 0, 4) ==
"chk_") {
170 $fields[] = substr($name, 4);
183 if ($form->checkInput()) {
185 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
186 $this->content_obj->setFields(
187 $form->getInput(
"mode"),
188 $this->getFieldsValues()
190 $this->updated = $this->pg_obj->update();
191 if ($this->updated ===
true) {
192 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
205 if ($form->checkInput()) {
206 $this->content_obj->setFields(
207 $form->getInput(
"mode"),
208 $this->getFieldsValues()
210 $this->updated = $this->pg_obj->update();
211 if ($this->updated ===
true) {
212 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
216 $this->pg_obj->addHierIDs();
GUI class for personal profile.
Class ilPCProfileGUI Handles user commands on personal data.
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
create()
Create new personal data.
insert(?ilPropertyFormGUI $a_form=null)
Insert new personal data form.
ILIAS HTTP Services $http
initForm(bool $a_insert=false)
Init profile form.
edit(?ilPropertyFormGUI $a_form=null)
Edit personal data form.
getFieldsValues()
Gather field values.
update()
Update personal data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
ilGlobalTemplateInterface $tpl
Content object of ilPageObject (see ILIAS DTD).
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
This class represents an option in a radio group.
setContent(string $a_html)
Sets content for standard template.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc