course)) { error("Course is misconfigured"); } require_login($course->id); if (isguest()) { error("Guests are not allowed to edit ir delete entries", $_SERVER["HTTP_REFERER"]); } if (! $glossary = get_record("glossary", "id", $cm->instance)) { error("Glossary is incorrect"); } $entryfields = get_record("glossary_entries", "id", $entry); $strareyousuredelete = get_string("areyousuredelete","glossary"); if ($course->category) { $navigation = "id\">$course->shortname ->"; } print_header("$course->shortname: $glossary->name", "$course->fullname", "$navigation id>$strglossaries -> $glossary->name", "", "", true, update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm)); /// If data submitted, then process and store. if ($mode == "edit" or $mode == "delete" ) { echo "
"; if ( isteacher($cm->id) or $glossary->studentcanpost ) { if ($go) { // the operation was confirmed. if ( $mode == "delete") { // if it is an imported entry, just delete the relation $entry = get_record("glossary_entries","id", $entry); if ( $entry->sourceglossaryid ) { $entry->glossaryid = $entry->sourceglossaryid; $entry->sourceglossaryid = 0; if (! update_record("glossary_entries", $entry)) { error("Could not update your glossary"); } } else { glossary_delete_old_attachments($entry->id); delete_records("glossary_entries","id", $entry->id); } print_simple_box_start("center","40%", "#FFBBBB"); echo "