1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("Services/Block/classes/class.ilBlockGUI.php");
6include_once './Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
7require_once('./Services/Repository/classes/class.ilObjectPlugin.php');
8
9/**
10* BlockGUI class for Selected Items on Personal Desktop
11*
12* @author Alex Killing <alex.killing@gmx.de>
13* @version $Id$
14*
15* @ilCtrl_IsCalledBy ilPDSelectedItemsBlockGUI: ilColumnGUI
16* @ilCtrl_Calls ilPDSelectedItemsBlockGUI: ilCommonActionDispatcherGUI
17*/
18class ilPDSelectedItemsBlockGUI extends ilBlockGUI implements ilDesktopItemHandling
19{
20    /**
21     * @var ilRbacSystem
22     */
23    protected $rbacsystem;
24
25    /**
26     * @var ilSetting
27     */
28    protected $settings;
29
30    /**
31     * @var ilObjectDefinition
32     */
33    protected $obj_definition;
34
35    /** @var string */
36    public static $block_type = 'pditems';
37
38    /** @var ilPDSelectedItemsBlockViewSettings */
39    protected $viewSettings;
40
41    /** @var ilPDSelectedItemsBlockViewGUI */
42    protected $view;
43
44    /** @var bool */
45    protected $manage = false;
46
47    /** @var string */
48    protected $content = '';
49
50    /** @var ilLanguage */
51    protected $lng;
52
53    /** @var ilCtrl */
54    protected $ctrl;
55
56    /** @var ilObjUser */
57    protected $user;
58
59    /**
60     * ilPDSelectedItemsBlockGUI constructor.
61     */
62    public function __construct()
63    {
64        global $DIC;
65        $this->rbacsystem = $DIC->rbac()->system();
66        $this->settings = $DIC->settings();
67        $this->obj_definition = $DIC["objDefinition"];
68        $this->access = $DIC->access();
69
70        parent::__construct();
71
72        $this->lng = $DIC->language();
73        $this->ctrl = $DIC->ctrl();
74        $this->user = $DIC->user();
75
76        $this->lng->loadLanguageModule('pd');
77        $this->lng->loadLanguageModule('cntr'); // #14158
78
79        $this->setEnableNumInfo(false);
80        $this->setLimit(99999);
81        $this->setAvailableDetailLevels(3, 1);
82        $this->allow_moving = false;
83
84        $this->initViewSettings();
85    }
86
87    /**
88     *
89     */
90    protected function initViewSettings()
91    {
92        require_once 'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewSettings.php';
93        $this->viewSettings = new ilPDSelectedItemsBlockViewSettings($this->user, (int) $_GET['view']);
94        $this->viewSettings->parse();
95
96        require_once 'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewGUI.php';
97        $this->view = ilPDSelectedItemsBlockViewGUI::bySettings($this->viewSettings);
98
99        $_GET['view'] = $this->viewSettings->getCurrentView();
100        $this->ctrl->saveParameter($this, 'view');
101    }
102
103    /**
104     * @return ilPDSelectedItemsBlockViewSettings
105     */
106    public function getViewSettings()
107    {
108        return $this->viewSettings;
109    }
110
111    /**
112     *
113     */
114    public function isManagedView()
115    {
116        return $this->manage;
117    }
118
119    /**
120     * @inheritdoc
121     */
122    public function fillDetailRow()
123    {
124        //		$this->ctrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
125        parent::fillDetailRow();
126        //		$this->ctrl->setParameterByClass('ilpersonaldesktopgui', 'view', '');
127    }
128
129    /**
130     * @inheritdoc
131     */
132    public function addToDeskObject()
133    {
134        include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
135        ilDesktopItemGUI::addToDesktop();
136        ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
137        $this->ctrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
138        $this->ctrl->redirectByClass('ilpersonaldesktopgui', 'show');
139    }
140
141    /**
142     * @inheritdoc
143     */
144    public function removeFromDeskObject()
145    {
146        include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
147        ilDesktopItemGUI::removeFromDesktop();
148        ilUtil::sendSuccess($this->lng->txt("removed_from_desktop"), true);
149        $this->ctrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
150        $this->ctrl->redirectByClass('ilpersonaldesktopgui', 'show');
151    }
152
153    /**
154     * @inheritdoc
155     */
156    public function getBlockType() : string
157    {
158        return self::$block_type;
159    }
160
161    /**
162     * @inheritdoc
163     */
164    public static function getScreenMode()
165    {
166        $cmd = $_GET['cmd'];
167        if ($cmd == 'post') {
168            $cmd = $_POST['cmd'];
169            $cmd = array_shift(array_keys($cmd));
170        }
171
172        switch ($cmd) {
173            case 'confirmRemove':
174            case 'manage':
175                return IL_SCREEN_FULL;
176
177            default:
178                return IL_SCREEN_SIDE;
179        }
180    }
181
182    /**
183     * @inheritdoc
184     */
185    protected function isRepositoryObject() : bool
186    {
187        return false;
188    }
189
190    /**
191     * @inheritdoc
192     */
193    public function getHTML()
194    {
195        global $DIC;
196
197        $DIC->database()->useSlave(true);
198
199        // workaround to show details row
200        $this->setData(array('dummy'));
201
202        require_once 'Services/Object/classes/class.ilObjectListGUI.php';
203        ilObjectListGUI::prepareJSLinks(
204            '',
205            $this->ctrl->getLinkTargetByClass(array('ilcommonactiondispatchergui', 'ilnotegui'), '', '', true, false),
206            $this->ctrl->getLinkTargetByClass(array('ilcommonactiondispatchergui', 'iltagginggui'), '', '', true, false)
207        );
208
209        $DIC['ilHelp']->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, $this->view->getScreenId());
210        $this->setTitle($this->view->getTitle());
211        $this->setContent($this->getViewBlockHtml());
212
213        if ($this->getContent() == '') {
214            $this->setEnableDetailRow(false);
215        }
216
217        //		$this->ctrl->clearParametersByClass('ilpersonaldesktopgui');
218        $this->ctrl->clearParameters($this);
219
220        $DIC->database()->useSlave(false);
221
222        return parent::getHTML();
223    }
224
225    // Overwritten from ilBlockGUI as there seems to be no other possibility to
226    // not show Commands in the HEADER(!!!!) of a block in the VIEW_MY_STUDYPROGRAMME
227    // case... Sigh.
228    public function getFooterLinks()
229    {
230        if ($this->viewSettings->isStudyProgrammeViewActive()) {
231            return array();
232        }
233
234        return parent::getFooterLinks();
235    }
236
237    /**
238     *
239     */
240    public function executeCommand()
241    {
242        $next_class = $this->ctrl->getNextClass();
243        $cmd = $this->ctrl->getCmd('getHTML');
244
245        switch ($next_class) {
246            case 'ilcommonactiondispatchergui':
247                include_once('Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
248                $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
249                $this->ctrl->forwardCommand($gui);
250                break;
251
252            default:
253                if (method_exists($this, $cmd)) {
254                    return $this->$cmd();
255                } else {
256                    return $this->{$cmd . 'Object'}();
257                }
258        }
259    }
260
261    /**
262     * @return string
263     */
264    protected function getContent()
265    {
266        return $this->content;
267    }
268
269    /**
270     * @param string $a_content
271     */
272    protected function setContent($a_content)
273    {
274        $this->content = $a_content;
275    }
276
277    /**
278     * @inheritdoc
279     */
280    public function fillDataSection()
281    {
282        if ($this->getContent() == '') {
283            $this->setDataSection($this->view->getIntroductionHtml());
284        } else {
285            $this->tpl->setVariable('BLOCK_ROW', $this->getContent());
286        }
287    }
288
289
290    /**
291     * @inheritdoc
292     */
293    public function fillFooter()
294    {
295        $this->setFooterLinks();
296        $this->fillFooterLinks();
297        $this->tpl->setVariable('FCOLSPAN', $this->getColSpan());
298        if ($this->tpl->blockExists('block_footer')) {
299            $this->tpl->setCurrentBlock('block_footer');
300            $this->tpl->parseCurrentBlock();
301        }
302    }
303
304    /**
305     *
306     */
307    protected function setFooterLinks()
308    {
309        if ($this->getContent() == '') {
310            $this->setEnableNumInfo(false);
311            return '';
312        }
313
314        if ($this->manage) {
315            return '';
316        }
317
318        $this->addFooterLink(
319            $this->lng->txt("pd_sort_by_type"),
320            $this->ctrl->getLinkTarget($this, "orderPDItemsByType"),
321            $this->ctrl->getLinkTarget($this, "orderPDItemsByType", "", true),
322            "block_" . $this->getBlockType() . "_" . $this->block_id,
323            false,
324            false,
325            $this->viewSettings->isSortedByType()
326        );
327
328        $this->addFooterLink(
329            $this->lng->txt("pd_sort_by_location"),
330            $this->ctrl->getLinkTarget($this, "orderPDItemsByLocation"),
331            $this->ctrl->getLinkTarget($this, "orderPDItemsByLocation", "", true),
332            "block_" . $this->getBlockType() . "_" . $this->block_id,
333            false,
334            false,
335            $this->viewSettings->isSortedByLocation()
336        );
337
338        if ($this->viewSettings->isMembershipsViewActive()) {
339            $this->addFooterLink(
340                $this->lng->txt("pd_sort_by_start_date"),
341                $this->ctrl->getLinkTarget($this, "orderPDItemsByStartDate"),
342                $this->ctrl->getLinkTarget($this, "orderPDItemsByStartDate", "", true),
343                "block_" . $this->getBlockType() . "_" . $this->block_id,
344                false,
345                false,
346                $this->viewSettings->isSortedByStartDate()
347            );
348        }
349
350        $this->addFooterLink(
351            $this->viewSettings->isSelectedItemsViewActive() ?
352            $this->lng->txt("pd_remove_multiple") :
353            $this->lng->txt("pd_unsubscribe_multiple_memberships"),
354            $this->ctrl->getLinkTarget($this, "manage"),
355            null,
356            "block_" . $this->getBlockType() . "_" . $this->block_id
357        );
358    }
359
360    /**
361     * @param ilTemplate $tpl
362     * @param ilPDSelectedItemsBlockGroup[] $grouped_items
363     * @param bool $show_header
364     * @return bool
365     */
366    protected function renderGroupedItems(ilTemplate $tpl, array $grouped_items, $show_header = false)
367    {
368        /** @var $rbacsystem ilRbacSystem */
369        $rbacsystem = $this->rbacsystem;
370
371        if (0 == count($grouped_items)) {
372            return false;
373        }
374
375        $output = false;
376
377        require_once 'Services/Object/classes/class.ilObjectActivation.php';
378        require_once 'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockListGUIFactory.php';
379        $list_factory = new ilPDSelectedItemsBlockListGUIFactory($this);
380
381        foreach ($grouped_items as $group) {
382            $item_html = array();
383
384            foreach ($group->getItems() as $item) {
385                try {
386                    $item_list_gui = $list_factory->byType($item['type']);
387                    ilObjectActivation::addListGUIActivationProperty($item_list_gui, $item);
388
389                    // #15232
390                    if ($this->manage) {
391                        if ($this->view->mayRemoveItem((int) $item['ref_id'])) {
392                            $item_list_gui->enableCheckbox(true);
393                        } else {
394                            $item_list_gui->enableCheckbox(false);
395                        }
396                    }
397
398                    $html = $item_list_gui->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']);
399                    if ($html != '') {
400                        $item_html[] = array(
401                            'html' => $html,
402                            'item_ref_id' => $item['ref_id'],
403                            'item_obj_id' => $item['obj_id'],
404                            'parent_ref' => $item['parent_ref'],
405                            'type' => $item['type'],
406                            'item_icon_image_type' => $item_list_gui->getIconImageType()
407                        );
408                    }
409                } catch (ilException $e) {
410                    continue;
411                }
412            }
413
414            if (0 == count($item_html)) {
415                continue;
416            }
417
418            if ($show_header) {
419                $this->addSectionHeader($tpl, $group);
420                $this->resetRowType() ;
421            }
422
423            foreach ($item_html as $item) {
424                $this->addStandardRow(
425                    $tpl,
426                    $item['html'],
427                    $item['item_ref_id'],
428                    $item['item_obj_id'],
429                    $item['item_icon_image_type'],
430                    'th_' . md5($group->getLabel())
431                );
432                $output = true;
433            }
434        }
435
436        return $output;
437    }
438
439    /**
440    * get selected item block
441    */
442    protected function getViewBlockHtml()
443    {
444        $tpl = $this->newBlockTemplate();
445
446        $this->renderGroupedItems(
447            $tpl,
448            $this->view->getItemGroups(),
449            ($this->getCurrentDetailLevel() >= $this->view->getMinimumDetailLevelForSection())
450        );
451
452        if ($this->manage && $this->view->supportsSelectAll()) {
453            // #11355 - see ContainerContentGUI::renderSelectAllBlock()
454            $tpl->setCurrentBlock('select_all_row');
455            $tpl->setVariable('CHECKBOXNAME', 'ilToolbarSelectAll');
456            $tpl->setVariable('SEL_ALL_PARENT', 'ilToolbar');
457            $tpl->setVariable('SEL_ALL_CB_NAME', 'id');
458            $tpl->setVariable('TXT_SELECT_ALL', $this->lng->txt('select_all'));
459            $tpl->parseCurrentBlock();
460        }
461
462        return $tpl->get();
463    }
464
465    protected function resetRowType()
466    {
467        $this->cur_row_type = "";
468    }
469
470    /**
471    * returns a new list block template
472    *
473    * @access	private
474    * @return	object		block template
475    */
476    public function newBlockTemplate()
477    {
478        $tpl = new ilTemplate("tpl.pd_list_block.html", true, true, "Services/PersonalDesktop");
479        $this->cur_row_type = "";
480        return $tpl;
481    }
482
483    /**
484     * @param ilTemplate                  $a_tpl
485     * @param ilPDSelectedItemsBlockGroup $group
486     */
487    protected function addSectionHeader(ilTemplate $a_tpl, ilPDSelectedItemsBlockGroup $group)
488    {
489        if ($group->hasIcon()) {
490            $a_tpl->setCurrentBlock('container_header_row_image');
491            $a_tpl->setVariable('HEADER_IMG', $group->getIconPath());
492            $a_tpl->setVariable('HEADER_ALT', $group->getLabel());
493        } else {
494            $a_tpl->setCurrentBlock('container_header_row');
495        }
496
497        $a_tpl->setVariable('BLOCK_HEADER_CONTENT', $group->getLabel());
498        $a_tpl->setVariable('BLOCK_HEADER_ID', 'th_' . md5($group->getLabel()));
499        $a_tpl->parseCurrentBlock();
500
501        $a_tpl->touchBlock('container_row');
502
503        $this->resetRowType();
504    }
505
506    /**
507    * adds a standard row to a block template
508    *
509    * @param	object		$a_tpl		block template
510    * @param	string		$a_html		html code
511    * @access	private
512    */
513    public function addStandardRow(
514        &$a_tpl,
515        $a_html,
516        $a_item_ref_id = "",
517        $a_item_obj_id = "",
518        $a_image_type = "",
519        $a_related_header = ""
520    ) {
521        $ilSetting = $this->settings;
522
523        $this->cur_row_type = ($this->cur_row_type == "row_type_1")
524        ? "row_type_2"
525        : "row_type_1";
526        $a_tpl->touchBlock($this->cur_row_type);
527
528        if ($a_image_type != "") {
529            if (!is_array($a_image_type) && !in_array($a_image_type, array("lm", "htlm", "sahs"))) {
530                $icon = ilUtil::getImagePath("icon_" . $a_image_type . ".svg");
531                $title = $this->lng->txt("obj_" . $a_image_type);
532            } else {
533                $icon = ilUtil::getImagePath("icon_lm.svg");
534                $title = $this->lng->txt("learning_module");
535            }
536
537            if ($ilSetting->get('custom_icons')) {
538                global $DIC;
539                /** @var \ilObjectCustomIconFactory  $customIconFactory */
540                $customIconFactory = $DIC['object.customicons.factory'];
541                $customIcon = $customIconFactory->getByObjId($a_item_obj_id, $a_image_type);
542
543                if ($customIcon->exists()) {
544                    $icon = $customIcon->getFullPath();
545                }
546            }
547
548            $a_tpl->setCurrentBlock("block_row_image");
549            $a_tpl->setVariable("ROW_IMG", $icon);
550            $a_tpl->setVariable("ROW_ALT", $title);
551            $a_tpl->parseCurrentBlock();
552        } else {
553            $a_tpl->setVariable("ROW_NBSP", "&nbsp;");
554        }
555        $a_tpl->setCurrentBlock("container_standard_row");
556        $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
557        /*$rel_headers = ($a_related_header != "")
558        ? "th_selected_items " . $a_related_header
559        : "th_selected_items";
560        $a_tpl->setVariable("BLOCK_ROW_HEADERS", $rel_headers);*/
561        $a_tpl->parseCurrentBlock();
562        $a_tpl->touchBlock("container_row");
563    }
564
565    /**
566     * @param string $sort_type
567     */
568    protected function changeSortMode($sort_type)
569    {
570        $this->user->writePref('pd_order_items', $sort_type);
571        $this->initViewSettings();
572
573        if ($this->ctrl->isAsynch()) {
574            echo $this->getHTML();
575            exit;
576        }
577
578        $this->ctrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
579        $this->ctrl->redirectByClass('ilpersonaldesktopgui', 'show');
580    }
581
582    /**
583     * Sort desktop items by location
584     */
585    public function orderPDItemsByLocation()
586    {
587        $this->changeSortMode($this->viewSettings->getSortByLocationMode());
588    }
589
590    /**
591     * Sort desktop items by Type
592     */
593    public function orderPDItemsByType()
594    {
595        $this->changeSortMode($this->viewSettings->getSortByTypeMode());
596    }
597
598    /**
599     * Sort desktop items by start date
600     */
601    public function orderPDItemsByStartDate()
602    {
603        $this->changeSortMode($this->viewSettings->getSortByStartDateMode());
604    }
605
606    public function manageObject()
607    {
608        $ilCtrl = $this->ctrl;
609        $lng = $this->lng;
610
611        $this->manage = true;
612        $this->setAvailableDetailLevels(1, 1);
613
614        $top_tb = new ilToolbarGUI();
615        $top_tb->setFormAction($ilCtrl->getFormAction($this));
616        $top_tb->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), $lng->txt("actions"));
617
618        $button = ilSubmitButton::getInstance();
619        if ($this->viewSettings->isSelectedItemsViewActive()) {
620            $button->setCaption("remove");
621        } else {
622            $button->setCaption("pd_unsubscribe_memberships");
623        }
624        $button->setCommand("confirmRemove");
625        $top_tb->addStickyItem($button);
626
627        $button2 = ilSubmitButton::getInstance();
628        $button2->setCaption("cancel");
629        $button2->setCommand("getHTML");
630        $top_tb->addStickyItem($button2);
631
632        $top_tb->setCloseFormTag(false);
633
634        $bot_tb = new ilToolbarGUI();
635        $bot_tb->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), $lng->txt("actions"));
636        $bot_tb->addStickyItem($button);
637        $bot_tb->addStickyItem($button2);
638        $bot_tb->setOpenFormTag(false);
639        return $top_tb->getHTML() . $this->getHTML() . $bot_tb->getHTML();
640    }
641
642    public function confirmRemoveObject()
643    {
644        $ilCtrl = $this->ctrl;
645
646        $ilCtrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
647        if (!sizeof($_POST["id"])) {
648            ilUtil::sendFailure($this->lng->txt("select_one"), true);
649            $ilCtrl->redirect($this, "manage");
650        }
651
652        if ($this->viewSettings->isSelectedItemsViewActive()) {
653            $question = $this->lng->txt("pd_info_delete_sure_remove");
654            $cmd = "confirmedRemove";
655        } else {
656            $question = $this->lng->txt("pd_info_delete_sure_unsubscribe");
657            $cmd = "confirmedUnsubscribe";
658        }
659
660        include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
661        $cgui = new ilConfirmationGUI();
662        $cgui->setHeaderText($question);
663
664        $cgui->setFormAction($ilCtrl->getFormAction($this));
665        $cgui->setCancel($this->lng->txt("cancel"), "manage");
666        $cgui->setConfirm($this->lng->txt("confirm"), $cmd);
667
668        foreach ($_POST["id"] as $ref_id) {
669            $obj_id = ilObject::_lookupObjectId($ref_id);
670            $title = ilObject::_lookupTitle($obj_id);
671            $type = ilObject::_lookupType($obj_id);
672
673            $cgui->addItem(
674                "ref_id[]",
675                $ref_id,
676                $title,
677                ilObject::_getIcon($obj_id, "small", $type),
678                $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $type)
679            );
680        }
681
682        return $cgui->getHTML();
683    }
684
685    public function confirmedRemove()
686    {
687        $ilCtrl = $this->ctrl;
688        $ilUser = $this->user;
689
690        if (!sizeof($_POST["ref_id"])) {
691            $ilCtrl->redirect($this, "manage");
692        }
693
694        foreach ($_POST["ref_id"] as $ref_id) {
695            $type = ilObject::_lookupType($ref_id, true);
696            ilObjUser::_dropDesktopItem($ilUser->getId(), $ref_id, $type);
697        }
698
699        // #12909
700        ilUtil::sendSuccess($this->lng->txt("pd_remove_multi_confirm"), true);
701        $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
702        $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
703    }
704
705    public function confirmedUnsubscribe()
706    {
707        $ilCtrl = $this->ctrl;
708        $ilAccess = $this->access;
709        $ilUser = $this->user;
710
711        if (!sizeof($_POST["ref_id"])) {
712            $ilCtrl->redirect($this, "manage");
713        }
714
715        foreach ($_POST["ref_id"] as $ref_id) {
716            if ($ilAccess->checkAccess("leave", "", $ref_id)) {
717                switch (ilObject::_lookupType($ref_id, true)) {
718                    case "crs":
719                        // see ilObjCourseGUI:performUnsubscribeObject()
720                        include_once "Modules/Course/classes/class.ilCourseParticipants.php";
721                        $members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
722                        $members->delete($ilUser->getId());
723
724                        $members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
725                        $members->sendNotification(
726                            $members->NOTIFY_UNSUBSCRIBE,
727                            $ilUser->getId()
728                        );
729                        break;
730
731                    case "grp":
732                        // see ilObjGroupGUI:performUnsubscribeObject()
733                        include_once "Modules/Group/classes/class.ilGroupParticipants.php";
734                        $members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
735                        $members->delete($ilUser->getId());
736
737                        include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
738                        $members->sendNotification(
739                            ilGroupMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER,
740                            $ilUser->getId()
741                        );
742                        $members->sendNotification(
743                            ilGroupMembershipMailNotification::TYPE_NOTIFICATION_UNSUBSCRIBE,
744                            $ilUser->getId()
745                        );
746                        break;
747
748                    default:
749                        // do nothing
750                        continue 2;
751                }
752
753                include_once './Modules/Forum/classes/class.ilForumNotification.php';
754                ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
755            }
756        }
757
758
759        ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
760        $ilCtrl->setParameterByClass('ilpersonaldesktopgui', 'view', $this->viewSettings->getCurrentView());
761        $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
762    }
763}
764