moodle/mod/glossary/approve.php
willcast 1ac87c7397 - Rewrite of the internal API in order to, hopefully, create an easy way to handle the flow of data internally and externally.
- Adding a new frame: Browse by Author
- A new, friendly way to show entries (asked by Martin): view?id=cm&mode=term&hook=[concept | alias ]
- Handling user activies, outline and complete.
- Properly showing new entries in recent activity box.
- Adding a flag to categories to specify if a category should or should not be automatically linked.
- Adding some missing strings and files as well.
- Adding a field to each glossary that specify how many entries by pages it should show.
2003-11-15 15:55:47 +00:00

38 lines
1.1 KiB
PHP

<?php
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // Course Module ID
optional_variable($eid); // Entry ID
optional_variable($mode,"approval");
optional_variable($hook,"ALL");
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
}
if (! $glossary = get_record("glossary", "id", $cm->instance)) {
error("Course module is incorrect");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You must be a teacher to use this page.");
}
$newentry->id = $eid;
$newentry->approved = 1;
if (! update_record("glossary_entries", $newentry)) {
error("Could not update your glossary");
} else {
add_to_log($course->id, "glossary", "approve entry", "showentry.php?id=$cm->id&eid=$eid", "$eid");
}
redirect("view.php?id=$cm->id&mode=$mode&hook=$hook",get_string("entryapproved","glossary"),1);
die;
?>