ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 ?>