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