ILIAS  release_8 Revision v8.24
class.ilObjRemoteGroupGUI.php
Go to the documentation of this file.
1<?php
2
18declare(strict_types=1);
19
32{
33 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
34 {
35 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
36
37 $this->lng->loadLanguageModule('rgrp');
38 $this->lng->loadLanguageModule('grp');
39 }
40
41 public function getType(): string
42 {
43 return 'rgrp';
44 }
45
46 protected function addCustomInfoFields(ilInfoScreenGUI $a_info): void
47 {
48 $a_info->addProperty($this->lng->txt('grp_visibility'), $this->availabilityToString());
49 }
50
51 protected function availabilityToString(): string
52 {
53 switch ($this->object->getAvailabilityType()) {
55 return $this->lng->txt('offline');
56
58 return $this->lng->txt('grp_unlimited');
59
62 new ilDateTime($this->object->getStartingTime(), IL_CAL_UNIX),
63 new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX)
64 );
65 }
66 return '';
67 }
68
69 protected function addCustomEditForm(ilPropertyFormGUI $a_form): void
70 {
71 $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type');
72 $radio_grp->setValue($this->object->getAvailabilityType());
73 $radio_grp->setDisabled(true);
74
75 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), (string)ilObjRemoteGroup::ACTIVATION_OFFLINE);
76 $radio_grp->addOption($radio_opt);
77
78 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), (string)ilObjRemoteGroup::ACTIVATION_UNLIMITED);
79 $radio_grp->addOption($radio_opt);
80
81 // :TODO: not supported in ECS yet
82 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), (string)ilObjRemoteGroup::ACTIVATION_LIMITED);
83
84 $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start');
85 $start->setDate(new ilDateTime(time(), IL_CAL_UNIX));
86 $start->setDisabled(true);
87 $start->setShowTime(true);
88 $radio_opt->addSubItem($start);
89 $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end');
90 $end->setDate(new ilDateTime(time(), IL_CAL_UNIX));
91 $end->setDisabled(true);
92 $end->setShowTime(true);
93 $radio_opt->addSubItem($end);
94
95 $radio_grp->addOption($radio_opt);
96 $a_form->addItem($radio_grp);
97 }
98}
const IL_CAL_UNIX
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling
Class ilInfoScreenGUI.
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
addCustomEditForm(ilPropertyFormGUI $a_form)
Add custom fields to edit form.
addCustomInfoFields(ilInfoScreenGUI $a_info)
Add custom fields to info screen.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
getType()
Functions that must be overwritten.
const ACTIVATION_OFFLINE
Fixed activation.
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc