ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPCSkillsGUI Class Reference

Class ilPCSkillsGUI. More...

+ Inheritance diagram for ilPCSkillsGUI:
+ Collaboration diagram for ilPCSkillsGUI:

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 skills form. More...
 
 edit (ilPropertyFormGUI $a_form=null)
 Edit skills form. More...
 
 create ()
 Create new skill. More...
 
 update ()
 Update blog. 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...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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 skills form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 

Protected Attributes

 $user
 
- 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 ilPCSkillsGUI.

Handles user commands on skills 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.ilPCSkillsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

50 {
51 global $DIC;
52
53 $this->tpl = $DIC["tpl"];
54 $this->ctrl = $DIC->ctrl();
55 $this->user = $DIC->user();
56 $this->lng = $DIC->language();
57 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
58 }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCSkillsGUI::create ( )

Create new skill.

Definition at line 186 of file class.ilPCSkillsGUI.php.

187 {
188 $valid = false;
189
190 // template mode: get skills from global skill tree
191 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
192 $data = (int) $_GET["skill_id"];
193 $valid = true;
194 }
195 // editor mode: use personal skills
196 else {
197 $form = $this->initForm(true);
198 if ($form->checkInput()) {
199 $data = $form->getInput("skill_id");
200 $valid = true;
201 }
202 }
203
204 if ($valid) {
205 $this->content_obj = new ilPCSkills($this->getPage());
206 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
207 $this->content_obj->setData($data);
208 $this->updated = $this->pg_obj->update();
209 if ($this->updated === true) {
210 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
211 }
212 }
213
214 $form->setValuesByPost();
215 return $this->insert($form);
216 }
$_GET["client_id"]
initForm($a_insert=false)
Init skills form.
insert(ilPropertyFormGUI $a_form=null)
Insert skills form.
Class ilPCSkills.
getPageConfig()
Get Page Config.
$valid
$data
Definition: storeScorm.php:23

References $_GET, $data, $valid, ilPageContentGUI\getPage(), ilPageContentGUI\getPageConfig(), initForm(), and insert().

+ Here is the call graph for this function:

◆ edit()

ilPCSkillsGUI::edit ( ilPropertyFormGUI  $a_form = null)

Edit skills form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 112 of file class.ilPCSkillsGUI.php.

113 {
115
116 $this->displayValidationError();
117
118 // template mode: get skills from global skill tree
119 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
120 $exp = new ilPersonalSkillExplorerGUI($this, "edit", $this, "update", "skill_id");
121 if (!$exp->handleCommand()) {
122 $tpl->setContent($exp->getHTML());
123 }
124 }
125 // editor mode: use personal skills
126 else {
127 if (!$a_form) {
128 $a_form = $this->initForm();
129 }
130 $tpl->setContent($a_form->getHTML());
131 }
132 }
displayValidationError()
display validation errors
Explorer for selecting a personal skill.

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

Referenced by update().

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

◆ executeCommand()

ilPCSkillsGUI::executeCommand ( )

execute command

Definition at line 63 of file class.ilPCSkillsGUI.php.

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

References $ret.

◆ initForm()

ilPCSkillsGUI::initForm (   $a_insert = false)
protected

Init skills form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

Definition at line 140 of file class.ilPCSkillsGUI.php.

141 {
142 $ilCtrl = $this->ctrl;
145
146 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
147 $form = new ilPropertyFormGUI();
148 $form->setFormAction($ilCtrl->getFormAction($this));
149 if ($a_insert) {
150 $form->setTitle($this->lng->txt("cont_insert_skills"));
151 } else {
152 $form->setTitle($this->lng->txt("cont_update_skills"));
153 }
154
155 $options = array();
156
158 if ($skills) {
159 foreach ($skills as $skill) {
160 $options[$skill["skill_node_id"]] = $skill["title"];
161 }
162 asort($options);
163 } else {
164 ilUtil::sendFailure("cont_no_skills");
165 }
166 $obj = new ilSelectInputGUI($this->lng->txt("cont_pc_skills"), "skill_id");
167 $obj->setRequired(true);
168 $obj->setOptions($options);
169 $form->addItem($obj);
170
171 if ($a_insert) {
172 $form->addCommandButton("create_skill", $this->lng->txt("select"));
173 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
174 } else {
175 $obj->setValue($this->content_obj->getSkillId());
176 $form->addCommandButton("update", $this->lng->txt("select"));
177 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
178 }
179
180 return $form;
181 }
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
This class represents a property form user interface.
This class represents a selection list property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ilUser
Definition: imgupload.php:18

References ilPageContentGUI\$ctrl, $ilUser, ilPageContentGUI\$lng, $user, ilPersonalSkill\getSelectedUserSkills(), and ilUtil\sendFailure().

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

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

◆ insert()

ilPCSkillsGUI::insert ( ilPropertyFormGUI  $a_form = null)

Insert skills form.

Parameters
ilPropertyFormGUI$a_form

Definition at line 85 of file class.ilPCSkillsGUI.php.

86 {
88
90
91 // template mode: get skills from global skill tree
92 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
93 $exp = new ilPersonalSkillExplorerGUI($this, "insert", $this, "create", "skill_id");
94 if (!$exp->handleCommand()) {
95 $tpl->setContent($exp->getHTML());
96 }
97 }
98 // editor mode: use personal skills
99 else {
100 if (!$a_form) {
101 $a_form = $this->initForm(true);
102 }
103 $tpl->setContent($a_form->getHTML());
104 }
105 }

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

Referenced by create().

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

◆ update()

ilPCSkillsGUI::update ( )

Update blog.

Definition at line 221 of file class.ilPCSkillsGUI.php.

222 {
223 // template mode: get skills from global skill tree
224 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
225 $data = (int) $_GET["skill_id"];
226 $valid = true;
227 }
228 // editor mode: use personal skills
229 else {
230 $form = $this->initForm();
231 if ($form->checkInput()) {
232 $data = $form->getInput("skill_id");
233 $valid = true;
234 }
235 }
236
237 if ($valid) {
238 $this->content_obj->setData($data);
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 $form->setValuesByPost();
247 return $this->edit($form);
248 }
edit(ilPropertyFormGUI $a_form=null)
Edit skills form.

References $_GET, $data, $valid, edit(), ilPageContentGUI\getPageConfig(), and initForm().

+ Here is the call graph for this function:

Field Documentation

◆ $user

ilPCSkillsGUI::$user
protected

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

Referenced by initForm().


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