ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMembershipRegistrationSettingsGUI.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/Membership/classes/class.ilMembershipRegistrationSettings.php';
5 
16 {
17  private $object = null;
18  private $gui_object = null;
19  private $options = array();
20 
26  public function __construct(ilObjectGUI $gui_object, ilObject $object, $a_options)
27  {
28  $this->gui_object = $gui_object;
29  $this->object = $object;
30  $this->options = $a_options;
31  }
32 
36  abstract public function setFormValues(ilPropertyFormGUI $form);
37 
42  public function getCurrentObject()
43  {
44  return $this->object;
45  }
46 
51  public function getCurrentGUI()
52  {
53  return $this->gui_object;
54  }
55 
60  public function getOptions()
61  {
62  return $this->options;
63  }
64 
69  final public function addMembershipFormElements(ilPropertyFormGUI $form, $a_parent_post = '')
70  {
71  // Registration type
72  $reg_type = new ilRadioGroupInputGUI($this->txt('reg_type'), 'registration_type');
73  //$reg_type->setValue($this->object->getRegistrationType());
74 
76  $opt_dir = new ilRadioOption($this->txt('reg_direct'), ilMembershipRegistrationSettings::TYPE_DIRECT);
77  $opt_dir->setInfo($this->txt('reg_direct_info'));
78  $reg_type->addOption($opt_dir);
79  }
81  $opt_pass = new ilRadioOption($this->txt('reg_pass'), ilMembershipRegistrationSettings::TYPE_PASSWORD);
82  $pass = new ilTextInputGUI($GLOBALS['DIC']['lng']->txt("password"), 'password');
83  $pass->setInfo($this->txt('reg_password_info'));
84  #$pass->setValue($this->object->getPassword());
85  $pass->setSize(10);
86  $pass->setMaxLength(32);
87  $opt_pass->addSubItem($pass);
88  $reg_type->addOption($opt_pass);
89  }
90 
92  $opt_req = new ilRadioOption($this->txt('reg_request'), ilMembershipRegistrationSettings::TYPE_REQUEST, $this->txt('reg_request_info'));
93  $reg_type->addOption($opt_req);
94  }
96  $opt_deact = new ilRadioOption($this->txt('reg_disabled'), ilMembershipRegistrationSettings::TYPE_NONE, $this->txt('reg_disabled_info'));
97  $reg_type->addOption($opt_deact);
98  }
99 
100  // Add to form
101  $form->addItem($reg_type);
102 
104  // max member
105  $lim = new ilCheckboxInputGUI($this->txt('reg_max_members_short'), 'registration_membership_limited');
106  $lim->setValue(1);
107  #$lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
108  #$lim->setChecked($this->object->isMembershipLimited());
109 
110  /* JF, 2015-08-31 - only used in sessions which cannot support min members (yet)
111  $min = new ilTextInputGUI($this->txt('reg_min_members'),'registration_min_members');
112  $min->setSize(3);
113  $min->setMaxLength(4);
114  $min->setInfo($this->txt('reg_min_members_info'));
115  $lim->addSubItem($min);
116  */
117 
118  $max = new ilTextInputGUI($this->txt('reg_max_members'), 'registration_max_members');
119  #$max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
120  //$max->setTitle($this->lng->txt('members'));
121  $max->setSize(3);
122  $max->setMaxLength(4);
123  $max->setInfo($this->txt('reg_max_members_info'));
124  $lim->addSubItem($max);
125 
126  /*
127  $wait = new ilCheckboxInputGUI($this->txt('reg_waiting_list'),'waiting_list');
128  $wait->setValue(1);
129  //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
130  $wait->setInfo($this->txt('reg_waiting_list_info'));
131  #$wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
132  $lim->addSubItem($wait);
133  */
134 
135  $wait = new ilRadioGroupInputGUI($this->txt('reg_waiting_list'), 'waiting_list');
136 
137  $option = new ilRadioOption($this->txt('reg_waiting_list_none'), 0);
138  $wait->addOption($option);
139 
140  $option = new ilRadioOption($this->txt('reg_waiting_list_no_autofill'), 1);
141  $option->setInfo($this->txt('reg_waiting_list_no_autofill_info'));
142  $wait->addOption($option);
143 
144  $option = new ilRadioOption($this->txt('reg_waiting_list_autofill'), 2);
145  $option->setInfo($this->txt('reg_waiting_list_autofill_info'));
146  $wait->addOption($option);
147 
148  $lim->addSubItem($wait);
149 
150  $form->addItem($lim);
151  }
152 
153  $this->setFormValues($form);
154  }
155 
159  protected function txt($a_lang_key)
160  {
161  $prefix = $this->getCurrentObject()->getType();
162  return $GLOBALS['DIC']['lng']->txt($prefix . '_' . $a_lang_key);
163  }
164 }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
Class ilObjectGUI Basic methods of all Output classes.
This class represents a text property in a property form.
__construct(ilObjectGUI $gui_object, ilObject $object, $a_options)
Constructor.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
addMembershipFormElements(ilPropertyFormGUI $form, $a_parent_post='')
Add membership form elements.
setFormValues(ilPropertyFormGUI $form)
Set form values.