/** * */ public function detachModeratorRole() { if (!isset($_POST['usr_id']) || !is_array($_POST['usr_id'])) { ilUtil::sendFailure($this->lng->txt('frm_moderators_select_at_least_one')); return $this->showModerators(); } $entries = $this->oForumModerators->getCurrentModerators(); if (count($_POST['usr_id']) == count($entries)) { ilUtil::sendFailure($this->lng->txt('frm_at_least_one_moderator')); return $this->showModerators(); } include_once "Modules/Forum/classes/class.ilForumNotification.php"; $isCrsGrp = ilForumNotification::_isParentNodeGrpCrs($this->ref_id); if ($isCrsGrp) { global $tree; $parent_ref_id = $tree->getParentId($this->ref_id); include_once "Services/Membership/classes/class.ilParticipants.php"; } include_once "Modules/Forum/classes/class.ilForumProperties.php"; $objFrmProps = ilForumProperties::getInstance(ilObject::_lookupObjId($this->ref_id)); $frm_noti_type = $objFrmProps->getNotificationType(); foreach ($_POST['usr_id'] as $usr_id) { $this->oForumModerators->detachModeratorRole((int) $usr_id); if ($isCrsGrp && $frm_noti_type != 'default') { if (!ilParticipants::_isParticipant($this->ref_id, $usr_id)) { $tmp_frm_noti = new ilForumNotification($this->ref_id); $tmp_frm_noti->setUserId((int) $usr_id); $tmp_frm_noti->setForumId(ilObject::_lookupObjId($this->ref_id)); $tmp_frm_noti->deleteAdminForce(); } } } ilUtil::sendSuccess($this->lng->txt('frm_moderators_detached_role_successfully'), true); $this->ctrl->redirect($this, 'showModerators'); }