ILIAS  release_8 Revision v8.24
ilPCSkillsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

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)
 
 edit (ilPropertyFormGUI $a_form=null)
 
 create ()
 
 update ()
 
- 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 ()
 
 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 ()
 
 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 skills form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 

Protected Attributes

ilObjUser $user
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
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 = ""
 
php4DOMDocument $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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilPageContentGUI.

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

33 {
34 global $DIC;
35
36 $this->tpl = $DIC["tpl"];
37 $this->ctrl = $DIC->ctrl();
38 $this->user = $DIC->user();
39 $this->lng = $DIC->language();
40 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
41 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCSkillsGUI::create ( )

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

147 : void
148 {
149 $valid = false;
150 $data = null;
151 $form = null;
152
153 // template mode: get skills from global skill tree
154 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
155 $data = $this->request->getInt("skill_id");
156 $valid = true;
157 }
158 // editor mode: use personal skills
159 else {
160 $form = $this->initForm(true);
161 if ($form->checkInput()) {
162 $data = $form->getInput("skill_id");
163 $valid = true;
164 }
165 }
166
167 if ($valid) {
168 $this->content_obj = new ilPCSkills($this->getPage());
169 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
170 $this->content_obj->setData($data);
171 $this->updated = $this->pg_obj->update();
172 if ($this->updated === true) {
173 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
174 }
175 }
176
177 $form->setValuesByPost();
178 $this->insert($form);
179 }
initForm(bool $a_insert=false)
Init skills form.
insert(ilPropertyFormGUI $a_form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$valid

References $data, $valid, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ edit()

ilPCSkillsGUI::edit ( ilPropertyFormGUI  $a_form = null)

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

80 : void
81 {
83
85
86 // template mode: get skills from global skill tree
87 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
88 $exp = new ilPersonalSkillExplorerGUI($this, "edit", $this, "update", "skill_id");
89 if (!$exp->handleCommand()) {
90 $tpl->setContent($exp->getHTML());
91 }
92 }
93 // editor mode: use personal skills
94 else {
95 if (!$a_form) {
96 $a_form = $this->initForm();
97 }
98 $tpl->setContent($a_form->getHTML());
99 }
100 }
ilGlobalTemplateInterface $tpl
Explorer for selecting a personal skill.
setContent(string $a_html)
Sets content for standard template.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPCSkillsGUI::executeCommand ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initForm()

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

Init skills form.

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

108 $ilCtrl = $this->ctrl;
110
111 $form = new ilPropertyFormGUI();
112 $form->setFormAction($ilCtrl->getFormAction($this));
113 if ($a_insert) {
114 $form->setTitle($this->lng->txt("cont_insert_skills"));
115 } else {
116 $form->setTitle($this->lng->txt("cont_update_skills"));
117 }
118
119 $options = array();
120
122 if ($skills) {
123 foreach ($skills as $skill) {
124 $options[$skill["skill_node_id"]] = $skill["title"];
125 }
126 asort($options);
127 } else {
128 $this->tpl->setOnScreenMessage('failure', "cont_no_skills");
129 }
130 $obj = new ilSelectInputGUI($this->lng->txt("cont_pc_skills"), "skill_id");
131 $obj->setRequired(true);
132 $obj->setOptions($options);
133 $form->addItem($obj);
134
135 if ($a_insert) {
136 $form->addCommandButton("create_skill", $this->lng->txt("select"));
137 $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
138 } else {
139 $obj->setValue($this->content_obj->getSkillId());
140 $form->addCommandButton("update", $this->lng->txt("select"));
141 $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
142 }
143
144 return $form;
145 }
static getSelectedUserSkills(int $a_user_id)
This class represents a property form user interface.
This class represents a selection list property in a property form.
$ilUser
Definition: imgupload.php:34

Referenced by edit(), and insert().

+ Here is the caller graph for this function:

◆ insert()

ilPCSkillsGUI::insert ( ilPropertyFormGUI  $a_form = null)

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

58 : void
59 {
61
63
64 // template mode: get skills from global skill tree
65 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
66 $exp = new ilPersonalSkillExplorerGUI($this, "insert", $this, "create", "skill_id");
67 if (!$exp->handleCommand()) {
68 $tpl->setContent($exp->getHTML());
69 }
70 }
71 // editor mode: use personal skills
72 else {
73 if (!$a_form) {
74 $a_form = $this->initForm(true);
75 }
76 $tpl->setContent($a_form->getHTML());
77 }
78 }

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

+ Here is the call graph for this function:

◆ update()

ilPCSkillsGUI::update ( )

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

181 : void
182 {
183 $valid = false;
184 $data = null;
185 $form = null;
186
187 // template mode: get skills from global skill tree
188 if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
189 $data = $this->request->getInt("skill_id");
190 $valid = true;
191 }
192 // editor mode: use personal skills
193 else {
194 $form = $this->initForm();
195 if ($form->checkInput()) {
196 $data = $form->getInput("skill_id");
197 $valid = true;
198 }
199 }
200
201 if ($valid) {
202 $this->content_obj->setData($data);
203 $this->updated = $this->pg_obj->update();
204 if ($this->updated === true) {
205 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
206 }
207 }
208
209 $this->pg_obj->addHierIDs();
210 $form->setValuesByPost();
211 $this->edit($form);
212 }
edit(ilPropertyFormGUI $a_form=null)

References $data, $valid, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

Field Documentation

◆ $user

ilObjUser ilPCSkillsGUI::$user
protected

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


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