本文整理汇总了PHP中ilCourseParticipants::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCourseParticipants::delete方法的具体用法?PHP ilCourseParticipants::delete怎么用?PHP ilCourseParticipants::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCourseParticipants
的用法示例。
在下文中一共展示了ilCourseParticipants::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirmedUnsubscribe
public function confirmedUnsubscribe()
{
global $ilCtrl, $ilAccess, $ilUser;
if (!sizeof($_POST["ref_id"])) {
$ilCtrl->redirect($this, "manage");
}
foreach ($_POST["ref_id"] as $ref_id) {
if ($ilAccess->checkAccess("leave", "", $ref_id)) {
switch (ilObject::_lookupType($ref_id, true)) {
case "crs":
// see ilObjCourseGUI:performUnsubscribeObject()
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
$members = new ilCourseParticipants(ilObject::_lookupObjId($ref_id));
$members->delete($ilUser->getId());
$members->sendUnsubscribeNotificationToAdmins($ilUser->getId());
$members->sendNotification($members->NOTIFY_UNSUBSCRIBE, $ilUser->getId());
break;
case "grp":
// see ilObjGroupGUI:performUnsubscribeObject()
include_once "Modules/Group/classes/class.ilGroupParticipants.php";
$members = new ilGroupParticipants(ilObject::_lookupObjId($ref_id));
$members->delete($ilUser->getId());
include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
$members->sendNotification(ilGroupMembershipMailNotification::TYPE_UNSUBSCRIBE_MEMBER, $ilUser->getId());
$members->sendNotification(ilGroupMembershipMailNotification::TYPE_NOTIFICATION_UNSUBSCRIBE, $ilUser->getId());
break;
default:
// do nothing
continue;
}
include_once './Modules/Forum/classes/class.ilForumNotification.php';
ilForumNotification::checkForumsExistsDelete($ref_id, $ilUser->getId());
}
}
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
}