19 declare(strict_types=1);
49 bool $a_call_by_reference =
true,
50 bool $a_prepare_output =
true 54 $this->error = $DIC[
"ilErr"];
55 $this->
access = $DIC->access();
56 $this->rbacsystem = $DIC->rbac()->system();
58 $this->folder_settings =
new ilSetting(
'fold');
59 $this->
http = $DIC->http();
60 $this->
ctrl = $DIC->ctrl();
61 $this->
lng = $DIC->language();
62 $this->
toolbar = $DIC->toolbar();
63 $this->factory = $DIC->ui()->factory();
64 $this->renderer = $DIC->ui()->renderer();
69 $this->
lng->loadLanguageModule(
'rep');
70 $this->
lng->loadLanguageModule(
'cmps');
72 $this->admin_gui_request = $DIC
85 $next_class = $this->
ctrl->getNextClass($this);
86 $cmd = $this->
ctrl->getCmd();
90 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
94 switch ($next_class) {
95 case 'ilpermissiongui':
96 $this->tabs_gui->setTabActive(
'perm_settings');
98 $this->
ctrl->forwardCommand($perm_gui);
111 $this->tabs_gui->addTab(
113 $this->
lng->txt(
"settings"),
114 $this->
ctrl->getLinkTarget($this,
"view")
117 $this->tabs_gui->addTab(
119 $this->
lng->txt(
"rep_custom_icons"),
120 $this->
ctrl->getLinkTarget($this,
"customIcons")
123 $this->tabs_gui->addTab(
125 $this->
lng->txt(
"cmps_repository_object_types"),
126 $this->
ctrl->getLinkTarget($this,
"listModules")
129 if ($rbacsystem->
checkAccess(
'edit_permission', $this->object->getRefId())) {
130 $this->tabs_gui->addTab(
132 $this->
lng->txt(
"perm_settings"),
133 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
140 $this->tabs_gui->activateTab(
"settings");
146 $this->tpl->setContent($this->renderer->render($a_form));
156 $f = $this->factory->input()->field();
161 $this->
lng->txt(
"adm_rep_tree_only_cntr")
162 )->withByline($this->
lng->txt(
"adm_rep_tree_only_cntr_info"));
166 $this->
lng->txt(
"adm_rep_tree_limit_grp_crs"),
167 $this->
lng->txt(
"adm_rep_tree_limit_grp_crs_info")
172 'rep_tree_limit_grp_crs' => $cb
174 $this->
lng->txt(
"adm_rep_tree_all_types")
175 )->withByline($this->
lng->txt(
"adm_rep_tree_all_types_info"));
177 $tree_pres =
$f->switchableGroup(
182 $this->
lng->txt(
"adm_rep_tree_presentation")
186 $tree_limit_number =
$f->numeric(
187 $this->
lng->txt(
"rep_tree_limit_number"),
188 $this->
lng->txt(
"rep_tree_limit_number_info")
194 $tree_limit =
$f->optionalGroup(
196 'rep_tree_limit_number' => $tree_limit_number
198 $this->
lng->txt(
"rep_tree_limit"),
199 $this->
lng->txt(
"rep_tree_limit_info")
201 if (
$ilSetting->get(
"rep_tree_limit_number") <= 0) {
202 $tree_limit = $tree_limit->withValue(null);
206 $change_mode =
$f->radio(
207 $this->
lng->txt(
"rep_breadcr_crs_config")
210 $this->
lng->txt(
"rep_breadcr_crs_overwrite")
212 'rep_breadcr_crs_default',
213 $this->
lng->txt(
"rep_breadcr_crs_overwrite_with_default")
216 $this->
lng->txt(
"rep_breadcr_crs_overwrite_not")
218 if (
$ilSetting->get(
"rep_breadcr_crs_default")) {
219 $change_mode = $change_mode->withValue(
'rep_breadcr_crs_default');
222 $breadcrumbs =
$f->optionalGroup(
224 'rep_breadcr_crs_overwrite' => $change_mode
226 $this->
lng->txt(
"rep_breadcr_crs")
229 $breadcrumbs = $breadcrumbs->withValue(null);
233 $enable_trash =
$f->checkbox(
234 $this->
lng->txt(
"enable_trash"),
235 $this->
lng->txt(
"enable_trash_info")
239 $this->
lng->loadLanguageModule(
"trac");
240 $event =
$f->checkbox(
241 $this->
lng->txt(
'trac_show_repository_views'),
242 $this->
lng->txt(
"trac_show_repository_views_info")
246 $exp_disabled =
$f->group(
248 $this->
lng->txt(
"rep_export_limitation_disabled")
252 $exp_unlimited =
$f->group(
254 $this->
lng->txt(
"rep_export_limitation_unlimited")
258 $exp_limit_num =
$f->numeric(
259 $this->
lng->txt(
"rep_export_limit_number")
263 ->withRequired(
true);
265 $exp_limited =
$f->group(
267 'rep_export_limit_number' => $exp_limit_num
269 $this->
lng->txt(
"rep_export_limitation_limited")
273 $exp_limit =
$f->switchableGroup(
277 'rep_export_unlimited' => $exp_unlimited
279 $this->
lng->txt(
"rep_export_limitation"),
280 $this->
lng->txt(
"rep_export_limitation_info")
281 )->
withValue((
string) $limiter->getLimitationMode());
285 $ilSetting->get(
"rep_export_limit_number") ===
'' 287 $exp_limit = $exp_limit->withValue(
'rep_export_unlimited');
291 $dl_prob =
$f->checkbox(
292 $this->
lng->txt(
"enable_download_folder"),
293 $this->
lng->txt(
'enable_download_folder_info')
295 (
int) $this->folder_settings->get(
296 "enable_download_folder",
302 $dl_prop =
$f->checkbox(
303 $this->
lng->txt(
"enable_multi_download"),
304 $this->
lng->txt(
'enable_multi_download_info')
306 (
int) $this->folder_settings->get(
307 "enable_multi_download",
314 $this->
lng->txt(
"rep_favourites"),
315 $this->
lng->txt(
"rep_favourites_info")
321 'tree_pres' => $tree_pres,
322 'rep_tree_limit' => $tree_limit,
323 'rep_breadcr_crs' => $breadcrumbs,
324 'enable_trash' => $enable_trash,
325 'change_event_tracking' => $event,
326 'rep_export_limitation' => $exp_limit,
327 'enable_download_folder' => $dl_prob,
328 'enable_multi_download' => $dl_prop,
329 'rep_favourites' => $fav
331 $this->
lng->txt(
"settings")
332 )->withDisabled($read_only);
336 $sdesclen =
$f->numeric(
337 $this->
lng->txt(
"adm_rep_shorten_description_length")
342 $sdesc =
$f->optionalGroup(
344 'rep_shorten_description_length' => $sdesclen
346 $this->
lng->txt(
"adm_rep_shorten_description"),
347 $this->
lng->txt(
"adm_rep_shorten_description_info")
349 if (!
$ilSetting->get(
"rep_shorten_description")) {
350 $sdesc = $sdesc->withValue(null);
354 $async =
$f->checkbox(
355 $this->
lng->txt(
"adm_item_cmd_asynch"),
356 $this->
lng->txt(
"adm_item_cmd_asynch_info")
360 $pltags =
$f->checkbox(
361 $this->
lng->txt(
'adm_show_comments_tagging_in_lists_tags')
364 $pl =
$f->optionalGroup(
366 'comments_tagging_in_lists_tags' => $pltags
368 $this->
lng->txt(
'adm_show_comments_tagging_in_lists')
370 if (!
$ilSetting->get(
'comments_tagging_in_lists')) {
371 $pl = $pl->withValue(null);
374 $obj_lists =
$f->section(
376 'rep_shorten_description' => $sdesc,
377 'item_cmd_asynch' => $async,
378 'comments_tagging_in_lists' => $pl
380 $this->
lng->txt(
"rep_object_lists")
381 )->withDisabled($read_only);
383 $form = $this->factory->input()->container()->form()->standard(
384 $this->
ctrl->getFormAction($this,
'saveSettings'),
387 'obj_lists' => $obj_lists
399 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
400 $this->tpl->setOnScreenMessage(
402 $this->
lng->txt(
'permission_denied'),
405 $this->
ctrl->redirect($this,
"view");
409 ->withRequest($this->
http->request());
410 if ($form->getData()) {
411 $data = $form->getData()[
'settings'];
413 "repository_tree_pres",
414 $data[
"tree_pres"][0]
416 if (
$data[
'tree_pres'][0] ===
'all_types') {
418 "rep_tree_limit_grp_crs",
419 (
string)
$data[
'tree_pres'][1][
"rep_tree_limit_grp_crs"] ??
'' 425 $data[
"rep_favourites"] ?
"1" :
"0" 428 if (
$data[
"rep_export_limitation"][0] ===
'rep_export_unlimited') {
430 "rep_export_limitation",
434 "rep_export_limit_number",
439 "rep_export_limitation",
440 (
string)
$data[
"rep_export_limitation"][0]
445 "rep_export_limit_number",
446 (
string) (
$data[
"rep_export_limitation"][1][
"rep_export_limit_number"] ??
'')
452 (
string)
$data[
"enable_trash"]
457 (
string) ((
int) $data[
"rep_breadcr_crs"])
459 if (isset($data[
"rep_breadcr_crs"])) {
460 $overwrite = $data[
"rep_breadcr_crs"][
"rep_breadcr_crs_overwrite"];
462 "rep_breadcr_crs_default",
463 (
string) ((
int) ($overwrite ===
'rep_breadcr_crs_default'))
465 if ($overwrite ===
'rep_breadcr_crs_default') {
469 "rep_breadcr_crs_overwrite",
470 (
string) ((
int) $overwrite)
475 $limit_number = ($data[
'rep_tree_limit'] &&
476 $data[
'rep_tree_limit'][
'rep_tree_limit_number'] > 0)
477 ? (
int) $data[
'rep_tree_limit'][
'rep_tree_limit_number']
479 $ilSetting->set(
'rep_tree_limit_number', (
string) $limit_number);
481 $this->folder_settings->set(
482 "enable_download_folder",
483 (
string) ((
int) $data[
"enable_download_folder"] === 1)
485 $this->folder_settings->set(
486 "enable_multi_download",
487 (
string) ((
int) $data[
"enable_multi_download"] === 1)
489 if ($data[
'change_event_tracking']) {
496 $data = $form->getData()[
'obj_lists'];
498 "rep_shorten_description",
499 (
string) ((
int) $data[
'rep_shorten_description'])
501 if (isset($data[
'rep_shorten_description'])) {
503 "rep_shorten_description_length",
504 (
string) ((
int) $data[
'rep_shorten_description'][
'rep_shorten_description_length'])
509 (
string) ((
int) $data[
'item_cmd_asynch'])
512 'comments_tagging_in_lists',
513 (
string) ((
int) $data[
'comments_tagging_in_lists'])
515 if (isset($data[
'comments_tagging_in_lists'])) {
517 'comments_tagging_in_lists_tags',
518 (
string) $data[
'comments_tagging_in_lists'][
'comments_tagging_in_lists_tags']
522 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
523 $this->
ctrl->redirect($this,
"view");
531 $this->tabs_gui->activateTab(
"icons");
537 $this->tpl->setContent($this->renderer->render($a_form));
545 $cb = $this->factory->input()->field()->checkbox(
546 $this->
lng->txt(
"enable_custom_icons"),
547 $this->
lng->txt(
"enable_custom_icons_info")
550 $section = $this->factory->input()->field()->section(
551 [
'custom_icons' => $cb],
552 $this->
lng->txt(
"rep_custom_icons")
554 !$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())
557 $form = $this->factory->input()->container()->form()->standard(
558 $this->
ctrl->getFormAction($this,
'saveCustomIcons'),
559 [
'section' => $section]
570 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
571 $this->tpl->setOnScreenMessage(
573 $this->
lng->txt(
'permission_denied'),
576 $this->
ctrl->redirect($this,
"customIcons");
580 ->withRequest($this->
http->request());
581 if ($form->getData()) {
584 (
string) ((
int) $form->getData()[
'section'][
'custom_icons'])
586 $this->tpl->setOnScreenMessage(
588 $this->
lng->txt(
"msg_obj_modified"),
591 $this->
ctrl->redirect($this,
"customIcons");
599 $this->tabs_gui->activateTab(
'modules');
601 $this->tabs_gui->addSubTab(
603 $this->
lng->txt(
"rep_new_item_menu"),
604 $this->
ctrl->getLinkTarget($this,
"listModules")
607 $this->tabs_gui->addSubTab(
609 $this->
lng->txt(
"rep_new_item_groups"),
610 $this->
ctrl->getLinkTarget($this,
"listNewItemGroups")
613 $this->tabs_gui->activateSubTab($a_active);
622 $has_write = $ilAccess->checkAccess(
'write',
'', $this->
object->getRefId());
626 $this->tpl->setContent($comp_table->getHTML());
636 $item_groups = $this->admin_gui_request->getNewItemGroups();
637 $item_positions = $this->admin_gui_request->getNewItemPositions();
639 if (count($item_groups) === 0 || count($item_positions) === 0 ||
640 !$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
641 $ilCtrl->redirect($this,
"listModules");
644 $grp_pos_map = [0 => 9999];
646 $grp_pos_map[$item[
"id"]] = $item[
"pos"];
650 $item_enablings = $this->admin_gui_request->getNewItemEnablings();
651 foreach ($item_positions as $obj_type => $pos) {
652 $grp_id = ($item_groups[$obj_type] ?? 0);
653 $type_pos_map[$grp_id][$obj_type] = $pos;
657 "obj_dis_creation_" . $obj_type,
658 (
string) ((
int) (!($item_enablings[$obj_type] ??
false)))
662 foreach ($type_pos_map as $grp_id => $obj_types) {
663 $grp_pos = str_pad((
string) $grp_pos_map[$grp_id], 4,
"0", STR_PAD_LEFT);
667 foreach (array_keys($obj_types) as $obj_type) {
669 $type_pos = $grp_pos . str_pad((
string) $pos, 4,
"0", STR_PAD_LEFT);
670 $ilSetting->set(
"obj_add_new_pos_" . $obj_type, (
string) $type_pos);
671 $ilSetting->set(
"obj_add_new_pos_grp_" . $obj_type, (
string) $grp_id);
675 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
676 $ilCtrl->redirect($this,
"listModules");
686 $has_write = $ilAccess->checkAccess(
'write',
'', $this->
object->getRefId());
689 $ilToolbar->addButton(
690 $this->
lng->txt(
"rep_new_item_group_add"),
691 $this->
ctrl->getLinkTarget($this,
"addNewItemGroup")
694 $ilToolbar->addButton(
695 $this->
lng->txt(
"rep_new_item_group_add_separator"),
696 $this->
ctrl->getLinkTarget($this,
"addNewItemGroupSeparator")
702 $this->tpl->setContent($grp_table->getHTML());
711 $this->
lng->loadLanguageModule(
"meta");
712 $def_lng = $this->
lng->getDefaultLanguage();
715 $title->setInfo($this->
lng->txt(
"meta_l_" . $def_lng) .
716 " (" . $this->
lng->txt(
"default_language") .
")");
717 $title->setRequired(
true);
718 $form->addItem($title);
720 foreach ($this->
lng->getInstalledLanguages() as $lang_id) {
721 if ($lang_id !== $def_lng) {
722 $title =
new ilTextInputGUI($this->
lng->txt(
"translation"),
"title_" . $lang_id);
723 $title->setInfo($this->
lng->txt(
"meta_l_" . $lang_id));
724 $form->addItem($title);
729 $form->setTitle($this->
lng->txt(
"rep_new_item_group_add"));
730 $form->setFormAction($this->
ctrl->getFormAction($this,
"saveNewItemGroup"));
732 $form->addCommandButton(
"saveNewItemGroup", $this->
lng->txt(
"save"));
734 $form->setTitle($this->
lng->txt(
"rep_new_item_group_edit"));
735 $form->setFormAction($this->
ctrl->getFormAction($this,
"updateNewItemGroup"));
738 $grp = $grp[$a_grp_id];
740 foreach ($grp[
"titles"] as
$id => $value) {
741 $field = $form->getItemByPostVar(
"title_" .
$id);
743 $field->setValue($value);
747 $form->addCommandButton(
"updateNewItemGroup", $this->
lng->txt(
"save"));
749 $form->addCommandButton(
"listNewItemGroups", $this->
lng->txt(
"cancel"));
760 $this->tpl->setContent($a_form->getHTML());
766 if ($form->checkInput()) {
768 foreach ($this->
lng->getInstalledLanguages() as $lang_id) {
769 $titles[$lang_id] = $form->getInput(
"title_" . $lang_id);
773 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
774 $this->
ctrl->redirect($this,
"listNewItemGroups");
778 $form->setValuesByPost();
784 $grp_id = $this->admin_gui_request->getNewItemGroupId();
786 $this->
ctrl->redirect($this,
"listNewItemGroups");
790 $this->
ctrl->setParameter($this,
"grp_id", $grp_id);
794 $this->tpl->setContent($a_form->getHTML());
799 $grp_id = $this->admin_gui_request->getNewItemGroupId();
801 $this->
ctrl->redirect($this,
"listNewItemGroups");
804 $this->
ctrl->setParameter($this,
"grp_id", $grp_id);
807 if ($form->checkInput()) {
809 foreach ($this->
lng->getInstalledLanguages() as $lang_id) {
810 $titles[$lang_id] = $form->getInput(
"title_" . $lang_id);
814 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
815 $this->
ctrl->redirect($this,
"listNewItemGroups");
819 $form->setValuesByPost();
826 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
828 $this->
ctrl->redirect($this,
"listNewItemGroups");
835 $group_order = $this->admin_gui_request->getNewItemGroupOrder();
836 if (count($group_order) > 0) {
841 $grp_pos_map[$item[
"id"]] = str_pad((
string) $item[
"pos"], 4,
"0", STR_PAD_LEFT);
848 foreach ($subitems as $obj_type) {
849 $old_pos =
$ilSetting->get(
"obj_add_new_pos_" . $obj_type);
850 if (strlen($old_pos) === 8) {
851 $new_pos = $grp_pos_map[$grp_id] . substr($old_pos, 4);
852 $ilSetting->set(
"obj_add_new_pos_" . $obj_type, $new_pos);
858 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
860 $this->
ctrl->redirect($this,
"listNewItemGroups");
865 $group_ids = $this->admin_gui_request->getNewItemGroupIds();
866 if (count($group_ids) === 0) {
867 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"));
875 $cgui->setHeaderText($this->
lng->txt(
"rep_new_item_group_delete_sure"));
877 $cgui->setFormAction($this->
ctrl->getFormAction($this));
878 $cgui->setCancel($this->
lng->txt(
"cancel"),
"listNewItemGroups");
879 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"deleteNewItemGroup");
883 foreach ($group_ids as $grp_id) {
884 $cgui->addItem(
"grp_ids[]", (
string) $grp_id, $groups[$grp_id][
"title"]);
887 $this->tpl->setContent($cgui->getHTML());
892 $group_ids = $this->admin_gui_request->getNewItemGroupIds();
893 if (count($group_ids) === 0) {
898 foreach ($group_ids as $grp_id) {
902 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
903 $this->
ctrl->redirect($this,
"listNewItemGroups");
910 switch ($a_form_id) {
915 return [[
"view", $fields]];
921 'adm_show_comments_tagging_in_lists' => [
927 return [[
"view", $fields]];
936 $bound = (
int) (10 ** $max_length - 1);
938 return $this->
refinery->int()->isLessThanOrEqual($bound);
943 return $this->
refinery->int()->isGreaterThan(0);
948 return $this->
refinery->int()->isGreaterThanOrEqual(0);
Interface GlobalHttpState.
static _activate()
Activates change event tracking.
static addNewItemGroupSeparator()
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...
addToExternalSettingsForm(int $a_form_id)
confirmDeleteNewItemGroup()
prepareOutput(bool $show_sub_objects=true)
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
static getNewItemGroups()
AdministrationGUIRequest $admin_gui_request
A constraint encodes some resrtictions on values.
addNewItemGroupSeparator()
setModuleSubTabs(string $a_active)
static getNewItemGroupSubItems()
initNewItemGroupForm(int $a_grp_id=0)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
static http()
Fetches the global http state from ILIAS.
getMaxLengthConstraint(int $max_length)
static deleteNewItemGroup(int $a_id)
Class ilObjectGUI Basic methods of all Output classes.
__construct( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
static updateNewItemGroup(int $a_id, array $a_titles)
ilSetting $folder_settings
view(StandardForm $a_form=null)
static updateNewItemGroupOrder(array $a_order)
static addNewItemGroup(array $a_titles)
Error Handling & global info handling.
const SET_EXPORT_DISABLED
static _isActive()
Returns true, if change event tracking is active.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _deactivate()
Deactivates change event tracking.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
customIcons(StandardForm $a_form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addNewItemGroup(ilPropertyFormGUI $a_form=null)
editNewItemGroup(ilPropertyFormGUI $a_form=null)
getNonNegativeConstraint()