ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjRemoteTestGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once('Services/WebServices/ECS/classes/class.ilRemoteObjectBaseGUI.php');
5
18{
19 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
20 {
21 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
22
23 $this->lng->loadLanguageModule('rtst');
24 $this->lng->loadLanguageModule('assessment');
25 }
26
27 function getType()
28 {
29 return 'rtst';
30 }
31
32 protected function addCustomInfoFields(ilInfoScreenGUI $a_info)
33 {
34 $a_info->addProperty($this->lng->txt('grp_visibility'),$this->availabilityToString());
35 }
36
37 protected function availabilityToString()
38 {
39 switch($this->object->getAvailabilityType())
40 {
42 return $this->lng->txt('offline');
43
45 return $this->lng->txt('grp_unlimited');
46
49 new ilDateTime($this->object->getStartingTime(),IL_CAL_UNIX),
50 new ilDateTime($this->object->getEndingTime(),IL_CAL_UNIX));
51 }
52 return '';
53 }
54
55 protected function addCustomEditForm(ilPropertyFormGUI $a_form)
56 {
57 $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'),'activation_type');
58 $radio_grp->setValue($this->object->getAvailabilityType());
59 $radio_grp->setDisabled(true);
60
61 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'),ilObjRemoteTest::ACTIVATION_OFFLINE);
62 $radio_grp->addOption($radio_opt);
63
64 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'),ilObjRemoteTest::ACTIVATION_UNLIMITED);
65 $radio_grp->addOption($radio_opt);
66
67 // :TODO: not supported in ECS yet
68 $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'),ilObjRemoteTest::ACTIVATION_LIMITED);
69
70 $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'),'start');
71 $start->setDate(new ilDateTime(time(),IL_CAL_UNIX));
72 $start->setDisabled(true);
73 $start->setShowTime(true);
74 $radio_opt->addSubItem($start);
75 $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'),'end');
76 $end->setDate(new ilDateTime(time(),IL_CAL_UNIX));
77 $end->setDisabled(true);
78 $end->setShowTime(true);
79 $radio_opt->addSubItem($end);
80
81 $radio_grp->addOption($radio_opt);
82 $a_form->addItem($radio_grp);
83 }
84}
85
86?>
const IL_CAL_UNIX
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
This class represents a date/time property in a property form.
@classDescription Date and time handling
Class ilInfoScreenGUI.
addProperty($a_name, $a_value, $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)
Constructor.
addCustomInfoFields(ilInfoScreenGUI $a_info)
Add custom fields to info screen.
getType()
Functions that must be overwritten.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents an option in a radio group.