ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 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 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 skills form. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 

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 public.

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

References $DIC, and user().

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  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCSkillsGUI::create ( )

Create new skill.

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

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

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

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

Referenced by update().

114  {
115  $tpl = $this->tpl;
116 
117  $this->displayValidationError();
118 
119  // template mode: get skills from global skill tree
120  if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
121  include_once "Services/Skill/classes/class.ilPersonalSkillExplorerGUI.php";
122  $exp = new ilPersonalSkillExplorerGUI($this, "edit", $this, "update", "skill_id");
123  if (!$exp->handleCommand()) {
124  $tpl->setContent($exp->getHTML());
125  }
126  }
127  // editor mode: use personal skills
128  else {
129  if (!$a_form) {
130  $a_form = $this->initForm();
131  }
132  $tpl->setContent($a_form->getHTML());
133  }
134  }
Explorer for selecting a personal skill.
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
initForm($a_insert=false)
Init skills form.
+ 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.

References $ret.

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

◆ initForm()

ilPCSkillsGUI::initForm (   $a_insert = false)
protected

Init skills form.

Parameters
bool$a_insert
Returns
ilPropertyFormGUI

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

References ilPageContentGUI\$ctrl, $form, $ilCtrl, $ilUser, ilPageContentGUI\$lng, $options, $user, array, ilPersonalSkill\getSelectedUserSkills(), ilUtil\sendFailure(), and ilFormPropertyGUI\setRequired().

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

143  {
146  $lng = $this->lng;
147 
148  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
149  $form = new ilPropertyFormGUI();
150  $form->setFormAction($ilCtrl->getFormAction($this));
151  if ($a_insert) {
152  $form->setTitle($this->lng->txt("cont_insert_skills"));
153  } else {
154  $form->setTitle($this->lng->txt("cont_update_skills"));
155  }
156 
157  $options = array();
158  include_once "Services/Skill/classes/class.ilPersonalSkill.php";
159 
161  if ($skills) {
162  foreach ($skills as $skill) {
163  $options[$skill["skill_node_id"]] = $skill["title"];
164  }
165  asort($options);
166  } else {
167  ilUtil::sendFailure("cont_no_skills");
168  }
169  $obj = new ilSelectInputGUI($this->lng->txt("cont_pc_skills"), "skill_id");
170  $obj->setRequired(true);
171  $obj->setOptions($options);
172  $form->addItem($obj);
173 
174  if ($a_insert) {
175  $form->addCommandButton("create_skill", $this->lng->txt("select"));
176  $form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
177  } else {
178  $obj->setValue($this->content_obj->getSkillId());
179  $form->addCommandButton("update", $this->lng->txt("select"));
180  $form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
181  }
182 
183  return $form;
184  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setRequired($a_required)
Set Required.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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.

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

Referenced by create().

86  {
87  $tpl = $this->tpl;
88 
89  $this->displayValidationError();
90 
91  // template mode: get skills from global skill tree
92  if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
93  include_once "Services/Skill/classes/class.ilPersonalSkillExplorerGUI.php";
94  $exp = new ilPersonalSkillExplorerGUI($this, "insert", $this, "create", "skill_id");
95  if (!$exp->handleCommand()) {
96  $tpl->setContent($exp->getHTML());
97  }
98  }
99  // editor mode: use personal skills
100  else {
101  if (!$a_form) {
102  $a_form = $this->initForm(true);
103  }
104  $tpl->setContent($a_form->getHTML());
105  }
106  }
Explorer for selecting a personal skill.
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
initForm($a_insert=false)
Init skills form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCSkillsGUI::update ( )

Update blog.

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

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

225  {
226  // template mode: get skills from global skill tree
227  if ($this->getPageConfig()->getEnablePCType("PlaceHolder")) {
228  $data = (int) $_GET["skill_id"];
229  $valid = true;
230  }
231  // editor mode: use personal skills
232  else {
233  $form = $this->initForm();
234  if ($form->checkInput()) {
235  $data = $form->getInput("skill_id");
236  $valid = true;
237  }
238  }
239 
240  if ($valid) {
241  $this->content_obj->setData($data);
242  $this->updated = $this->pg_obj->update();
243  if ($this->updated === true) {
244  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
245  }
246  }
247 
248  $this->pg_obj->addHierIDs();
249  $form->setValuesByPost();
250  return $this->edit($form);
251  }
edit(ilPropertyFormGUI $a_form=null)
Edit skills form.
$_GET["client_id"]
$valid
getPageConfig()
Get Page Config.
if(isset($_POST['submit'])) $form
initForm($a_insert=false)
Init skills form.
+ 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: