ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjRemoteTestGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
33{
34 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
35 {
36 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
37
38 $this->lng->loadLanguageModule('rtst');
39 $this->lng->loadLanguageModule('assessment');
40 }
41
42 public function getType(): string
43 {
44 return 'rtst';
45 }
46
47 protected function addCustomInfoFields(ilInfoScreenGUI $a_info): void
48 {
49 $a_info->addProperty($this->lng->txt('grp_visibility'), $this->availabilityToString());
50 }
51
52 protected function availabilityToString()
53 {
54 switch ($this->object->getAvailabilityType()) {
56 return $this->lng->txt('offline');
57
59 return $this->lng->txt('grp_unlimited');
60
63 new ilDateTime($this->object->getStartingTime(), IL_CAL_UNIX),
64 new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX)
65 );
66 }
67 return '';
68 }
69
70 protected function addCustomEditForm(ilPropertyFormGUI $a_form): void
71 {
72 $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type');
73 $radio_grp->setValue($this->object->getAvailabilityType());
74 $radio_grp->setDisabled(true);
75
76 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), ilObjRemoteTest::ACTIVATION_OFFLINE);
77 $radio_grp->addOption($radio_opt);
78
79 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), ilObjRemoteTest::ACTIVATION_UNLIMITED);
80 $radio_grp->addOption($radio_opt);
81
82 // :TODO: not supported in ECS yet
83 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), ilObjRemoteTest::ACTIVATION_LIMITED);
84
85 $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start');
86 $start->setDate(new ilDateTime(time(), IL_CAL_UNIX));
87 $start->setDisabled(true);
88 $start->setShowTime(true);
89 $radio_opt->addSubItem($start);
90 $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end');
91 $end->setDate(new ilDateTime(time(), IL_CAL_UNIX));
92 $end->setDisabled(true);
93 $end->setShowTime(true);
94 $radio_opt->addSubItem($end);
95
96 $radio_grp->addOption($radio_opt);
97 $a_form->addItem($radio_grp);
98 }
99}
const IL_CAL_UNIX
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
This class represents a date/time property in a property form.
@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.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
addCustomInfoFields(ilInfoScreenGUI $a_info)
Add custom fields to info screen.
getType()
Functions that must be overwritten.
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc