23 include_once(
"./classes/class.ilObjectGUI.php");
24 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
44 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
51 $lng->loadLanguageModule(
"pd");
62 global $rbacsystem,
$ilErr,$ilAccess;
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
69 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
71 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
76 case 'ilpermissiongui':
77 $this->tabs_gui->setTabActive(
'perm_settings');
78 include_once(
"./classes/class.ilPermissionGUI.php");
80 $ret =& $this->ctrl->forwardCommand($perm_gui);
86 $cmd =
"editSettings";
103 global $rbacsystem, $ilAccess;
105 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
107 $this->tabs_gui->addTarget(
"pd_settings",
108 $this->ctrl->getLinkTarget($this,
"editSettings"),
109 array(
"editSettings",
"view"));
112 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
114 $this->tabs_gui->addTarget(
"perm_settings",
115 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
116 array(),
'ilpermissiongui');
130 #$enable_calendar = $ilSetting->get("enable_calendar");
131 $enable_block_moving = $pd_set->get(
"enable_block_moving");
132 $enable_active_users = $ilSetting->get(
"block_activated_pdusers");
134 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
136 $form->setFormAction($ilCtrl->getFormAction($this));
137 $form->setTitle($lng->txt(
"pd_settings"));
143 $cb_prop->setChecked($enable_calendar);
144 $form->addItem($cb_prop);
147 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"pd_enable_bookmarks"),
"enable_bookmarks");
149 $cb_prop->setChecked(($ilSetting->get(
"disable_bookmarks") ?
"0" :
"1"));
150 $form->addItem($cb_prop);
155 $cb_prop->setChecked(($ilSetting->get(
"disable_notes") ?
"0" :
"1"));
156 $form->addItem($cb_prop);
160 "enable_block_moving");
162 $cb_prop->setInfo($lng->txt(
"pd_enable_block_moving_info"));
163 $cb_prop->setChecked($enable_block_moving);
164 $form->addItem($cb_prop);
168 "block_activated_pdusers");
170 $cb_prop->setChecked($enable_active_users);
173 $ti_prop =
new ilTextInputGUI($lng->txt(
"pd_time_before_removal"),
175 $ti_prop->
setValue($pd_set->get(
"user_activity_time"));
176 $ti_prop->setInfo($lng->txt(
"pd_time_before_removal_info"));
177 $ti_prop->setMaxLength(3);
178 $ti_prop->setSize(3);
179 $cb_prop->addSubItem($ti_prop);
185 $ti_prop->
setValue($pd_set->get(
"osi_host"));
186 $ti_prop->setInfo($lng->txt(
"pd_osi_host_info").
187 ' <a href="http://www.onlinestatus.org" target="_blank">http://www.onlinestatus.org</a>');
188 $cb_prop->addSubItem($ti_prop);
190 $form->addItem($cb_prop);
193 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
'pd_enable_my_offers'),
'enable_my_offers');
195 $cb_prop->setInfo($lng->txt(
'pd_enable_my_offers_info'));
196 $cb_prop->setChecked(($ilSetting->get(
'disable_my_offers') ?
'0' :
'1'));
197 $form->addItem($cb_prop);
200 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
'pd_enable_my_memberships'),
'enable_my_memberships');
202 $cb_prop->setInfo($lng->txt(
'pd_enable_my_memberships_info'));
203 $cb_prop->setChecked(($ilSetting->get(
'disable_my_memberships') ?
'0' :
'1'));
204 $form->addItem($cb_prop);
206 if($ilSetting->get(
'disable_my_offers') == 0 &&
207 $ilSetting->get(
'disable_my_memberships') == 0)
210 $sb_prop =
new ilSelectInputGUI($lng->txt(
'pd_personal_items_default_view'),
'personal_items_default_view');
211 $sb_prop->
setInfo($lng->txt(
'pd_personal_items_default_view_info'));
213 $option[0] = $lng->txt(
'pd_my_offers');
214 $option[1] = $lng->txt(
'pd_my_memberships');
215 $sb_prop->setOptions($option);
216 $sb_prop->setValue((
int)$ilSetting->get(
'personal_items_default_view'));
217 $form->addItem($sb_prop);
221 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
222 $form->addCommandButton(
"view", $lng->txt(
"cancel"));
224 $this->tpl->setContent($form->getHTML());
239 #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]);
240 $ilSetting->set(
"disable_bookmarks", (
int) ($_POST[
"enable_bookmarks"] ? 0 : 1));
241 $ilSetting->set(
"disable_notes", (
int) ($_POST[
"enable_notes"] ? 0 : 1));
243 $ilSetting->set(
"block_activated_pdusers", $_POST[
"block_activated_pdusers"]);
244 $pd_set->set(
"enable_block_moving", $_POST[
"enable_block_moving"]);
245 $pd_set->set(
"user_activity_time", (
int) $_POST[
"time_removal"]);
246 $pd_set->set(
"osi_host", $_POST[
"osi_host"]);
249 if(!(
int)$_POST[
'enable_my_offers'] && !(
int)$_POST[
'enable_my_memberships'])
252 $ilCtrl->redirect($this,
'view');
256 $ilSetting->set(
'disable_my_offers', (
int)($_POST[
'enable_my_offers'] ? 0 : 1));
259 $ilSetting->set(
'disable_my_memberships', (
int)($_POST[
'enable_my_memberships'] ? 0 : 1));
261 if((
int)$_POST[
'enable_my_offers'] && !(
int)$_POST[
'enable_my_memberships'])
262 $_POST[
'personal_items_default_view'] = 0;
263 else if(!(
int)$_POST[
'enable_my_offers'] && (
int)$_POST[
'enable_my_memberships'])
264 $_POST[
'personal_items_default_view'] = 1;
265 else if(!isset($_POST[
'personal_items_default_view']))
266 $_POST[
'personal_items_default_view'] = $ilSetting->get(
'personal_items_default_view');
269 $ilSetting->set(
'personal_items_default_view', (
int)$_POST[
'personal_items_default_view']);
273 $ilCtrl->redirect($this,
"view");