ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
class.ilObjRemoteCourseGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_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('rcrs');
24  $this->lng->loadLanguageModule('crs');
25  }
26 
27  function getType()
28  {
29  return 'rcrs';
30  }
31 
32  protected function addCustomInfoFields(ilInfoScreenGUI $a_info)
33  {
34  $a_info->addProperty($this->lng->txt('crs_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('crs_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('crs_visibility'),'activation_type');
58  $radio_grp->setValue($this->object->getAvailabilityType());
59  $radio_grp->setDisabled(true);
60 
61  $radio_opt = new ilRadioOption($this->lng->txt('crs_visibility_unvisible'),ilObjRemoteCourse::ACTIVATION_OFFLINE);
62  $radio_grp->addOption($radio_opt);
63 
64  $radio_opt = new ilRadioOption($this->lng->txt('crs_visibility_limitless'),ilObjRemoteCourse::ACTIVATION_UNLIMITED);
65  $radio_grp->addOption($radio_opt);
66 
67  // :TODO: not supported in ECS yet
68  $radio_opt = new ilRadioOption($this->lng->txt('crs_visibility_until'),ilObjRemoteCourse::ACTIVATION_LIMITED);
69 
70  $start = new ilDateTimeInputGUI($this->lng->txt('crs_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('crs_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 ?>
This class represents an option in a radio group.
Class ilInfoScreenGUI.
This class represents a property form user interface.
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
addItem($a_item)
Add Item (Property, SectionHeader).
addCustomEditForm(ilPropertyFormGUI $a_form)
const IL_CAL_UNIX
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
This class represents a date/time property in a property form.
addCustomInfoFields(ilInfoScreenGUI $a_info)
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
Date and time handling
addProperty($a_name, $a_value, $a_link="")
add a property to current section
setDisabled($a_disabled)
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)