ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjRemoteCourseGUI.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('rcrs');
39 $this->lng->loadLanguageModule('crs');
40 }
41
42 public function getType(): string
43 {
44 return 'rcrs';
45 }
46
47 protected function addCustomInfoFields(ilInfoScreenGUI $a_info): void
48 {
49 $a_info->addProperty($this->lng->txt('crs_visibility'), $this->availabilityToString());
50 }
51
52 protected function availabilityToString(): string
53 {
54 switch ($this->object->getAvailabilityType()) {
56 return $this->lng->txt('offline');
57
59 return $this->lng->txt('crs_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('crs_visibility'), 'activation_type');
73 $radio_grp->setValue((string) $this->object->getAvailabilityType());
74 $radio_grp->setDisabled(true);
75
76 $radio_opt = new ilRadioOption(
77 $this->lng->txt('crs_visibility_unvisible'),
79 );
80 $radio_grp->addOption($radio_opt);
81
82 $radio_opt = new ilRadioOption(
83 $this->lng->txt('crs_visibility_limitless'),
85 );
86 $radio_grp->addOption($radio_opt);
87
88 // :TODO: not supported in ECS yet
89 $radio_opt = new ilRadioOption(
90 $this->lng->txt('crs_visibility_until'),
92 );
93
94 $start = new ilDateTimeInputGUI($this->lng->txt('crs_start'), 'start');
95 $start->setDate(new ilDateTime(time(), IL_CAL_UNIX));
96 $start->setDisabled(true);
97 $start->setShowTime(true);
98 $radio_opt->addSubItem($start);
99 $end = new ilDateTimeInputGUI($this->lng->txt('crs_end'), 'end');
100 $end->setDate(new ilDateTime(time(), IL_CAL_UNIX));
101 $end->setDisabled(true);
102 $end->setShowTime(true);
103 $radio_opt->addSubItem($end);
104
105 $radio_grp->addOption($radio_opt);
106 $a_form->addItem($radio_grp);
107 }
108}
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.
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.
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