ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBasicSkillGUI Class Reference

Basic skill GUI class. More...

+ Inheritance diagram for ilBasicSkillGUI:
+ Collaboration diagram for ilBasicSkillGUI:

Public Member Functions

 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 showProperties ()
 
 saveItem ()
 
 afterSave ()
 
 updateItem ()
 
 edit ()
 
 initForm (string $a_mode="edit")
 
 editProperties ()
 
 addLevel ()
 
 editLevel ()
 
 saveLevel ()
 
 updateLevel ()
 
 initLevelForm (string $a_mode="edit")
 
 updateLevelOrder ()
 
 confirmLevelDeletion ()
 
 deleteLevel ()
 
 setLevelHead ()
 
 setTabs (string $a_tab="levels")
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 showLevelResources ()
 
 addLevelResource ()
 
 saveLevelResource ()
 
 confirmLevelResourcesRemoval ()
 
 removeLevelResources ()
 
 saveResourceSettings ()
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct (Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
 
 isInUse ()
 
 setParentGUI (object $a_parentgui)
 
 getParentGUI ()
 
 readNodeObject (int $a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 
 deleteNodes ()
 Delete nodes in the hierarchy. More...
 
 cutItems ()
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems ()
 Copy items to clipboard. More...
 
 cancelDelete ()
 
 confirmedDelete ()
 confirmed delete More...
 
 setSkillNodeDescription ()
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 
 editProperties ()
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 
 initForm (string $a_mode="edit")
 
 cancelSave ()
 
 redirectToParent (bool $a_tmp_mode=false)
 Redirect to parent (identified by current node_id) More...
 
 saveOrder ()
 
 insertBasicSkillClip ()
 
 insertSkillCategoryClip ()
 
 insertTemplateReferenceClip ()
 
 insertSkillTemplateClip ()
 
 insertTemplateCategoryClip ()
 
 setTitleIcon ()
 
 addUsageTab (ilTabsGUI $a_tabs)
 
 showUsage ()
 
 addObjectsTab (ilTabsGUI $a_tabs)
 
 showObjects ()
 
 exportSelectedNodes ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
Factory $ui_fac
 
Renderer $ui_ren
 
ServerRequestInterface $request
 
int $tref_id = 0
 
int $requested_level_id = 0
 
int $requested_root_id = 0
 
array $requested_level_order = []
 
array $requested_level_ids = []
 
array $requested_resource_ids = []
 
array $requested_suggested = []
 
array $requested_trigger = []
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
ilCtrl $ctrl
 
ilLanguage $lng
 
ilLocatorGUI $locator
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilTree $tree
 
ilPropertyFormGUI $form
 
object $parentgui
 
int $tref_id = 0
 
Tree SkillTreeNodeManager $skill_tree_node_manager
 
SkillTreeAccess $tree_access_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_tree_id = 0
 
ilTabsGUI $tabs
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_ref_id = 0
 
int $requested_node_id = 0
 
string $requested_backcmd = ""
 
int $requested_tmpmode = 0
 
int $base_skill_id = 0
 
array $requested_node_ids = []
 
array $requested_node_order = []
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
object $node_object = null
 
bool $in_use = false
 
bool $use_checked = false
 
ilAccessHandler $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkillGUI::__construct ( Tree\SkillTreeNodeManager  $node_manager,
int  $a_node_id = 0 
)

Definition at line 73 of file class.ilBasicSkillGUI.php.

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

74  {
75  global $DIC;
76 
77  $this->ctrl = $DIC->ctrl();
78  $this->tpl = $DIC["tpl"];
79  $this->tabs = $DIC->tabs();
80  $this->help = $DIC["ilHelp"];
81  $this->toolbar = $DIC->toolbar();
82  $this->lng = $DIC->language();
83  $this->ui_fac = $DIC->ui()->factory();
84  $this->ui_ren = $DIC->ui()->renderer();
85  $this->request = $DIC->http()->request();
86  $ilCtrl = $DIC->ctrl();
87 
88  $ilCtrl->saveParameter($this, array("node_id", "level_id"));
89  $this->base_skill_id = $a_node_id;
90 
91  parent::__construct($node_manager, $a_node_id);
92 
93  $this->requested_level_id = $this->admin_gui_request->getLevelId();
94  $this->requested_root_id = $this->admin_gui_request->getRootId();
95  $this->requested_level_order = $this->admin_gui_request->getOrder();
96  $this->requested_level_ids = $this->admin_gui_request->getLevelIds();
97  $this->requested_resource_ids = $this->admin_gui_request->getResourceIds();
98  $this->requested_suggested = $this->admin_gui_request->getSuggested();
99  $this->requested_trigger = $this->admin_gui_request->getTrigger();
100  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addLevel()

ilBasicSkillGUI::addLevel ( )

Definition at line 264 of file class.ilBasicSkillGUI.php.

References ilSkillTreeNodeGUI\$form, $tpl, initLevelForm(), and ilGlobalTemplateInterface\setContent().

264  : void
265  {
266  $tpl = $this->tpl;
267 
268  $form = $this->initLevelForm("create");
269  $tpl->setContent($this->ui_ren->render([$form]));
270  }
initLevelForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ addLevelResource()

ilBasicSkillGUI::addLevelResource ( )

Definition at line 663 of file class.ilBasicSkillGUI.php.

References $tabs, $tpl, ilGlobalTemplateInterface\setContent(), and setLevelHead().

663  : void
664  {
665  $ilTabs = $this->tabs;
666  $tpl = $this->tpl;
667 
668  $this->setLevelHead();
669  $ilTabs->activateTab("level_resources");
670 
672  $this,
673  "addLevelResource",
674  $this,
675  "saveLevelResource",
676  "root_id",
677  "",
678  "rep_node_id"
679  );
680  if (!$exp->handleCommand()) {
681  $tpl->setContent($exp->getHTML());
682  }
683  }
Explorer for selecting repository items.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ afterSave()

ilBasicSkillGUI::afterSave ( )

Definition at line 149 of file class.ilBasicSkillGUI.php.

References $ctrl, and ilCtrl\setParameterByClass().

149  : void
150  {
151  $ilCtrl = $this->ctrl;
152 
153  $ilCtrl->setParameterByClass(
154  "ilbasicskillgui",
155  "node_id",
156  $this->node_object->getId()
157  );
158  $ilCtrl->redirectByClass("ilbasicskillgui", "edit");
159  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ confirmLevelDeletion()

ilBasicSkillGUI::confirmLevelDeletion ( )

Definition at line 428 of file class.ilBasicSkillGUI.php.

References $ctrl, $i, $lng, $tpl, getType(), ilBasicSkill\lookupLevelTitle(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

428  : void
429  {
430  $ilCtrl = $this->ctrl;
431  $tpl = $this->tpl;
432  $lng = $this->lng;
433 
434  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
435  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
436  return;
437  }
438 
439  $this->setTabs("levels");
440 
441  if (empty($this->requested_level_ids)) {
442  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
443  $ilCtrl->redirect($this, "edit");
444  } else {
445  $cgui = new ilConfirmationGUI();
446  $cgui->setFormAction($ilCtrl->getFormAction($this));
447  $cgui->setHeaderText($lng->txt("skmg_really_delete_levels"));
448  $cgui->setCancel($lng->txt("cancel"), "edit");
449  $cgui->setConfirm($lng->txt("delete"), "deleteLevel");
450 
451  foreach ($this->requested_level_ids as $i) {
452  $cgui->addItem("id[]", $i, ilBasicSkill::lookupLevelTitle($i));
453  }
454 
455  $tpl->setContent($cgui->getHTML());
456  }
457  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setTabs(string $a_tab="levels")
static lookupLevelTitle(int $a_id)
setContent(string $a_html)
Sets content for standard template.
$i
Definition: metadata.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmLevelResourcesRemoval()

ilBasicSkillGUI::confirmLevelResourcesRemoval ( )

Definition at line 708 of file class.ilBasicSkillGUI.php.

References $ctrl, $i, $lng, $tabs, $tpl, ilObject\_lookupObjId(), ilObject\_lookupTitle(), getType(), ilGlobalTemplateInterface\setContent(), setLevelHead(), and ilLanguage\txt().

708  : void
709  {
710  $ilCtrl = $this->ctrl;
711  $tpl = $this->tpl;
712  $lng = $this->lng;
713  $ilTabs = $this->tabs;
714 
715  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
716  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
717  return;
718  }
719 
720  $this->setLevelHead();
721  $ilTabs->activateTab("level_resources");
722 
723  if (empty($this->requested_resource_ids)) {
724  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
725  $ilCtrl->redirect($this, "showLevelResources");
726  } else {
727  $cgui = new ilConfirmationGUI();
728  $cgui->setFormAction($ilCtrl->getFormAction($this));
729  $cgui->setHeaderText($lng->txt("skmg_confirm_level_resources_removal"));
730  $cgui->setCancel($lng->txt("cancel"), "showLevelResources");
731  $cgui->setConfirm($lng->txt("remove"), "removeLevelResources");
732 
733  foreach ($this->requested_resource_ids as $i) {
735  $cgui->addItem("id[]", $i, $title);
736  }
737 
738  $tpl->setContent($cgui->getHTML());
739  }
740  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
$i
Definition: metadata.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteLevel()

ilBasicSkillGUI::deleteLevel ( )

Definition at line 459 of file class.ilBasicSkillGUI.php.

References $ctrl, $id, $lng, getType(), ilCtrl\redirect(), and ilLanguage\txt().

459  : void
460  {
461  $lng = $this->lng;
462  $ilCtrl = $this->ctrl;
463 
464  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
465  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
466  return;
467  }
468 
469  if (!empty($this->requested_level_ids)) {
470  foreach ($this->requested_level_ids as $id) {
471  $this->node_object->deleteLevel($id);
472  }
473  $this->node_object->fixLevelNumbering();
474  }
475  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
476  $ilCtrl->redirect($this, "edit");
477  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ edit()

ilBasicSkillGUI::edit ( )

Definition at line 175 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, $toolbar, $tpl, ilSkillTreeNodeGUI\isInUse(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

175  : void
176  {
177  $tpl = $this->tpl;
178  $ilToolbar = $this->toolbar;
179  $lng = $this->lng;
180  $ilCtrl = $this->ctrl;
181 
182  $this->setTabs("levels");
183 
184  if ($this->isInUse()) {
185  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
186  } elseif ($this->tree_access_manager->hasManageCompetencesPermission()) {
187  $ilToolbar->addButton(
188  $lng->txt("skmg_add_level"),
189  $ilCtrl->getLinkTarget($this, "addLevel")
190  );
191  }
192 
193  $table = new ilSkillLevelTableGUI(
194  $this->base_skill_id,
195  $this,
196  "edit",
197  0,
198  $this->isInUse(),
199  $this->tree_access_manager->hasManageCompetencesPermission()
200  );
201  $tpl->setContent($table->getHTML());
202  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setTabs(string $a_tab="levels")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ editLevel()

ilBasicSkillGUI::editLevel ( )

Definition at line 272 of file class.ilBasicSkillGUI.php.

References ilSkillTreeNodeGUI\$form, $lng, $tpl, getType(), initLevelForm(), ilSkillTreeNodeGUI\isInUse(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

272  : void
273  {
274  $tpl = $this->tpl;
275  $lng = $this->lng;
276 
277  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
278  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
279  return;
280  }
281 
282  if ($this->isInUse()) {
283  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_skill_in_use"));
284  }
285 
286  $form = $this->initLevelForm();
287  $tpl->setContent($this->ui_ren->render([$form]));
288  }
initLevelForm(string $a_mode="edit")
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ editProperties()

ilBasicSkillGUI::editProperties ( )

Definition at line 251 of file class.ilBasicSkillGUI.php.

References setTabs().

251  : void
252  {
253  $this->setTabs("properties");
254  parent::editProperties();
255  }
setTabs(string $a_tab="levels")
+ Here is the call graph for this function:

◆ executeCommand()

ilBasicSkillGUI::executeCommand ( )

Definition at line 107 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, and $tabs.

107  : void
108  {
109  $ilCtrl = $this->ctrl;
110  $ilTabs = $this->tabs;
111  $lng = $this->lng;
112 
113  //$tpl->getStandardTemplate();
114 
115  $next_class = $ilCtrl->getNextClass($this);
116  $cmd = $ilCtrl->getCmd();
117  switch ($next_class) {
118  default:
119  $ret = $this->$cmd();
120  break;
121  }
122  }

◆ getType()

ilBasicSkillGUI::getType ( )

Definition at line 102 of file class.ilBasicSkillGUI.php.

Referenced by confirmLevelDeletion(), confirmLevelResourcesRemoval(), deleteLevel(), editLevel(), removeLevelResources(), saveLevel(), saveLevelResource(), showLevelResources(), updateItem(), updateLevel(), and updateLevelOrder().

102  : string
103  {
104  return "skll";
105  }
+ Here is the caller graph for this function:

◆ initForm()

ilBasicSkillGUI::initForm ( string  $a_mode = "edit")

Definition at line 204 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, ilSkillTreeNodeGUI\addStatusInput(), ILIAS\Repository\form(), ilFormPropertyGUI\setInfo(), ilTextAreaInputGUI\setRows(), and ilLanguage\txt().

204  : void
205  {
206  $lng = $this->lng;
207  $ilCtrl = $this->ctrl;
208 
209  $this->form = new ilPropertyFormGUI();
210 
211  // title
212  $ti = new ilTextInputGUI($lng->txt("title"), "title");
213  $ti->setMaxLength(200);
214  $ti->setSize(50);
215  $ti->setRequired(true);
216  $this->form->addItem($ti);
217 
218  // description
219  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
220  $ta->setRows(5);
221  $this->form->addItem($ta);
222 
223  // status
224  $this->addStatusInput($this->form);
225 
226  // selectable
227  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "self_eval");
228  $cb->setInfo($lng->txt("skmg_selectable_info"));
229  $this->form->addItem($cb);
230 
231  // save and cancel commands
232  if ($this->tree_access_manager->hasManageCompetencesPermission()) {
233  if ($a_mode == "create") {
234  $this->form->addCommandButton("save", $lng->txt("save"));
235  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
236  $this->form->setTitle($lng->txt("skmg_create_skll"));
237  } else {
238  $this->form->addCommandButton("update", $lng->txt("save"));
239  $this->form->setTitle($lng->txt("skmg_edit_skll"));
240  }
241  } else {
242  foreach ($this->form->getItems() as $item) {
243  $item->setDisabled(true);
244  }
245  }
246 
247  $ilCtrl->setParameter($this, "node_id", $this->requested_node_id);
248  $this->form->setFormAction($ilCtrl->getFormAction($this));
249  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a checkbox property in a property form.
form( $class_path, string $cmd)
This class represents a text area property in a property form.
addStatusInput(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:

◆ initLevelForm()

ilBasicSkillGUI::initLevelForm ( string  $a_mode = "edit")

Definition at line 363 of file class.ilBasicSkillGUI.php.

References $ctrl, $data, ilSkillTreeNodeGUI\$form, $lng, $tabs, setLevelHead(), and ilLanguage\txt().

Referenced by addLevel(), editLevel(), saveLevel(), and updateLevel().

363  : Form
364  {
365  $lng = $this->lng;
366  $ilCtrl = $this->ctrl;
367  $ilTabs = $this->tabs;
368 
369  $ilCtrl->saveParameter($this, "level_id");
370  $this->setLevelHead();
371  $ilTabs->activateTab("level_settings");
372 
373  $input_ti = $this->ui_fac->input()->field()->text($lng->txt("title"))
374  ->withRequired(true);
375 
376  $input_desc = $this->ui_fac->input()->field()->textarea($lng->txt("description"));
377 
378  $ilCtrl->setParameter(
379  $this,
380  'level_settings',
381  'level_settings_config'
382  );
383 
384  if ($a_mode == "create") {
385  $section_level = $this->ui_fac->input()->field()->section(
386  ["input_ti" => $input_ti,
387  "input_desc" => $input_desc],
388  $lng->txt("skmg_new_level")
389  );
390  $form_action = $ilCtrl->getFormAction($this, "saveLevel");
391  } else {
392  $data = $this->node_object->getLevelData($this->requested_level_id);
393  $input_ti = $input_ti->withValue($data["title"]);
394  $input_desc = $input_desc->withValue($data["description"]);
395 
396  $section_level = $this->ui_fac->input()->field()->section(
397  ["input_ti" => $input_ti,
398  "input_desc" => $input_desc],
399  $lng->txt("skmg_edit_level")
400  );
401  $form_action = $ilCtrl->getFormAction($this, "updateLevel");
402  }
403 
404  $form = $this->ui_fac->input()->container()->form()->standard(
405  $form_action,
406  ["section_level" => $section_level]
407  );
408 
409  return $form;
410  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToParent()

ilBasicSkillGUI::redirectToParent ( bool  $a_tmp_mode = false)

Redirect to parent (identified by current node_id)

Definition at line 609 of file class.ilBasicSkillGUI.php.

References $ctrl, and ilSkillTreeNode\_lookupType().

609  : void
610  {
611  $ilCtrl = $this->ctrl;
612 
613  $t = ilSkillTreeNode::_lookupType($this->requested_node_id);
614 
615  switch ($t) {
616  case "skrt":
617  $ilCtrl->setParameterByClass("ilskillrootgui", "node_id", $this->requested_node_id);
618  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
619  break;
620  }
621 
622  parent::redirectToParent();
623  }
static _lookupType(int $a_obj_id)
+ Here is the call graph for this function:

◆ removeLevelResources()

ilBasicSkillGUI::removeLevelResources ( )

Definition at line 742 of file class.ilBasicSkillGUI.php.

References $ctrl, $i, $lng, getType(), and ilLanguage\txt().

742  : void
743  {
744  $ilCtrl = $this->ctrl;
745  $lng = $this->lng;
746 
747  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
748  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
749  return;
750  }
751 
752  if (!empty($this->requested_resource_ids)) {
753  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
754  foreach ($this->requested_resource_ids as $i) {
755  $sres->setResourceAsImparting($this->requested_level_id, $i, false);
756  $sres->setResourceAsTrigger($this->requested_level_id, $i, false);
757  }
758  $sres->save();
759  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
760  }
761 
762  $ilCtrl->redirect($this, "showLevelResources");
763  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ saveItem()

ilBasicSkillGUI::saveItem ( )

Definition at line 133 of file class.ilBasicSkillGUI.php.

References ILIAS\Repository\form(), and ilTree\POS_LAST_NODE.

133  : void
134  {
135  if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
136  return;
137  }
138 
139  $it = new ilBasicSkill();
140  $it->setTitle($this->form->getInput("title"));
141  $it->setDescription($this->form->getInput("description"));
142  $it->setStatus($this->form->getInput("status"));
143  $it->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
144  $it->create();
145  $this->skill_tree_node_manager->putIntoTree($it, $this->requested_node_id, ilTree::POS_LAST_NODE);
146  $this->node_object = $it;
147  }
form( $class_path, string $cmd)
const POS_LAST_NODE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveLevel()

ilBasicSkillGUI::saveLevel ( )

Definition at line 290 of file class.ilBasicSkillGUI.php.

References $ctrl, ilSkillTreeNodeGUI\$form, $lng, $tpl, getType(), initLevelForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

290  : void
291  {
292  $tpl = $this->tpl;
293  $lng = $this->lng;
294  $ilCtrl = $this->ctrl;
295 
296  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
297  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
298  return;
299  }
300 
301  $form = $this->initLevelForm("create");
302  if ($this->request->getMethod() == "POST"
303  && $this->request->getQueryParams()["level_settings"] == "level_settings_config") {
304  $form = $form->withRequest($this->request);
305  $result = $form->getData();
306 
307  if (is_null($result)) {
308  $tpl->setContent($this->ui_ren->render($form));
309  return;
310  }
311 
312  $this->node_object->addLevel(
313  $result["section_level"]["input_ti"],
314  $result["section_level"]["input_desc"]
315  );
316 
317  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
318  $ilCtrl->redirect($this, "edit");
319  }
320 
321  $tpl->setContent($this->ui_ren->render([$form]));
322  }
initLevelForm(string $a_mode="edit")
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ saveLevelResource()

ilBasicSkillGUI::saveLevelResource ( )

Definition at line 685 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, $ref_id, $requested_root_id, getType(), and ilLanguage\txt().

685  : void
686  {
687  $ilCtrl = $this->ctrl;
688  $lng = $this->lng;
689 
691  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
692  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
693  return;
694  }
695 
696  if ($ref_id > 0) {
697  $sres = new ilSkillResources($this->base_skill_id, $this->tref_id);
698  $sres->setResourceAsImparting($this->requested_level_id, $ref_id);
699  $sres->setResourceAsTrigger($this->requested_level_id, $ref_id, false);
700  $sres->save();
701 
702  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
703  }
704 
705  $ilCtrl->redirect($this, "showLevelResources");
706  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$ref_id
Definition: ltiauth.php:67
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveResourceSettings()

ilBasicSkillGUI::saveResourceSettings ( )

Definition at line 765 of file class.ilBasicSkillGUI.php.

References $ctrl, and $resources.

765  : void
766  {
767  $ilCtrl = $this->ctrl;
768 
769  $resources = new ilSkillResources($this->base_skill_id, $this->tref_id);
770 
771  foreach ($resources->getResourcesOfLevel($this->requested_level_id) as $r) {
772  $imparting = false;
773  if (!empty($this->requested_suggested)
774  && isset($this->requested_suggested[$r["rep_ref_id"]])
775  && $this->requested_suggested[$r["rep_ref_id"]]
776  ) {
777  $imparting = true;
778  }
779  $trigger = false;
780  if (!empty($this->requested_trigger)
781  && isset($this->requested_trigger[$r["rep_ref_id"]])
782  && $this->requested_trigger[$r["rep_ref_id"]]
783  ) {
784  $trigger = true;
785  }
786  $resources->setResourceAsImparting($this->requested_level_id, $r["rep_ref_id"], $imparting);
787  $resources->setResourceAsTrigger($this->requested_level_id, $r["rep_ref_id"], $trigger);
788  }
789  $resources->save();
790 
791  $ilCtrl->redirect($this, "showLevelResources");
792  }
$resources
Definition: ltiservices.php:68
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setLevelHead()

ilBasicSkillGUI::setLevelHead ( )

Definition at line 479 of file class.ilBasicSkillGUI.php.

References $ctrl, $help, $lng, $tabs, $tpl, ilBasicSkill\lookupLevelTitle(), ilGlobalTemplateInterface\setDescription(), ilHelpGUI\setScreenIdComponent(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

Referenced by addLevelResource(), confirmLevelResourcesRemoval(), initLevelForm(), and showLevelResources().

479  : void
480  {
481  $ilTabs = $this->tabs;
482  $ilCtrl = $this->ctrl;
483  $tpl = $this->tpl;
484  $lng = $this->lng;
485  $ilHelp = $this->help;
486 
487  // tabs
488  $ilTabs->clearTargets();
489  $ilHelp->setScreenIdComponent("skmg_lev");
490 
491  $ilTabs->setBackTarget(
492  $lng->txt("back"),
493  $ilCtrl->getLinkTarget($this, "edit")
494  );
495 
496  if ($this->requested_level_id > 0) {
497  $ilTabs->addTab(
498  "level_settings",
499  $lng->txt("settings"),
500  $ilCtrl->getLinkTarget($this, "editLevel")
501  );
502 
503  $ilTabs->addTab(
504  "level_resources",
505  $lng->txt("skmg_resources"),
506  $ilCtrl->getLinkTarget($this, "showLevelResources")
507  );
508  }
509 
510  // title
511  if ($this->requested_level_id > 0) {
512  $tpl->setTitle($lng->txt("skmg_skill_level") . ": " .
513  ilBasicSkill::lookupLevelTitle($this->requested_level_id));
514  } else {
515  $tpl->setTitle($lng->txt("skmg_skill_level"));
516  }
517 
518  $desc = $this->skill_tree_node_manager->getWrittenPath($this->node_object->getId());
519  $tpl->setDescription($desc);
520  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
static lookupLevelTitle(int $a_id)
setScreenIdComponent(string $a_comp)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilBasicSkillGUI::setTabs ( string  $a_tab = "levels")

Definition at line 522 of file class.ilBasicSkillGUI.php.

References $ctrl, $help, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\addObjectsTab(), ilSkillTreeNodeGUI\addUsageTab(), ilGlobalTemplateInterface\setDescription(), ilHelpGUI\setScreenIdComponent(), ilSkillTreeNodeGUI\setSkillNodeDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

Referenced by confirmLevelDeletion(), edit(), editProperties(), and showProperties().

522  : void
523  {
524  $ilTabs = $this->tabs;
525  $ilCtrl = $this->ctrl;
526  $tpl = $this->tpl;
527  $lng = $this->lng;
528  $ilHelp = $this->help;
529 
530  $ilTabs->clearTargets();
531  $ilHelp->setScreenIdComponent("skmg_skll");
532  // $ilTabs->setBackTarget($lng->txt("skmg_skill_hierarchie"),
533  // $ilCtrl->getLinkTargetByClass("ilobjskillmanagementgui", "editSkills"));
534 
535  if (is_object($this->node_object)) {
536 
537  // levels
538  $ilTabs->addTab(
539  "levels",
540  $lng->txt("skmg_skill_levels"),
541  $ilCtrl->getLinkTarget($this, 'edit')
542  );
543 
544  // properties
545  $ilTabs->addTab(
546  "properties",
547  $lng->txt("settings"),
548  $ilCtrl->getLinkTarget($this, 'editProperties')
549  );
550 
551  // usage
552  $this->addUsageTab($ilTabs);
553 
554  // assigned objects
555  $this->addObjectsTab($ilTabs);
556 
557  $parent_node_id = $this->tree_repo->getParentNodeIdForNodeId($this->requested_node_id);
558  $parent_title = ilSkillTreeNode::_lookupTitle($parent_node_id);
559  $parent_type = ilSkillTreeNode::_lookupType($parent_node_id);
560 
561  if ($parent_type === "scat") {
562  $ilCtrl->setParameterByClass(
563  "ilskillcategorygui",
564  "node_id",
565  $parent_node_id
566  );
567  $ilTabs->setBackTarget(
568  $parent_title,
569  $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "listItems")
570  );
571  $ilCtrl->setParameterByClass(
572  "ilskillcategorygui",
573  "node_id",
574  ""
575  );
576  } else {
577  $ilCtrl->setParameterByClass(
578  "ilskillrootgui",
579  "node_id",
580  $this->skill_tree_node_manager->getRootId()
581  );
582  $ilTabs->setBackTarget(
583  $lng->txt("skmg_skills"),
584  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills")
585  );
586  $ilCtrl->setParameterByClass(
587  "ilskillrootgui",
588  "node_id",
589  $this->requested_node_id
590  );
591  }
592 
593  $ilTabs->activateTab($a_tab);
594 
595  $tpl->setTitle($lng->txt("skmg_skill") . ": " .
596  $this->node_object->getTitle());
597 
598  $this->setSkillNodeDescription();
599  } else {
600  $tpl->setTitle($lng->txt("skmg_skill"));
601  $tpl->setDescription("");
602  }
603  parent::setTitleIcon();
604  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addUsageTab(ilTabsGUI $a_tabs)
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupType(int $a_obj_id)
setScreenIdComponent(string $a_comp)
addObjectsTab(ilTabsGUI $a_tabs)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLevelResources()

ilBasicSkillGUI::showLevelResources ( )

Definition at line 630 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, $tabs, $toolbar, $tpl, getType(), ilGlobalTemplateInterface\setContent(), setLevelHead(), and ilLanguage\txt().

630  : void
631  {
632  $tpl = $this->tpl;
633  $ilTabs = $this->tabs;
634  $ilToolbar = $this->toolbar;
635  $lng = $this->lng;
636  $ilCtrl = $this->ctrl;
637 
638  if ($this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
639  || $this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
640  $ilToolbar->addButton(
641  $lng->txt("skmg_add_resource"),
642  $ilCtrl->getLinkTarget($this, "addLevelResource")
643  );
644  } else {
645  return;
646  }
647 
648  $this->setLevelHead();
649  $ilTabs->activateTab("level_resources");
650 
652  $this,
653  "showLevelResources",
654  $this->base_skill_id,
655  $this->tref_id,
656  $this->requested_level_id,
657  $this->tree_access_manager->hasManageCompetencesPermission()
658  );
659 
660  $tpl->setContent($tab->getHTML());
661  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ showProperties()

ilBasicSkillGUI::showProperties ( )

Definition at line 124 of file class.ilBasicSkillGUI.php.

References $tpl, ilGlobalTemplateInterface\setContent(), and setTabs().

124  : void
125  {
126  $tpl = $this->tpl;
127 
128  $this->setTabs();
129 
130  $tpl->setContent("Properties");
131  }
ilGlobalTemplateInterface $tpl
setTabs(string $a_tab="levels")
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ updateItem()

ilBasicSkillGUI::updateItem ( )

Definition at line 161 of file class.ilBasicSkillGUI.php.

References ILIAS\Repository\form(), and getType().

161  : void
162  {
163  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
164  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
165  return;
166  }
167 
168  $this->node_object->setTitle($this->form->getInput("title"));
169  $this->node_object->setDescription($this->form->getInput("description"));
170  $this->node_object->setSelfEvaluation((bool) $this->form->getInput("self_eval"));
171  $this->node_object->setStatus($this->form->getInput("status"));
172  $this->node_object->update();
173  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ updateLevel()

ilBasicSkillGUI::updateLevel ( )

Definition at line 324 of file class.ilBasicSkillGUI.php.

References $ctrl, ilSkillTreeNodeGUI\$form, $lng, $tpl, getType(), initLevelForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

324  : void
325  {
326  $lng = $this->lng;
327  $ilCtrl = $this->ctrl;
328  $tpl = $this->tpl;
329 
330  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
331  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
332  return;
333  }
334 
335  $form = $this->initLevelForm("edit");
336  if ($this->request->getMethod() == "POST"
337  && $this->request->getQueryParams()["level_settings"] == "level_settings_config") {
338  $form = $form->withRequest($this->request);
339  $result = $form->getData();
340 
341  if (is_null($result)) {
342  $tpl->setContent($this->ui_ren->render($form));
343  return;
344  }
345 
346  $this->node_object->writeLevelTitle(
347  $this->requested_level_id,
348  $result["section_level"]["input_ti"]
349  );
350 
351  $this->node_object->writeLevelDescription(
352  $this->requested_level_id,
353  $result["section_level"]["input_desc"]
354  );
355 
356  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
357  $ilCtrl->redirect($this, "edit");
358  }
359 
360  $tpl->setContent($this->ui_ren->render([$form]));
361  }
initLevelForm(string $a_mode="edit")
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ updateLevelOrder()

ilBasicSkillGUI::updateLevelOrder ( )

Definition at line 412 of file class.ilBasicSkillGUI.php.

References $ctrl, $lng, getType(), ilArrayUtil\stripSlashesArray(), and ilLanguage\txt().

412  : void
413  {
414  $lng = $this->lng;
415  $ilCtrl = $this->ctrl;
416 
417  if (!$this->tree_access_manager->hasManageCompetencesPermission() && $this->getType() == "skll"
418  || !$this->tree_access_manager->hasManageCompetenceTemplatesPermission() && $this->getType() == "sktp") {
419  return;
420  }
421 
422  $order = ilArrayUtil::stripSlashesArray($this->requested_level_order);
423  $this->node_object->updateLevelOrder($order);
424  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
425  $ilCtrl->redirect($this, "edit");
426  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

◆ $help

ilHelpGUI ilBasicSkillGUI::$help
protected

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

Referenced by setLevelHead(), and setTabs().

◆ $lng

◆ $request

ServerRequestInterface ilBasicSkillGUI::$request
protected

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

◆ $requested_level_id

int ilBasicSkillGUI::$requested_level_id = 0
protected

Definition at line 45 of file class.ilBasicSkillGUI.php.

◆ $requested_level_ids

array ilBasicSkillGUI::$requested_level_ids = []
protected

Definition at line 56 of file class.ilBasicSkillGUI.php.

◆ $requested_level_order

array ilBasicSkillGUI::$requested_level_order = []
protected

Definition at line 51 of file class.ilBasicSkillGUI.php.

◆ $requested_resource_ids

array ilBasicSkillGUI::$requested_resource_ids = []
protected

Definition at line 61 of file class.ilBasicSkillGUI.php.

◆ $requested_root_id

int ilBasicSkillGUI::$requested_root_id = 0
protected

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

Referenced by saveLevelResource().

◆ $requested_suggested

array ilBasicSkillGUI::$requested_suggested = []
protected

Definition at line 66 of file class.ilBasicSkillGUI.php.

◆ $requested_trigger

array ilBasicSkillGUI::$requested_trigger = []
protected

Definition at line 71 of file class.ilBasicSkillGUI.php.

◆ $tabs

◆ $toolbar

ilToolbarGUI ilBasicSkillGUI::$toolbar
protected

Definition at line 38 of file class.ilBasicSkillGUI.php.

Referenced by edit(), and showLevelResources().

◆ $tpl

◆ $tref_id

int ilBasicSkillGUI::$tref_id = 0
protected

Definition at line 44 of file class.ilBasicSkillGUI.php.

◆ $ui_fac

Factory ilBasicSkillGUI::$ui_fac
protected

Definition at line 40 of file class.ilBasicSkillGUI.php.

◆ $ui_ren

Renderer ilBasicSkillGUI::$ui_ren
protected

Definition at line 41 of file class.ilBasicSkillGUI.php.


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