ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  public 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()) {
41  return $this->lng->txt('offline');
42 
44  return $this->lng->txt('crs_unlimited');
45 
48  new ilDateTime($this->object->getStartingTime(), IL_CAL_UNIX),
49  new ilDateTime($this->object->getEndingTime(), IL_CAL_UNIX)
50  );
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 }
This class represents an option in a radio group.
Class ilInfoScreenGUI.
This class represents a property form user interface.
$end
Definition: saml1-acs.php:18
addItem($a_item)
Add Item (Property, SectionHeader).
addCustomEditForm(ilPropertyFormGUI $a_form)
const IL_CAL_UNIX
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
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
Create new PHPExcel object
obj_idprivate
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)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.