ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjRepositorySettingsGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
15{
19 protected $error;
20
24 protected $rbacsystem;
25
26 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
27 {
28 global $DIC;
29
30 $this->error = $DIC["ilErr"];
31 $this->access = $DIC->access();
32 $this->rbacsystem = $DIC->rbac()->system();
33 $this->settings = $DIC->settings();
34 $this->ctrl = $DIC->ctrl();
35 $this->lng = $DIC->language();
36 $this->toolbar = $DIC->toolbar();
37 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
38
39 $this->type = 'reps';
40 $this->lng->loadLanguageModule('rep');
41 $this->lng->loadLanguageModule('cmps');
42 }
43
44 public function executeCommand()
45 {
47 $ilAccess = $this->access;
48
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
51
52 $this->prepareOutput();
53
54 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
55 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
56 }
57
58 switch ($next_class) {
59 case 'ilpermissiongui':
60 $this->tabs_gui->setTabActive('perm_settings');
61 $perm_gui = new ilPermissionGUI($this);
62 $this->ctrl->forwardCommand($perm_gui);
63 break;
64
65 default:
66 $this->$cmd();
67 break;
68 }
69 return true;
70 }
71
72 public function getAdminTabs()
73 {
75
76 $this->tabs_gui->addTab(
77 "settings",
78 $this->lng->txt("settings"),
79 $this->ctrl->getLinkTarget($this, "view")
80 );
81
82 $this->tabs_gui->addTab(
83 "icons",
84 $this->lng->txt("rep_custom_icons"),
85 $this->ctrl->getLinkTarget($this, "customIcons")
86 );
87
88 $this->tabs_gui->addTab(
89 "modules",
90 $this->lng->txt("cmps_repository_object_types"),
91 $this->ctrl->getLinkTarget($this, "listModules")
92 );
93
94 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
95 $this->tabs_gui->addTab(
96 "perm_settings",
97 $this->lng->txt("perm_settings"),
98 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
99 );
100 }
101 }
102
103 public function view(ilPropertyFormGUI $a_form = null)
104 {
105 $this->tabs_gui->activateTab("settings");
106
107 if (!$a_form) {
108 $a_form = $this->initSettingsForm();
109 }
110
111 $this->tpl->setContent($a_form->getHTML());
112 }
113
114 protected function initSettingsForm()
115 {
117 $ilAccess = $this->access;
118
119 $form = new ilPropertyFormGUI();
120 $form->setTitle($this->lng->txt("settings"));
121 $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
122
123 // default repository view
124 $options = array(
125 "flat" => $this->lng->txt("flatview"),
126 "tree" => $this->lng->txt("treeview")
127 );
128 $si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
129 $si->setOptions($options);
130 $si->setInfo($this->lng->txt(""));
131 if ($ilSetting->get("default_repository_view") == "tree") {
132 $si->setValue("tree");
133 } else {
134 $si->setValue("flat");
135 }
136 $form->addItem($si);
137
138 //
139 $options = array(
140 "" => $this->lng->txt("adm_rep_tree_only_container"),
141 "tree" => $this->lng->txt("adm_all_resource_types")
142 );
143
144 // repository tree
145 $radg = new ilRadioGroupInputGUI($this->lng->txt("adm_rep_tree_presentation"), "tree_pres");
146 $radg->setValue($ilSetting->get("repository_tree_pres"));
147 $op1 = new ilRadioOption(
148 $this->lng->txt("adm_rep_tree_only_cntr"),
149 "",
150 $this->lng->txt("adm_rep_tree_only_cntr_info")
151 );
152 $radg->addOption($op1);
153
154 $op2 = new ilRadioOption(
155 $this->lng->txt("adm_rep_tree_all_types"),
156 "all_types",
157 $this->lng->txt("adm_rep_tree_all_types_info")
158 );
159
160 // limit tree in courses and groups
161 $cb = new ilCheckboxInputGUI($this->lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
162 $cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
163 $cb->setInfo($this->lng->txt("adm_rep_tree_limit_grp_crs_info"));
164 $op2->addSubItem($cb);
165
166 $radg->addOption($op2);
167
168 $form->addItem($radg);
169
170 // limit items in tree
171 $tree_limit = new ilCheckboxInputGUI($this->lng->txt("rep_tree_limit"), "rep_tree_limit");
172 $tree_limit->setChecked($ilSetting->get("rep_tree_limit_number") > 0);
173 $tree_limit->setInfo($this->lng->txt("rep_tree_limit_info"));
174 $form->addItem($tree_limit);
175
176 // limit items in tree (number)
177 $tree_limit_number = new ilNumberInputGUI($this->lng->txt("rep_tree_limit_number"), "rep_tree_limit_number");
178 $tree_limit_number->setMaxLength(3);
179 $tree_limit_number->setSize(3);
180 $tree_limit_number->setValue($ilSetting->get("rep_tree_limit_number"));
181 $tree_limit_number->setInfo($this->lng->txt("rep_tree_limit_number_info"));
182 $tree_limit->addSubItem($tree_limit_number);
183
184 // breadcrumbs start with courses
185 $cb = new ilCheckboxInputGUI($this->lng->txt("rep_breadcr_crs"), "rep_breadcr_crs");
186 $cb->setChecked((int) $ilSetting->get("rep_breadcr_crs"));
187 $form->addItem($cb);
188
189 $radg = new ilRadioGroupInputGUI($this->lng->txt("rep_breadcr_crs"), "rep_breadcr_crs_overwrite");
190 $radg->setValue((int) $ilSetting->get("rep_breadcr_crs_overwrite"));
191
192 $op0 = new ilRadioOption($this->lng->txt("rep_breadcr_crs_overwrite"), 1);
193 $cb0 = new ilCheckboxInputGUI($this->lng->txt("rep_default"), "rep_breadcr_crs_default");
194 $cb0->setChecked((int) $ilSetting->get("rep_breadcr_crs_default"));
195 $op0->addSubItem($cb0);
196 $radg->addOption($op0);
197
198 $op1 = new ilRadioOption($this->lng->txt("rep_breadcr_crs_overwrite_not"), 0);
199 $radg->addOption($op1);
200
201
202 $cb->addSubItem($radg);
203
204
205
206 // trash
207 $cb = new ilCheckboxInputGUI($this->lng->txt("enable_trash"), "enable_trash");
208 $cb->setInfo($this->lng->txt("enable_trash_info"));
209 if ($ilSetting->get("enable_trash")) {
210 $cb->setChecked(true);
211 }
212 $form->addItem($cb);
213
214 // change event
215 $this->lng->loadLanguageModule("trac");
216 $event = new ilCheckboxInputGUI($this->lng->txt('trac_show_repository_views'), 'change_event_tracking');
217 $event->setInfo($this->lng->txt("trac_show_repository_views_info"));
218 $event->setChecked(ilChangeEvent::_isActive());
219 $form->addItem($event);
220
221
224 $form,
225 $this
226 );
227
228 // export limitations
229 $limiter = new ilExportLimitation();
230 $exp_limit = new ilRadioGroupInputGUI($this->lng->txt("rep_export_limitation"), "rep_export_limitation");
231 $exp_limit->setValue($limiter->getLimitationMode());
232 $exp_limit->setInfo($this->lng->txt("rep_export_limitation_info"));
233
234 $op_disabled = new ilRadioOption(
235 $this->lng->txt("rep_export_limitation_disabled"),
237 );
238 $exp_limit->addOption($op_disabled);
239
240 $op_limited = new ilRadioOption(
241 $this->lng->txt("rep_export_limitation_limited"),
243 );
244 $exp_limit->addOption($op_limited);
245
246 // limit items in tree (number)
247 $exp_limit_num = new ilNumberInputGUI($this->lng->txt("rep_export_limit_number"), "rep_export_limit_number");
248 $exp_limit_num->setMaxLength(6);
249 $exp_limit_num->setSize(6);
250 $exp_limit_num->setValue($ilSetting->get("rep_export_limit_number"));
251 $op_limited->addSubItem($exp_limit_num);
252
253 $form->addItem($exp_limit);
254
255 // object lists
256
257 $lists = new ilFormSectionHeaderGUI();
258 $lists->setTitle($this->lng->txt("rep_object_lists"));
259 $form->addItem($lists);
260
261 $sdesc = new ilCheckboxInputGUI($this->lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
262 $sdesc->setInfo($this->lng->txt("adm_rep_shorten_description_info"));
263 $sdesc->setChecked($ilSetting->get("rep_shorten_description"));
264 $form->addItem($sdesc);
265
266 $sdesclen = new ilNumberInputGUI($this->lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
267 $sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
268 $sdesclen->setSize(3);
269 $sdesc->addSubItem($sdesclen);
270
271 // load action commands asynchronously
272 $cb = new ilCheckboxInputGUI($this->lng->txt("adm_item_cmd_asynch"), "item_cmd_asynch");
273 $cb->setInfo($this->lng->txt("adm_item_cmd_asynch_info"));
274 $cb->setChecked($ilSetting->get("item_cmd_asynch"));
275 $form->addItem($cb);
276
277 // notes/comments/tagging
278 $pl = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists'), 'comments_tagging_in_lists');
279 $pl->setValue(1);
280 $pl->setChecked($ilSetting->get('comments_tagging_in_lists'));
281 $form->addItem($pl);
282
283 $pltags = new ilCheckboxInputGUI($this->lng->txt('adm_show_comments_tagging_in_lists_tags'), 'comments_tagging_in_lists_tags');
284 $pltags->setValue(1);
285 $pltags->setChecked($ilSetting->get('comments_tagging_in_lists_tags'));
286 $pl->addSubItem($pltags);
287
288 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
289 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
290 }
291
292 return $form;
293 }
294
295 public function saveSettings()
296 {
298 $ilAccess = $this->access;
299
300 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
301 $this->ctrl->redirect($this, "view");
302 }
303
304 $form = $this->initSettingsForm();
305 if ($form->checkInput()) {
306 $ilSetting->set("default_repository_view", $_POST["default_rep_view"]);
307
308 $ilSetting->set("repository_tree_pres", $_POST["tree_pres"]);
309 if ($_POST["tree_pres"] == "") {
310 $_POST["rep_tree_limit_grp_crs"] = "";
311 }
312 if ($_POST["rep_tree_limit_grp_crs"] && !$ilSetting->get("rep_tree_limit_grp_crs")) {
313 $_POST["rep_tree_synchronize"] = true;
314 } elseif (!$_POST["rep_tree_synchronize"] && $ilSetting->get("rep_tree_synchronize")) {
315 $_POST["rep_tree_limit_grp_crs"] = false;
316 }
317 $ilSetting->set("rep_tree_limit_grp_crs", $_POST["rep_tree_limit_grp_crs"]);
318
319 $ilSetting->set("rep_export_limitation", $_POST["rep_export_limitation"]);
320 $ilSetting->set("rep_export_limit_number", $_POST["rep_export_limit_number"]);
321
322 // $ilSetting->set('rep_cache',(int) $_POST['rep_cache']);
323 // $ilSetting->set("rep_tree_synchronize", $_POST["rep_tree_synchronize"]);
324
325 $ilSetting->set("enable_trash", $_POST["enable_trash"]);
326
327
328 $ilSetting->set("rep_breadcr_crs_overwrite", (int) $_POST["rep_breadcr_crs_overwrite"]);
329 $ilSetting->set("rep_breadcr_crs", (int) $_POST["rep_breadcr_crs"]);
330 $ilSetting->set("rep_breadcr_crs_default", (int) $_POST["rep_breadcr_crs_default"]);
331
332
333 $ilSetting->set("rep_shorten_description", $form->getInput('rep_shorten_description'));
334 $ilSetting->set("rep_shorten_description_length", (int) $form->getInput('rep_shorten_description_length'));
335 $ilSetting->set('item_cmd_asynch', (int) $_POST['item_cmd_asynch']);
336 $ilSetting->set('comments_tagging_in_lists', (int) $_POST['comments_tagging_in_lists']);
337 $ilSetting->set('comments_tagging_in_lists_tags', (int) $_POST['comments_tagging_in_lists_tags']);
338
339 // repository tree limit of children
340 $limit_number = ($_POST['rep_tree_limit'] && $_POST['rep_tree_limit_number'] > 0)
341 ? (int) $_POST['rep_tree_limit_number']
342 : 0;
343 $ilSetting->set('rep_tree_limit_number', $limit_number);
344
345 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
346 if ($form->getInput('change_event_tracking')) {
348 } else {
350 }
351
352 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
353 $this->ctrl->redirect($this, "view");
354 }
355
356 $form->setValuesByPost();
357 $this->view($form);
358 }
359
360 public function customIcons(ilPropertyFormGUI $a_form = null)
361 {
362 $this->tabs_gui->activateTab("icons");
363
364 if (!$a_form) {
365 $a_form = $this->initCustomIconsForm();
366 }
367
368 $this->tpl->setContent($a_form->getHTML());
369 }
370
371 protected function initCustomIconsForm()
372 {
374 $ilAccess = $this->access;
375
376 $form = new ilPropertyFormGUI();
377 $form->setTitle($this->lng->txt("rep_custom_icons"));
378 $form->setFormAction($this->ctrl->getFormAction($this, 'saveCustomIcons'));
379
380 $cb = new ilCheckboxInputGUI($this->lng->txt("enable_custom_icons"), "custom_icons");
381 $cb->setInfo($this->lng->txt("enable_custom_icons_info"));
382 $cb->setChecked($ilSetting->get("custom_icons"));
383 $form->addItem($cb);
384
385 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
386 $form->addCommandButton('saveCustomIcons', $this->lng->txt('save'));
387 }
388
389 return $form;
390 }
391
392 public function saveCustomIcons()
393 {
395 $ilAccess = $this->access;
396
397 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
398 $this->ctrl->redirect($this, "customIcons");
399 }
400
401 $form = $this->initCustomIconsForm();
402 if ($form->checkInput()) {
403 $ilSetting->set("custom_icons", (int) $form->getInput("custom_icons"));
404 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
405 $this->ctrl->redirect($this, "customIcons");
406 }
407
408 $form->setValuesByPost();
409 $this->customIcons($form);
410 }
411
412 protected function setModuleSubTabs($a_active)
413 {
414 $this->tabs_gui->activateTab('modules');
415
416 $this->tabs_gui->addSubTab(
417 "list_mods",
418 $this->lng->txt("rep_new_item_menu"),
419 $this->ctrl->getLinkTarget($this, "listModules")
420 );
421
422 $this->tabs_gui->addSubTab(
423 "new_item_groups",
424 $this->lng->txt("rep_new_item_groups"),
425 $this->ctrl->getLinkTarget($this, "listNewItemGroups")
426 );
427
428 $this->tabs_gui->activateSubTab($a_active);
429 }
430
431 protected function listModules()
432 {
433 $ilAccess = $this->access;
434
435 $this->setModuleSubTabs("list_mods");
436
437 $has_write = $ilAccess->checkAccess('write', '', $this->object->getRefId());
438
439 $comp_table = new ilModulesTableGUI($this, "listModules", $has_write);
440
441 $this->tpl->setContent($comp_table->getHTML());
442 }
443
444 protected function saveModules()
445 {
449 $ilAccess = $this->access;
450
451 if (!is_array($_POST["obj_grp"]) ||
452 !is_array($_POST["obj_pos"]) ||
453 !$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
454 $ilCtrl->redirect($this, "listModules");
455 }
456
457 $grp_pos_map = array(0 => 9999);
458 foreach (ilObjRepositorySettings::getNewItemGroups() as $item) {
459 $grp_pos_map[$item["id"]] = $item["pos"];
460 }
461
462 $type_pos_map = array();
463 foreach ($_POST["obj_pos"] as $obj_type => $pos) {
464 $grp_id = (int) $_POST["obj_grp"][$obj_type];
465 $type_pos_map[$grp_id][$obj_type] = $pos;
466
467 // enable creation?
468 $ilSetting->set("obj_dis_creation_" . $obj_type, !(int) $_POST["obj_enbl_creation"][$obj_type]);
469 }
470
471 foreach ($type_pos_map as $grp_id => $obj_types) {
472 $grp_pos = str_pad($grp_pos_map[$grp_id], 4, "0", STR_PAD_LEFT);
473
474 asort($obj_types);
475 $pos = 0;
476 foreach (array_keys($obj_types) as $obj_type) {
477 $pos += 10;
478 $type_pos = $grp_pos . str_pad($pos, 4, "0", STR_PAD_LEFT);
479 $ilSetting->set("obj_add_new_pos_" . $obj_type, $type_pos);
480 $ilSetting->set("obj_add_new_pos_grp_" . $obj_type, $grp_id);
481 }
482 }
483
484 /*
485 if (count($double) == 0)
486 {
487 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
488 }
489 else
490 {
491 ilUtil::sendInfo($lng->txt("cmps_duplicate_positions")." ".implode($double, ", "), true);
492 }
493 */
494
495 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
496 $ilCtrl->redirect($this, "listModules");
497 }
498
499 protected function listNewItemGroups()
500 {
501 $ilToolbar = $this->toolbar;
502 $ilAccess = $this->access;
503
504 $this->setModuleSubTabs("new_item_groups");
505
506 $has_write = $ilAccess->checkAccess('write', '', $this->object->getRefId());
507
508 if ($has_write) {
509 $ilToolbar->addButton(
510 $this->lng->txt("rep_new_item_group_add"),
511 $this->ctrl->getLinkTarget($this, "addNewItemGroup")
512 );
513
514 $ilToolbar->addButton(
515 $this->lng->txt("rep_new_item_group_add_separator"),
516 $this->ctrl->getLinkTarget($this, "addNewItemGroupSeparator")
517 );
518 }
519
520 $grp_table = new ilNewItemGroupTableGUI($this, "listNewItemGroups", $has_write);
521
522 $this->tpl->setContent($grp_table->getHTML());
523 }
524
525 protected function initNewItemGroupForm($a_grp_id = false)
526 {
527 $this->setModuleSubTabs("new_item_groups");
528
529 $form = new ilPropertyFormGUI();
530
531 $this->lng->loadLanguageModule("meta");
532 $def_lng = $this->lng->getDefaultLanguage();
533
534 $title = new ilTextInputGUI($this->lng->txt("title"), "title_" . $def_lng);
535 $title->setInfo($this->lng->txt("meta_l_" . $def_lng) .
536 " (" . $this->lng->txt("default_language") . ")");
537 $title->setRequired(true);
538 $form->addItem($title);
539
540 foreach ($this->lng->getInstalledLanguages() as $lang_id) {
541 if ($lang_id != $def_lng) {
542 $title = new ilTextInputGUI($this->lng->txt("translation"), "title_" . $lang_id);
543 $title->setInfo($this->lng->txt("meta_l_" . $lang_id));
544 $form->addItem($title);
545 }
546 }
547
548 if (!$a_grp_id) {
549 $form->setTitle($this->lng->txt("rep_new_item_group_add"));
550 $form->setFormAction($this->ctrl->getFormAction($this, "saveNewItemGroup"));
551
552 $form->addCommandButton("saveNewItemGroup", $this->lng->txt("save"));
553 } else {
554 $form->setTitle($this->lng->txt("rep_new_item_group_edit"));
555 $form->setFormAction($this->ctrl->getFormAction($this, "updateNewItemGroup"));
556
558 $grp = $grp[$a_grp_id];
559
560 foreach ($grp["titles"] as $id => $value) {
561 $field = $form->getItemByPostVar("title_" . $id);
562 if ($field) {
563 $field->setValue($value);
564 }
565 }
566
567 $form->addCommandButton("updateNewItemGroup", $this->lng->txt("save"));
568 }
569 $form->addCommandButton("listNewItemGroups", $this->lng->txt("cancel"));
570
571 return $form;
572 }
573
574 protected function addNewItemGroup(ilPropertyFormGUI $a_form = null)
575 {
576 if (!$a_form) {
577 $a_form = $this->initNewItemGroupForm();
578 }
579
580 $this->tpl->setContent($a_form->getHTML());
581 }
582
583 protected function saveNewItemGroup()
584 {
585 $form = $this->initNewItemGroupForm();
586 if ($form->checkInput()) {
587 $titles = array();
588 foreach ($this->lng->getInstalledLanguages() as $lang_id) {
589 $titles[$lang_id] = $form->getInput("title_" . $lang_id);
590 }
591
593 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
594 $this->ctrl->redirect($this, "listNewItemGroups");
595 }
596 }
597
598 $form->setValuesByPost();
599 $this->addNewItemGroup($form);
600 }
601
602 protected function editNewItemGroup(ilPropertyFormGUI $a_form = null)
603 {
604 $grp_id = (int) $_GET["grp_id"];
605 if (!$grp_id) {
606 $this->ctrl->redirect($this, "listNewItemGroups");
607 }
608
609 if (!$a_form) {
610 $this->ctrl->setParameter($this, "grp_id", $grp_id);
611 $a_form = $this->initNewItemGroupForm($grp_id);
612 }
613
614 $this->tpl->setContent($a_form->getHTML());
615 }
616
617 protected function updateNewItemGroup()
618 {
619 $grp_id = (int) $_GET["grp_id"];
620 if (!$grp_id) {
621 $this->ctrl->redirect($this, "listNewItemGroups");
622 }
623
624 $this->ctrl->setParameter($this, "grp_id", $grp_id);
625
626 $form = $this->initNewItemGroupForm($grp_id);
627 if ($form->checkInput()) {
628 $titles = array();
629 foreach ($this->lng->getInstalledLanguages() as $lang_id) {
630 $titles[$lang_id] = $form->getInput("title_" . $lang_id);
631 }
632
633 if (ilObjRepositorySettings::updateNewItemGroup($grp_id, $titles)) {
634 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
635 $this->ctrl->redirect($this, "listNewItemGroups");
636 }
637 }
638
639 $form->setValuesByPost();
640 $this->addNewItemGroup($form);
641 }
642
643 protected function addNewItemGroupSeparator()
644 {
646 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
647 }
648 $this->ctrl->redirect($this, "listNewItemGroups");
649 }
650
651 protected function saveNewItemGroupOrder()
652 {
654
655 if (is_array($_POST["grp_order"])) {
657
658 $grp_pos_map = array();
659 foreach (ilObjRepositorySettings::getNewItemGroups() as $item) {
660 $grp_pos_map[$item["id"]] = str_pad($item["pos"], 4, "0", STR_PAD_LEFT);
661 }
662
663 // update order of assigned objects
664 foreach (ilObjRepositorySettings::getNewItemGroupSubItems() as $grp_id => $subitems) {
665 // unassigned objects will always be last
666 if ($grp_id) {
667 foreach ($subitems as $obj_type) {
668 $old_pos = $ilSetting->get("obj_add_new_pos_" . $obj_type);
669 if (strlen($old_pos) == 8) {
670 $new_pos = $grp_pos_map[$grp_id] . substr($old_pos, 4);
671 $ilSetting->set("obj_add_new_pos_" . $obj_type, $new_pos);
672 }
673 }
674 }
675 }
676
677 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
678 }
679 $this->ctrl->redirect($this, "listNewItemGroups");
680 }
681
682 protected function confirmDeleteNewItemGroup()
683 {
684 if (!is_array($_POST["grp_id"])) {
685 ilUtil::sendFailure($this->lng->txt("select_one"));
686 return $this->listNewItemGroups();
687 }
688
689 $this->setModuleSubTabs("new_item_groups");
690
691 $cgui = new ilConfirmationGUI();
692 $cgui->setHeaderText($this->lng->txt("rep_new_item_group_delete_sure"));
693
694 $cgui->setFormAction($this->ctrl->getFormAction($this));
695 $cgui->setCancel($this->lng->txt("cancel"), "listNewItemGroups");
696 $cgui->setConfirm($this->lng->txt("confirm"), "deleteNewItemGroup");
697
699
700 foreach ($_POST["grp_id"] as $grp_id) {
701 $cgui->addItem("grp_id[]", $grp_id, $groups[$grp_id]["title"]);
702 }
703
704 $this->tpl->setContent($cgui->getHTML());
705 }
706
707 protected function deleteNewItemGroup()
708 {
709 if (!is_array($_POST["grp_id"])) {
710 return $this->listNewItemGroups();
711 }
712
713 foreach ($_POST["grp_id"] as $grp_id) {
715 }
716
717 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
718 $this->ctrl->redirect($this, "listNewItemGroups");
719 }
720
721 public function addToExternalSettingsForm($a_form_id)
722 {
724
725 switch ($a_form_id) {
727
728 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
729 $fields = array('trac_show_repository_views' => array(ilChangeEvent::_isActive(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
730
731 return array(array("view", $fields));
732
733
735
736 $fields = array(
737 'adm_show_comments_tagging_in_lists' => array($ilSetting->get('comments_tagging_in_lists'), ilAdministrationSettingsFormHandler::VALUE_BOOL,
738 array('adm_show_comments_tagging_in_lists_tags' => array($ilSetting->get('comments_tagging_in_lists_tags'), ilAdministrationSettingsFormHandler::VALUE_BOOL))
739 ));
740
741 return array(array("view", $fields));
742 }
743 }
744}
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
static _isActive()
Returns true, if change event tracking is active.
static _activate()
Activates change event tracking.
static _deactivate()
Deactivates change event tracking.
This class represents a checkbox property in a property form.
Confirmation screen class.
Export limitation checker.
This class represents a section header in a property form.
TableGUI class for module listing.
TableGUI class for new item groups.
This class represents a number property in a property form.
editNewItemGroup(ilPropertyFormGUI $a_form=null)
view(ilPropertyFormGUI $a_form=null)
customIcons(ilPropertyFormGUI $a_form=null)
getAdminTabs()
administration tabs show only permissions and trash folder
addNewItemGroup(ilPropertyFormGUI $a_form=null)
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
static updateNewItemGroupOrder(array $a_order)
static updateNewItemGroup($a_id, array $a_titles)
static addNewItemGroup(array $a_titles)
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46