Example #1
0
     }
     header('Location: ' . $homeUrl);
     exit;
     break;
 case 'delete_all':
     if (api_is_allowed_to_edit()) {
         AnnouncementManager::delete_all_announcements($_course);
         Display::addFlash(Display::return_message(get_lang('AnnouncementDeletedAll')));
         header('Location: ' . $homeUrl);
         exit;
     }
     break;
 case 'delete_attachment':
     $id = $_GET['id_attach'];
     if (api_is_allowed_to_edit()) {
         AnnouncementManager::delete_announcement_attachment_file($id);
     }
     header('Location: ' . $homeUrl);
     exit;
     break;
 case 'showhide':
     if (!isset($_GET['isStudentView']) || $_GET['isStudentView'] != 'false') {
         if (isset($_GET['id']) && $_GET['id']) {
             if ($sessionId != 0 && api_is_allowed_to_session_edit(false, true) == false) {
                 api_not_allowed();
             }
             if (!api_is_course_coach() || api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $_GET['id'])) {
                 AnnouncementManager::change_visibility_announcement($_course, $_GET['id']);
                 Display::addFlash(Display::return_message(get_lang('VisibilityChanged')));
                 header('Location: ' . $homeUrl);
                 exit;