3 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
4 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
5 require_once
'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewSettings.php';
40 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
44 $this->lng = $DIC->language();
45 $this->rbacsystem = $DIC->rbac()->system();
46 $this->error = $DIC[
"ilErr"];
47 $this->access = $DIC->access();
48 $this->ctrl = $DIC->ctrl();
50 $lng = $DIC->language();
51 $this->ui_factory = $DIC->ui()->factory();
52 $this->ui_renderer = $DIC->ui()->renderer();
55 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
57 $lng->loadLanguageModule(
"pd");
74 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
79 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
80 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
83 switch ($next_class) {
84 case 'ilpermissiongui':
85 $this->tabs_gui->setTabActive(
'perm_settings');
86 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
88 $ret = $this->ctrl->forwardCommand($perm_gui);
92 if (!$cmd || $cmd ==
'view') {
93 $cmd =
"editSettings";
113 if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
114 $this->tabs_gui->addTarget(
116 $this->ctrl->getLinkTarget($this,
"editSettings"),
117 array(
"editSettings",
"view")
120 $this->tabs_gui->addTarget(
121 "pd_personal_workspace",
122 $this->ctrl->getLinkTarget($this,
"editWsp"),
127 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
128 $this->tabs_gui->addTarget(
130 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
150 #$enable_calendar = $ilSetting->get("enable_calendar"); 151 $enable_block_moving = $pd_set->get(
"enable_block_moving");
153 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
156 $form->setTitle(
$lng->txt(
"pd_settings"));
162 $cb_prop->setChecked($enable_calendar);
163 $form->addItem($cb_prop);
168 $cb_prop->setChecked((
$ilSetting->get(
"disable_bookmarks") ?
"0" :
"1"));
169 $form->addItem($cb_prop);
174 $cb_prop->setChecked((
$ilSetting->get(
"disable_notes") ?
"0" :
"1"));
175 $form->addItem($cb_prop);
180 $cb_prop->setChecked((
$ilSetting->get(
"disable_comments") ?
"0" :
"1"));
181 $form->addItem($cb_prop);
185 $cb_prop->addSubItem($comm_del_user);
188 $comm_del_tutor->
setInfo(
$lng->txt(
"pd_enable_comments_del_tutor_info"));
189 $comm_del_tutor->setChecked(
$ilSetting->get(
"comments_del_tutor", 1));
190 $cb_prop->addSubItem($comm_del_tutor);
192 $ti =
new ilTextInputGUI($this->lng->txt(
"pd_comments_notification"),
"comments_noti_recip");
194 $ti->setMaxLength(200);
195 $ti->setInfo($this->lng->txt(
"pd_comments_notification_info"));
196 $cb_prop->addSubItem($ti);
201 $learn_hist->setInfo(
$lng->txt(
"pd_enable_learning_history_info"));
202 $learn_hist->setChecked((
$ilSetting->get(
"enable_learning_history") ?
"1" :
"0"));
203 $form->addItem($learn_hist);
208 $cb_prop->setChecked((
$ilSetting->get(
"block_activated_chatviewer")));
209 $form->addItem($cb_prop);
211 require_once
'Services/Mail/classes/class.ilObjMail.php';
215 $pd_sys_msg->addOption($sys_msg_own_block);
218 $pd_sys_msg->addOption($sys_msg_mail_block);
221 $pd_sys_msg->addOption($sys_msg_own_block);
224 $form->addItem($pd_sys_msg);
227 $cb_prop =
new ilCheckboxInputGUI(
$lng->txt(
'pd_enable_pdfrmpostdraft'),
'block_activated_pdfrmpostdraft');
228 $cb_prop->
setInfo(
$lng->txt(
'pd_enable_pdfrmpostdraft_info'));
229 $cb_prop->setValue(1);
230 $cb_prop->setChecked(
$ilSetting->get(
'block_activated_pdfrmpostdraft', 0));
231 $form->addItem($cb_prop);
235 $lng->txt(
"pd_enable_block_moving"),
236 "enable_block_moving" 239 $cb_prop->setInfo(
$lng->txt(
"pd_enable_block_moving_info"));
240 $cb_prop->setChecked($enable_block_moving);
241 $form->addItem($cb_prop);
246 $cb_prop->setInfo(
$lng->txt(
'pd_enable_my_offers_info'));
247 $cb_prop->setChecked($this->viewSettings->enabledSelectedItems());
248 $form->addItem($cb_prop);
253 $cb_prop->setInfo(
$lng->txt(
'pd_enable_my_memberships_info'));
254 $cb_prop->setChecked($this->viewSettings->enabledMemberships());
255 $form->addItem($cb_prop);
257 $memberships_sort_defaults =
new ilRadioGroupInputGUI(
$lng->txt(
'pd_my_memberships_sort_default'),
'my_memberships_sort_default');
258 $memberships_sort_defaults->
addOption(
new ilRadioOption(
$lng->txt(
'pd_sort_by_location'), $this->viewSettings->getSortByLocationMode()));
259 $memberships_sort_defaults->addOption(
new ilRadioOption(
$lng->txt(
'pd_sort_by_type'), $this->viewSettings->getSortByTypeMode()));
260 $memberships_sort_defaults->addOption(
new ilRadioOption(
$lng->txt(
'pd_sort_by_start_date'), $this->viewSettings->getSortByStartDateMode()));
261 $memberships_sort_defaults->setRequired(
true);
262 $memberships_sort_defaults->setValue($this->viewSettings->getDefaultSortType());
263 $cb_prop->addSubItem($memberships_sort_defaults);
266 $this->ctrl->setParameterByClass(
"iluserstartingpointgui",
"ref_id",
USER_FOLDER_ID);
267 $url = $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjuserfoldergui",
"iluserstartingpointgui"),
"startingpoints");
268 $this->ctrl->setParameterByClass(
"iluserstartingpointgui",
"ref_id",
$_GET[
'ref_id']);
270 $lng->loadLanguageModule(
"user");
271 $starting_point_button = $this->ui_factory->button()->shy(
$lng->txt(
"starting_points"),
$url);
273 $button->
setHtml($this->ui_renderer->render($starting_point_button));
274 $form->addItem($button);
276 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
278 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
279 $form->addCommandButton(
"view",
$lng->txt(
"cancel"));
282 $this->tpl->setContent(
$form->getHTML());
294 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
295 $ilCtrl->redirect($this,
"view");
303 #$ilSetting->set("enable_calendar", $_POST["enable_calendar"]); 304 $ilSetting->set(
"disable_bookmarks", (
int) (
$_POST[
"enable_bookmarks"] ? 0 : 1));
307 $ilSetting->set(
"disable_comments", (
int) (
$_POST[
"enable_comments"] ? 0 : 1));
309 $ilSetting->set(
"enable_learning_history", (
int)
$_POST[
"enable_learning_history"]);
311 $ilSetting->set(
"comments_del_user", (
int) ($_POST[
"comm_del_user"] ? 1 : 0));
312 $ilSetting->set(
"comments_del_tutor", (
int) ($_POST[
"comm_del_tutor"] ? 1 : 0));
315 $ilSetting->set(
"block_activated_chatviewer", (
int) ($_POST[
"block_activated_chatviewer"]));
316 $ilSetting->set(
"pd_sys_msg_mode", (
int) ($_POST[
"pd_sys_msg_mode"]));
318 $ilSetting->set(
"block_activated_pdfrmpostdraft", (
int) $_POST[
"block_activated_pdfrmpostdraft"]);
320 $pd_set->set(
"enable_block_moving", $_POST[
"enable_block_moving"]);
324 if (!(
int) $_POST[
'enable_my_offers'] && !(
int) $_POST[
'enable_my_memberships']) {
326 $ilCtrl->redirect($this,
'view');
329 $this->viewSettings->enableSelectedItems((
int) ($_POST[
'enable_my_offers'] ? 1 : 0));
330 $this->viewSettings->enableMemberships((
int) ($_POST[
'enable_my_memberships'] ? 1 : 0));
332 if ((
int) $_POST[
'enable_my_offers'] && !(
int) $_POST[
'enable_my_memberships']) {
333 $this->viewSettings->storeDefaultView($this->viewSettings->getSelectedItemsView());
334 } elseif (!(
int) $_POST[
'enable_my_offers'] && (
int) $_POST[
'enable_my_memberships']) {
335 $this->viewSettings->storeDefaultView($this->viewSettings->getMembershipsView());
336 } elseif (isset($_POST[
'personal_items_default_view'])) {
337 $this->viewSettings->storeDefaultView((
int) $_POST[
'personal_items_default_view']);
340 $this->viewSettings->storeDefaultSortType(
ilUtil::stripSlashes($_POST[
'my_memberships_sort_default']));
342 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
343 $ilCtrl->redirect($this,
"view");
356 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
358 $form->setFormAction(
$ilCtrl->getFormAction($this,
"saveWsp"));
359 $form->setTitle(
$lng->txt(
"pd_personal_workspace"));
364 $wsp_prop->setChecked((
$ilSetting->get(
'disable_personal_workspace') ?
'0' :
'1'));
365 $form->addItem($wsp_prop);
370 $blog_prop->setChecked((
$ilSetting->get(
'disable_wsp_blogs') ?
'0' :
'1'));
371 $wsp_prop->addSubItem($blog_prop);
376 $file_prop->setChecked((
$ilSetting->get(
'disable_wsp_files') ?
'0' :
'1'));
377 $wsp_prop->addSubItem($file_prop);
382 $cert_prop->setChecked((
$ilSetting->get(
'disable_wsp_certificates') ?
'0' :
'1'));
383 $wsp_prop->addSubItem($cert_prop);
388 $link_prop->setChecked((
$ilSetting->get(
'disable_wsp_links') ?
'0' :
'1'));
389 $wsp_prop->addSubItem($link_prop);
402 require_once
'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
406 $lng->loadLanguageModule(
"file");
407 $cb_prop =
new ilCheckboxInputGUI(
$lng->txt(
"personal_workspace_disk_quota"),
"enable_personal_workspace_disk_quota");
409 $cb_prop->setChecked($disk_quota_obj->isPersonalWorkspaceDiskQuotaEnabled());
410 $cb_prop->setInfo(
$lng->txt(
'enable_personal_workspace_disk_quota_info'));
411 $form->addItem($cb_prop);
413 require_once
'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
420 if ($ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
422 $form->addCommandButton(
"saveWsp",
$lng->txt(
"save"));
423 $form->addCommandButton(
"editWsp",
$lng->txt(
"cancel"));
426 $this->tpl->setContent(
$form->getHTML());
438 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
439 $ilCtrl->redirect($this,
"view");
450 $ilSetting->set(
'disable_personal_workspace', (
int) (
$_POST[
'wsp'] ? 0 : 1));
453 $ilSetting->set(
'disable_wsp_certificates', (
int) (
$_POST[
'cert'] ? 0 : 1));
458 require_once
'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
460 $disk_quota_obj->setPersonalWorkspaceDiskQuotaEnabled(
$_POST[
'enable_personal_workspace_disk_quota'] ==
'1');
461 $disk_quota_obj->update();
463 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
464 $ilCtrl->redirect($this,
"editWsp");
469 switch ($a_form_id) {
472 require_once
'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
477 return array(array(
"editWsp", $fields));
const PD_SYS_MSG_NO_BLOCK
This class represents an option in a radio group.
static _getInstance()
get singleton instance
editSettings()
Edit personal desktop settings.
executeCommand()
Execute command.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
saveWsp()
Save personal desktop settings.
const PD_SYS_MSG_OWN_BLOCK
prepareOutput($a_show_subobjects=true)
prepare output
setValue($a_value)
Set Value.
if(isset($_POST['submit'])) $form
Class ilPDSelectedItemsBlockViewSettings.
addToExternalSettingsForm($a_form_id)
Class ilObjectGUI Basic methods of all Output classes.
This class represents a text property in a property form.
editWsp()
Edit personal workspace settings.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const USER_FOLDER_ID
Class ilObjUserFolder.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
setValue($a_value)
Set Value.
saveSettings()
Save personal desktop settings.
static getInstance()
Get settings instance.
const PD_SYS_MSG_MAIL_BLOCK
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.