3 include_once(
"./classes/class.ilObjectGUI.php");
4 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
24 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
31 $lng->loadLanguageModule(
"pd");
42 global $rbacsystem,
$ilErr,$ilAccess;
44 $next_class = $this->ctrl->getNextClass($this);
45 $cmd = $this->ctrl->getCmd();
49 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
51 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
56 case 'ilpermissiongui':
57 $this->tabs_gui->setTabActive(
'perm_settings');
58 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
60 $ret =& $this->ctrl->forwardCommand($perm_gui);
66 $cmd =
"editSettings";
83 global $rbacsystem, $ilAccess;
85 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
87 $this->tabs_gui->addTarget(
"pd_settings",
88 $this->ctrl->getLinkTarget($this,
"editSettings"),
89 array(
"editSettings",
"view"));
92 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
94 $this->tabs_gui->addTarget(
"perm_settings",
95 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
96 array(),
'ilpermissiongui');
110 #$enable_calendar = $ilSetting->get("enable_calendar");
111 $enable_block_moving = $pd_set->get(
"enable_block_moving");
112 $enable_active_users = $ilSetting->get(
"block_activated_pdusers");
114 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
116 $form->setFormAction($ilCtrl->getFormAction($this));
117 $form->setTitle($lng->txt(
"pd_settings"));
123 $cb_prop->setChecked($enable_calendar);
124 $form->addItem($cb_prop);
127 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"pd_enable_bookmarks"),
"enable_bookmarks");
129 $cb_prop->setChecked(($ilSetting->get(
"disable_bookmarks") ?
"0" :
"1"));
130 $form->addItem($cb_prop);
133 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"pd_enable_contacts"),
"enable_contacts");
135 $cb_prop->setChecked(($ilSetting->get(
"disable_contacts") ?
"0" :
"1"));
137 $cb_prop_requires_mail =
new ilCheckboxInputGUI($lng->txt(
'pd_enable_contacts_requires_mail'),
'enable_contacts_require_mail');
138 $cb_prop_requires_mail->
setValue(
"1");
139 $cb_prop_requires_mail->setChecked(($ilSetting->get(
"disable_contacts_require_mail") ?
"0" :
"1"));
140 $cb_prop->addSubItem($cb_prop_requires_mail);
142 $form->addItem($cb_prop);
147 $cb_prop->setChecked(($ilSetting->get(
"disable_notes") ?
"0" :
"1"));
148 $form->addItem($cb_prop);
151 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"pd_enable_chatviewer"),
"block_activated_chatviewer");
153 $cb_prop->setChecked(($ilSetting->get(
"block_activated_chatviewer")));
154 $form->addItem($cb_prop);
158 "enable_block_moving");
160 $cb_prop->setInfo($lng->txt(
"pd_enable_block_moving_info"));
161 $cb_prop->setChecked($enable_block_moving);
162 $form->addItem($cb_prop);
166 "block_activated_pdusers");
168 $cb_prop->setChecked($enable_active_users);
171 $ti_prop =
new ilTextInputGUI($lng->txt(
"pd_time_before_removal"),
173 $ti_prop->
setValue($pd_set->get(
"user_activity_time"));
174 $ti_prop->setInfo($lng->txt(
"pd_time_before_removal_info"));
175 $ti_prop->setMaxLength(3);
176 $ti_prop->setSize(3);
177 $cb_prop->addSubItem($ti_prop);
183 $ti_prop->
setValue($pd_set->get(
"osi_host"));
184 $ti_prop->setInfo($lng->txt(
"pd_osi_host_info").
185 ' <a href="http://www.onlinestatus.org" target="_blank">http://www.onlinestatus.org</a>');
186 $cb_prop->addSubItem($ti_prop);
188 $form->addItem($cb_prop);
191 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
'pd_enable_my_offers'),
'enable_my_offers');
193 $cb_prop->setInfo($lng->txt(
'pd_enable_my_offers_info'));
194 $cb_prop->setChecked(($ilSetting->get(
'disable_my_offers') ?
'0' :
'1'));
195 $form->addItem($cb_prop);
198 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
'pd_enable_my_memberships'),
'enable_my_memberships');
200 $cb_prop->setInfo($lng->txt(
'pd_enable_my_memberships_info'));
201 $cb_prop->setChecked(($ilSetting->get(
'disable_my_memberships') ?
'0' :
'1'));
202 $form->addItem($cb_prop);
204 if($ilSetting->get(
'disable_my_offers') == 0 &&
205 $ilSetting->get(
'disable_my_memberships') == 0)
208 $sb_prop =
new ilSelectInputGUI($lng->txt(
'pd_personal_items_default_view'),
'personal_items_default_view');
209 $sb_prop->
setInfo($lng->txt(
'pd_personal_items_default_view_info'));
211 $option[0] = $lng->txt(
'pd_my_offers');
212 $option[1] = $lng->txt(
'pd_my_memberships');
213 $sb_prop->setOptions($option);
214 $sb_prop->setValue((
int)$ilSetting->get(
'personal_items_default_view'));
215 $form->addItem($sb_prop);
219 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
220 $form->addCommandButton(
"view", $lng->txt(
"cancel"));
222 $this->tpl->setContent($form->getHTML());
237 #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
238 $ilSetting->set(
"disable_bookmarks", (
int) (
$_POST[
"enable_bookmarks"] ? 0 : 1));
240 $ilSetting->set(
"disable_contacts", (
int) (
$_POST[
"enable_contacts"] ? 0 : 1));
241 $ilSetting->set(
"disable_contacts_require_mail", (
int) (
$_POST[
"enable_contacts_require_mail"] ? 0 : 1));
243 $ilSetting->set(
"disable_notes", (
int) (
$_POST[
"enable_notes"] ? 0 : 1));
244 $ilSetting->set(
"block_activated_chatviewer", (
int) (
$_POST[
"block_activated_chatviewer"]));
246 $ilSetting->set(
"block_activated_pdusers",
$_POST[
"block_activated_pdusers"]);
247 $pd_set->set(
"enable_block_moving",
$_POST[
"enable_block_moving"]);
248 $pd_set->set(
"user_activity_time", (
int)
$_POST[
"time_removal"]);
249 $pd_set->set(
"osi_host", $_POST[
"osi_host"]);
252 if(!(
int)$_POST[
'enable_my_offers'] && !(
int)$_POST[
'enable_my_memberships'])
255 $ilCtrl->redirect($this,
'view');
259 $ilSetting->set(
'disable_my_offers', (
int)($_POST[
'enable_my_offers'] ? 0 : 1));
262 $ilSetting->set(
'disable_my_memberships', (
int)($_POST[
'enable_my_memberships'] ? 0 : 1));
264 if((
int)$_POST[
'enable_my_offers'] && !(
int)$_POST[
'enable_my_memberships'])
265 $_POST[
'personal_items_default_view'] = 0;
266 else if(!(
int)$_POST[
'enable_my_offers'] && (
int)$_POST[
'enable_my_memberships'])
267 $_POST[
'personal_items_default_view'] = 1;
268 else if(!isset($_POST[
'personal_items_default_view']))
269 $_POST[
'personal_items_default_view'] = $ilSetting->get(
'personal_items_default_view');
272 $ilSetting->set(
'personal_items_default_view', (
int)$_POST[
'personal_items_default_view']);
276 $ilCtrl->redirect($this,
"view");