ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCProfileGUI Class Reference

Class ilPCProfileGUI Handles user commands on personal data. More...

+ Inheritance diagram for ilPCProfileGUI:
+ Collaboration diagram for ilPCProfileGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 insert (?ilPropertyFormGUI $a_form=null)
 Insert new personal data form. More...
 
 edit (?ilPropertyFormGUI $a_form=null)
 Edit personal data form. More...
 
 create ()
 Create new personal data. More...
 
 update ()
 Update personal data. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Protected Member Functions

 initForm (bool $a_insert=false)
 Init profile form. More...
 
 getFieldsValues ()
 Gather field values. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ILIAS HTTP Services $http
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

Class ilPCProfileGUI Handles user commands on personal data.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilPCProfileGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCProfileGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Reimplemented from ilPageContentGUI.

Definition at line 31 of file class.ilPCProfileGUI.php.

36 {
37 global $DIC;
38
39 $this->tpl = $DIC["tpl"];
40 $this->ctrl = $DIC->ctrl();
41 $this->toolbar = $DIC->toolbar();
42 $this->http = $DIC->http();
43 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
44 }
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCProfileGUI::create ( )

Create new personal data.

Definition at line 180 of file class.ilPCProfileGUI.php.

180 : void
181 {
182 $form = $this->initForm(true);
183 if ($form->checkInput()) {
184 $this->content_obj = new ilPCProfile($this->getPage());
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()
189 );
190 $this->updated = $this->pg_obj->update();
191 if ($this->updated === true) {
192 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
193 }
194 }
195
196 $this->insert($form);
197 }
insert(?ilPropertyFormGUI $a_form=null)
Insert new personal data form.
initForm(bool $a_insert=false)
Init profile form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ilPageContentGUI\getPage(), initForm(), and insert().

+ Here is the call graph for this function:

◆ edit()

ilPCProfileGUI::edit ( ?ilPropertyFormGUI  $a_form = null)

Edit personal data form.

Definition at line 79 of file class.ilPCProfileGUI.php.

79 : void
80 {
82
84
85 if (!$a_form) {
86 $a_form = $this->initForm();
87 }
88 $tpl->setContent($a_form->getHTML());
89 }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCProfileGUI::executeCommand ( )

Definition at line 46 of file class.ilPCProfileGUI.php.

46 : void
47 {
48 // get next class that processes or forwards current command
49 $next_class = $this->ctrl->getNextClass($this);
50
51 // get current command
52 $cmd = $this->ctrl->getCmd();
53
54 switch ($next_class) {
55 default:
56 $this->$cmd();
57 break;
58 }
59 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getFieldsValues()

ilPCProfileGUI::getFieldsValues ( )
protected

Gather field values.

Definition at line 164 of file class.ilPCProfileGUI.php.

164 : array
165 {
166 $fields = array();
167 foreach ($this->http->request()->getParsedBody() as $name => $value) {
168 if (substr($name, 0, 4) == "chk_") {
169 if ($value) {
170 $fields[] = substr($name, 4);
171 }
172 }
173 }
174 return $fields;
175 }

References ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ initForm()

ilPCProfileGUI::initForm ( bool  $a_insert = false)
protected

Init profile form.

Definition at line 94 of file class.ilPCProfileGUI.php.

95 {
96 $ilCtrl = $this->ctrl;
97 $ilToolbar = $this->toolbar;
98
99 $is_template = ($this->getPageConfig()->getEnablePCType("PlaceHolder"));
100
101 if (!$is_template) {
102 $ilToolbar->addButton(
103 $this->lng->txt("cont_edit_personal_data"),
104 $ilCtrl->getLinkTargetByClass("ildashboardgui", "jumptoprofile"),
105 "profile"
106 );
107
108 $lng_suffix = "";
109 } else {
110 $lng_suffix = "_template";
111 }
112
113 $form = new ilPropertyFormGUI();
114 $form->setFormAction($ilCtrl->getFormAction($this));
115 if ($a_insert) {
116 $form->setTitle($this->lng->txt("cont_insert_profile"));
117 } else {
118 $form->setTitle($this->lng->txt("cont_update_profile"));
119 }
120
121 $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_profile_mode"), "mode");
122 $form->addItem($mode);
123
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);
127
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);
131
132 $prefs = array();
133 if ($a_insert) {
134 $mode->setValue("inherit");
135 } else {
136 $mode_value = $this->content_obj->getMode();
137 $mode->setValue($mode_value);
138
139 $prefs = array();
140 if ($mode_value == "manual") {
141 foreach ($this->content_obj->getFields() as $name) {
142 $prefs["public_" . $name] = true;
143 }
144 }
145 }
146
147 $profile = new PersonalProfileGUI();
148 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
149
150 if ($a_insert) {
151 $form->addCommandButton("create", $this->lng->txt("save"));
152 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
153 } else {
154 $form->addCommandButton("update", $this->lng->txt("save"));
155 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
156 }
157
158 return $form;
159 }
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')

References ilPageContentGUI\$ctrl, $toolbar, ilToolbarGUI\addButton(), ilPageContentGUI\getPageConfig(), and ILIAS\Repository\lng().

Referenced by create(), edit(), insert(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCProfileGUI::insert ( ?ilPropertyFormGUI  $a_form = null)

Insert new personal data form.

Definition at line 64 of file class.ilPCProfileGUI.php.

64 : void
65 {
67
69
70 if (!$a_form) {
71 $a_form = $this->initForm(true);
72 }
73 $tpl->setContent($a_form->getHTML());
74 }

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCProfileGUI::update ( )

Update personal data.

Definition at line 202 of file class.ilPCProfileGUI.php.

202 : void
203 {
204 $form = $this->initForm(true);
205 if ($form->checkInput()) {
206 $this->content_obj->setFields(
207 $form->getInput("mode"),
208 $this->getFieldsValues()
209 );
210 $this->updated = $this->pg_obj->update();
211 if ($this->updated === true) {
212 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
213 }
214 }
215
216 $this->pg_obj->addHierIDs();
217 $this->edit($form);
218 }
edit(?ilPropertyFormGUI $a_form=null)
Edit personal data form.

References ILIAS\Repository\ctrl(), edit(), and initForm().

+ Here is the call graph for this function:

Field Documentation

◆ $http

ILIAS HTTP Services ilPCProfileGUI::$http
protected

Definition at line 28 of file class.ilPCProfileGUI.php.

◆ $toolbar

ilToolbarGUI ilPCProfileGUI::$toolbar
protected

Definition at line 29 of file class.ilPCProfileGUI.php.

Referenced by initForm().


The documentation for this class was generated from the following file: