ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPCProfileGUI Class Reference

Class ilPCProfileGUI. More...

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

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 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 ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Protected Member Functions

 initForm ($a_insert=false)
 Init profile form. More...
 
 getFieldsValues ()
 Gather field values. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 

Protected Attributes

 $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $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 $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
Version
$I$

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

Constructor & Destructor Documentation

◆ __construct()

ilPCProfileGUI::__construct ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor @access public.

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

50 {
51 global $DIC;
52
53 $this->tpl = $DIC["tpl"];
54 $this->ctrl = $DIC->ctrl();
55 $this->toolbar = $DIC->toolbar();
56 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
57 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ create()

ilPCProfileGUI::create ( )

Create new personal data.

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

210 {
211 $form = $this->initForm(true);
212 if ($form->checkInput()) {
213 $this->content_obj = new ilPCProfile($this->getPage());
214 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
215 $this->content_obj->setFields(
216 $form->getInput("mode"),
217 $this->getFieldsValues()
218 );
219 $this->updated = $this->pg_obj->update();
220 if ($this->updated === true) {
221 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
222 }
223 }
224
225 $this->insert($form);
226 }
initForm($a_insert=false)
Init profile form.
insert(ilPropertyFormGUI $a_form=null)
Insert new personal data form.
Class ilPCProfile.
if(isset($_POST['submit'])) $form

References $form, ilPageContentGUI\getPage(), initForm(), and insert().

+ Here is the call graph for this function:

◆ edit()

ilPCProfileGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit personal data form.

Parameters
ilPropertyFormGUI$a_form

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

102 {
104
105 $this->displayValidationError();
106
107 if (!$a_form) {
108 $a_form = $this->initForm();
109 }
110 $tpl->setContent($a_form->getHTML());
111 }
displayValidationError()
display validation errors

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by update().

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

◆ executeCommand()

ilPCProfileGUI::executeCommand ( )

execute command

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

63 {
64 // get next class that processes or forwards current command
65 $next_class = $this->ctrl->getNextClass($this);
66
67 // get current command
68 $cmd = $this->ctrl->getCmd();
69
70 switch ($next_class) {
71 default:
72 $ret = $this->$cmd();
73 break;
74 }
75
76 return $ret;
77 }
$ret
Definition: parser.php:6

References $ret.

◆ getFieldsValues()

ilPCProfileGUI::getFieldsValues ( )
protected

Gather field values.

Returns
array

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

194 {
195 $fields = array();
196 foreach ($_POST as $name => $value) {
197 if (substr($name, 0, 4) == "chk_") {
198 if ($value) {
199 $fields[] = substr($name, 4);
200 }
201 }
202 }
203 return $fields;
204 }
$_POST["username"]

References $_POST, and $name.

◆ initForm()

ilPCProfileGUI::initForm (   $a_insert = false)
protected

Init profile form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

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

120 {
122 $ilToolbar = $this->toolbar;
123
124 $is_template = ($this->getPageConfig()->getEnablePCType("PlaceHolder"));
125
126 if (!$is_template) {
127 $ilToolbar->addButton(
128 $this->lng->txt("cont_edit_personal_data"),
129 $ilCtrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumptoprofile"),
130 "profile"
131 );
132
133 $lng_suffix = "";
134 } else {
135 $lng_suffix = "_template";
136 }
137
138 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
139 $form = new ilPropertyFormGUI();
140 $form->setFormAction($ilCtrl->getFormAction($this));
141 if ($a_insert) {
142 $form->setTitle($this->lng->txt("cont_insert_profile"));
143 } else {
144 $form->setTitle($this->lng->txt("cont_update_profile"));
145 }
146
147 $mode = new ilRadioGroupInputGUI($this->lng->txt("cont_profile_mode"), "mode");
148 $form->addItem($mode);
149
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);
153
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);
157
158 $prefs = array();
159 if ($a_insert) {
160 $mode->setValue("inherit");
161 } else {
162 $mode_value = $this->content_obj->getMode();
163 $mode->setValue($mode_value);
164
165 $prefs = array();
166 if ($mode_value == "manual") {
167 foreach ($this->content_obj->getFields() as $name) {
168 $prefs["public_" . $name] = "y";
169 }
170 }
171 }
172
173 include_once "Services/User/classes/class.ilPersonalProfileGUI.php";
174 $profile = new ilPersonalProfileGUI();
175 $profile->showPublicProfileFields($form, $prefs, $mode_manual, $is_template);
176
177 if ($a_insert) {
178 $form->addCommandButton("create_profile", $this->lng->txt("save"));
179 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
180 } else {
181 $form->addCommandButton("update", $this->lng->txt("save"));
182 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
183 }
184
185 return $form;
186 }
getPageConfig()
Get Page Config.
GUI class for personal profile.
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.
global $ilCtrl
Definition: ilias.php:18

References ilPageContentGUI\$ctrl, $form, $ilCtrl, $name, $toolbar, and ilPageContentGUI\getPageConfig().

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.

Parameters
ilPropertyFormGUI$a_form

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

85 {
87
89
90 if (!$a_form) {
91 $a_form = $this->initForm(true);
92 }
93 $tpl->setContent($a_form->getHTML());
94 }

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

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 231 of file class.ilPCProfileGUI.php.

232 {
233 $form = $this->initForm(true);
234 if ($form->checkInput()) {
235 $this->content_obj->setFields(
236 $form->getInput("mode"),
237 $this->getFieldsValues()
238 );
239 $this->updated = $this->pg_obj->update();
240 if ($this->updated === true) {
241 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
242 }
243 }
244
245 $this->pg_obj->addHierIDs();
246 $this->edit($form);
247 }
edit(ilPropertyFormGUI $a_form=null)
Edit personal data form.

References $form, edit(), and initForm().

+ Here is the call graph for this function:

Field Documentation

◆ $toolbar

ilPCProfileGUI::$toolbar
protected

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

Referenced by initForm().


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