if (!empty($id_attach)) { delete_attachment_file($id_attach); } display_agenda_items(); break; } } // this is for students and whenever the courseaministrator has not chosen any action. It is in fact the default behaviour if (!$_GET['action'] or $_GET['action'] == "showall" or $_GET['action'] == "showcurrent" or $_GET['action'] == "view") { if ($_GET['origin'] != 'learnpath') { if (!$_SESSION['view'] or $_SESSION['view'] != 'month') { if (!empty($_GET['agenda_id'])) { display_one_agenda_item((int) $_GET['agenda_id']); } else { display_agenda_items(); } } else { display_monthcalendar($select_month, $select_year); } } else { display_one_agenda_item((int) $_GET['agenda_id']); } } echo " </td></tr></table>"; /* FOOTER */ // The footer is displayed only if we are not in the learnpath if ($_GET['origin'] != 'learnpath') { Display::display_footer(); }
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; } } // The footer is displayed only if we are not in the learnpath if ($origin != 'learnpath') { Display::display_footer();