course)) { error("Course is misconfigured"); } if (! $glossary = get_record("glossary", "id", $cm->instance)) { error("Course module is incorrect"); } require_login($course->id, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/glossary:export', $context); $filename = clean_filename(strip_tags(format_string($glossary->name,true)).'.xml'); $content = glossary_generate_export_file($glossary,$l,$cat); send_file($content, $filename, 0, 0, true, true); ?>