74 bool $a_call_by_reference =
true,
75 bool $a_prepare_output =
true 79 $this->
ctrl = $DIC->ctrl();
80 $this->rbacsystem = $DIC->rbac()->system();
81 $this->error = $DIC[
"ilErr"];
82 $this->
access = $DIC->access();
83 $this->
tabs = $DIC->tabs();
84 $this->
lng = $DIC->language();
86 $this->tpl = $DIC[
"tpl"];
87 $this->
toolbar = $DIC->toolbar();
88 $this->
user = $DIC->user();
89 $this->ui_fac = $DIC->ui()->factory();
90 $this->ui_ren = $DIC->ui()->renderer();
91 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
92 $ilCtrl = $DIC->ctrl();
94 $this->tool_context = $DIC->globalScreen()->tool()->context();
99 $this->
lng->loadLanguageModule(
'skmg');
101 $ilCtrl->saveParameter($this,
"node_id");
102 $this->skill_manager = $DIC->skills()->internal()->manager();
103 $this->skill_tree_node_manager = $this->skill_manager->getTreeNodeManager($this->
object->getId());
104 $this->management_access_manager = $this->skill_manager->getManagementAccessManager($this->
object->getRefId());
106 $this->requested_node_id = $this->admin_gui_request->getNodeId();
107 $this->requested_tref_id = $this->admin_gui_request->getTrefId();
108 $this->requested_templates_tree = $this->admin_gui_request->getTemplatesTree();
109 $this->requested_skexpand = $this->admin_gui_request->getSkillExpand();
110 $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
111 $this->requested_titles = $this->admin_gui_request->getTitles();
112 $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
121 $next_class = $this->
ctrl->getNextClass($this);
122 $cmd = $this->
ctrl->getCmd();
124 if (!$this->management_access_manager->hasReadManagementPermission()) {
128 switch ($next_class) {
129 case "ilskilltreeadmingui":
131 $ilTabs->activateTab(
"skill_trees");
133 $this->
ctrl->forwardCommand($gui);
136 case 'ilpermissiongui':
138 $this->tabs_gui->activateTab(
'permissions');
140 $ret = $this->
ctrl->forwardCommand($perm_gui);
145 if (!$cmd || $cmd ==
'view') {
149 if ($cmd ==
"showTree") {
150 $this->
showTree((
bool) $this->requested_templates_tree);
164 if ($this->management_access_manager->hasReadManagementPermission()) {
165 $this->tabs_gui->addTab(
168 $this->
ctrl->getLinkTargetByClass(
"ilskilltreeadmingui",
"")
171 $this->tabs_gui->addTab(
174 $this->
ctrl->getLinkTarget($this,
"editSettings")
178 if ($this->management_access_manager->hasEditManagementPermissionsPermission()) {
179 $this->tabs_gui->addTab(
182 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
198 $check_enable = $this->ui_fac->input()->field()->checkbox(
$lng->
txt(
"skmg_enable_skmg"))
202 $check_hide_prof = $this->ui_fac->input()->field()->checkbox(
203 $lng->
txt(
"skmg_hide_profile_self_eval"),
204 $lng->
txt(
"skmg_hide_profile_self_eval_info")
205 )->
withValue($skmg_set->getHideProfileBeforeSelfEval());
208 $check_loc_ass_prof = $this->ui_fac->input()->field()->checkbox(
$lng->
txt(
"skmg_local_assignment_profiles"))
209 ->
withValue($skmg_set->getLocalAssignmentOfProfiles());
212 $check_create_loc_prof = $this->ui_fac->input()->field()->checkbox(
213 $lng->
txt(
"skmg_allow_local_profiles"),
214 $lng->
txt(
"skmg_allow_local_profiles_info")
215 )->
withValue($skmg_set->getAllowLocalProfiles());
218 $section_settings = $this->ui_fac->input()->field()->section(
219 [
"check_enable" => $check_enable,
220 "check_hide_prof" => $check_hide_prof,
221 "check_loc_ass_prof" => $check_loc_ass_prof,
222 "check_create_loc_prof" => $check_create_loc_prof],
227 $ilCtrl->setParameterByClass(
228 'ilobjskillmanagementgui',
230 'skill_settings_config' 233 $form = $this->ui_fac->input()->container()->form()->standard(
234 $ilCtrl->getFormAction($this,
"editSettings"),
235 [
"section_settings" => $section_settings]
238 if ($this->request->getMethod() ==
"POST" 239 && $this->request->getQueryParams()[
"skill_settings"] ==
"skill_settings_config") {
240 if (!$this->management_access_manager->hasEditManagementSettingsPermission()) {
244 $form = $form->withRequest($this->request);
245 $result = $form->getData();
247 $skmg_set->activate($result[
"section_settings"][
"check_enable"]);
248 $skmg_set->setHideProfileBeforeSelfEval($result[
"section_settings"][
"check_hide_prof"]);
249 $skmg_set->setLocalAssignmentOfProfiles($result[
"section_settings"][
"check_loc_ass_prof"]);
250 $skmg_set->setAllowLocalProfiles($result[
"section_settings"][
"check_create_loc_prof"]);
252 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
253 $ilCtrl->redirect($this,
"editSettings");
256 $this->tpl->setContent($this->ui_ren->render([$form]));
261 $this->
ctrl->clearParameterByClass(get_class($this),
"node_id");
262 $this->
ctrl->redirectByClass(
"ilskilltreeadmingui",
"listTrees");
270 if (!count($this->requested_titles) == 0) {
271 foreach ($this->requested_titles as
$id => $title) {
273 if (is_object($node_obj)) {
279 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
282 $ilCtrl->redirect($this,
"editSkills");
290 if (!count($this->requested_titles) == 0) {
291 foreach ($this->requested_titles as
$id => $title) {
293 if (is_object($node_obj)) {
299 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
302 $ilCtrl->redirect($this,
"editSkillTemplates");
305 public function expandAll(
bool $a_redirect =
true): void
307 $this->requested_skexpand =
"";
308 $n_id = ($this->requested_node_id > 0)
309 ? $this->requested_node_id
310 : $this->skill_tree->readRootId();
311 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
313 foreach ($stree as $n) {
314 $n_arr[] = $n[
"child"];
322 $this->requested_skexpand =
"";
323 $n_id = ($this->requested_node_id > 0)
324 ? $this->requested_node_id
325 : $this->skill_tree->readRootId();
326 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
328 foreach ($stree as $n) {
329 if (in_array($n[
"child"], $old) && $n[
"child"] != $n_id) {
330 $k = array_search($n[
"child"], $old);
346 if (empty($this->requested_node_ids)) {
347 $this->
ilias->raiseError($this->
lng->txt(
"no_checkbox"), $this->
ilias->error_obj->MESSAGE);
350 $ilTabs->clearTargets();
355 foreach ($this->requested_node_ids as
$id) {
357 if ($mode ==
"templates") {
358 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
367 $cskill_ids[] = array(
"skill_id" => $skill_id,
"tref_id" => $tref_id);
370 if ($mode ==
"basic") {
371 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
376 $cskill_ids[] = array(
"skill_id" => $id,
"tref_id" => $tref_id);
383 if ($mode ==
"basic" || $mode ==
"templates") {
385 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
386 if (count($usages) > 0) {
388 foreach ($usages as $k => $usage) {
390 $html .= $tab->getHTML() .
"<br/><br/>";
393 $ilCtrl->saveParameter($a_gui,
"tmpmode");
394 $ilToolbar->addButton(
396 $ilCtrl->getLinkTarget($a_gui,
"cancelDelete")
398 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"skmg_cannot_delete_nodes_in_use"));
402 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
410 $ilCtrl->setParameter($a_gui,
"tmpmode", $this->requested_tmpmode);
411 $a_form_action = $this->
ctrl->getFormAction($a_gui);
412 $confirmation_gui->setFormAction($a_form_action);
413 $confirmation_gui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
416 foreach ($this->requested_node_ids as $id) {
419 $confirmation_gui->addItem(
422 $node_obj->getTitle(),
428 $confirmation_gui->setCancel(
$lng->
txt(
"cancel"),
"cancelDelete");
429 $confirmation_gui->setConfirm(
$lng->
txt(
"confirm"),
"confirmedDelete");
436 $this->
ctrl->redirect($this,
"editSkills");
444 foreach ($this->requested_node_ids as
$id) {
447 $node_data = $this->skill_tree->getNodeData($id);
448 if (is_object($obj)) {
451 if ($this->skill_tree->isInTree($id)) {
452 $this->skill_tree->deleteTree($node_data);
458 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"info_deleted"),
true);
472 $ilTabs->activateTab(
"skill_templates");
473 $ilCtrl->
setParameterByClass(
"ilobjskillmanagementgui",
"node_id", $this->skill_tree->readRootId());
474 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
481 public function showTree(
bool $a_templates, $a_gui = null,
string $a_gui_cmd =
""): void
489 if ($this->requested_node_id == 0 || $this->requested_node_id == 1) {
493 if ($this->requested_node_id > 1) {
494 $path = $this->skill_tree->getPathId($this->requested_node_id);
501 $ilCtrl->setParameter($this,
"templates_tree", (
int) $a_templates);
510 if (!$exp->handleCommand()) {
static _lookupTemplateId(int $a_obj_id)
static get(string $a_var)
An entity that renders components to a string output.
__construct( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
Skill tree administration.
deleteNodes(object $a_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
showTree(bool $a_templates, $a_gui=null, string $a_gui_cmd="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Tree SkillTreeNodeManager $skill_tree_node_manager
prepareOutput(bool $show_sub_objects=true)
Request wrapper for guis in skill administration.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
saveAllTitles(bool $a_succ_mess=true)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
expandAll(bool $a_redirect=true)
SkillManagementAccess $management_access_manager
Explorer class that works on tree objects (Services/Tree)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupType(int $a_obj_id)
SkillInternalManagerService $skill_manager
static getInstance(int $a_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
saveAllTemplateTitles(bool $a_succ_mess=true)
static _lookupTrefIdsForTemplateId(int $a_tid)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
Skill internal manager service.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectGUI Basic methods of all Output classes.
header include for all ilias files.
TableGUI class for skill usages.
SkillAdminGUIRequest $admin_gui_request
activateTab(string $a_id)
array $requested_node_ids
int $requested_templates_tree
Error Handling & global info handling uses PEAR error class.
string $requested_skexpand
__construct(Container $dic, ilPlugin $plugin)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
collapseAll(bool $a_redirect=true)
Explorer class that works on tree objects (Services/Tree)
ContextServices $tool_context
static _writeTitle(int $a_obj_id, string $a_title)
static set(string $a_var, $a_val)
Set a value.
setLeftNavContent(string $a_content)
Sets content of left navigation column.
Skill management main GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...