if (api_is_allowed_to_edit() && !api_is_anonymous()) { if (!empty($id)) { $res_del = delete_agenda_item($id); if ($res_del) { Display::display_normal_message(get_lang("AgendaDeleteSuccess")); } } } } display_agenda_items(); break; case "showhide": $id = (int) $_GET['id']; if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id))) { // a coach can only delete an element belonging to his session showhide_agenda_item($id); } display_agenda_items(); break; case "announce": //copying the agenda item into an announcement $id = (int) $_GET['id']; if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id))) { // a coach can only delete an element belonging to his session $ann_id = store_agenda_item_as_announcement($id); $tool_group_link = isset($_SESSION['toolgroup']) ? '&toolgroup=' . $_SESSION['toolgroup'] : ''; echo '<br />'; Display::display_normal_message(get_lang('CopiedAsAnnouncement') . '<a href="../announcements/announcements.php?id=' . $ann_id . $tool_group_link . '">' . get_lang('NewAnnouncement') . '</a>', false); } display_agenda_items(); break;
$action = 'view'; } else { show_add_form($event_id, $event_type); } break; case "delete": if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $event_id))) { // a coach can only delete an element belonging to his session delete_agenda_item($event_id); $action = 'view'; } break; case "showhide": if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $event_id))) { // a coach can only delete an element belonging to his session showhide_agenda_item($event_id); $action = 'view'; } if (!empty($_GET['agenda_id'])) { display_one_agenda_item($_GET['agenda_id']); } break; case "delete_attach": //delete attachment file $id_attach = $_GET['id_attach']; if (!empty($id_attach)) { delete_attachment_file($id_attach); $action = 'view'; } break; }