|
@@ -34,28 +34,24 @@ switch ($action) {
|
|
|
}
|
|
|
|
|
|
$list = explode(',', $_REQUEST['id']);
|
|
|
-
|
|
|
foreach ($list as $itemId) {
|
|
|
- if (!api_is_session_general_coach() ||
|
|
|
- api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $itemId)
|
|
|
- ) {
|
|
|
- if (!empty($groupId)) {
|
|
|
- $result = AnnouncementManager::get_by_id(
|
|
|
- api_get_course_int_id(),
|
|
|
- $itemId
|
|
|
- );
|
|
|
- if (!empty($result)) {
|
|
|
- $delete = true;
|
|
|
- if (!empty($groupId) && $isTutor) {
|
|
|
- if ($groupId != $result['to_group_id']) {
|
|
|
- $delete = false;
|
|
|
- }
|
|
|
- }
|
|
|
- if ($delete) {
|
|
|
- AnnouncementManager::delete_announcement($courseInfo, $itemId);
|
|
|
+ if (!api_is_session_general_coach() || api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $itemId)) {
|
|
|
+ $result = AnnouncementManager::get_by_id(
|
|
|
+ api_get_course_int_id(),
|
|
|
+ $itemId
|
|
|
+ );
|
|
|
+ if (!empty($result)) {
|
|
|
+ $delete = true;
|
|
|
+ if (!empty($groupId) && $isTutor) {
|
|
|
+ if ($groupId != $result['to_group_id']) {
|
|
|
+ $delete = false;
|
|
|
}
|
|
|
}
|
|
|
+ if ($delete) {
|
|
|
+ AnnouncementManager::delete_announcement($courseInfo, $itemId);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|