2003-10-21 04:55:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../../config.php");
|
|
|
|
require_once("lib.php");
|
|
|
|
|
|
|
|
require_variable($id); // Course Module ID
|
|
|
|
optional_variable($eid); // Entry ID
|
|
|
|
|
2003-11-15 15:55:47 +00:00
|
|
|
optional_variable($mode,"approval");
|
|
|
|
optional_variable($hook,"ALL");
|
2003-10-21 04:55:22 +00:00
|
|
|
|
|
|
|
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 {
|
2004-02-18 20:52:44 +00:00
|
|
|
add_to_log($course->id, "glossary", "approve entry", "showentry.php?id=$cm->id&eid=$eid", "$eid",$cm->id);
|
2003-10-21 04:55:22 +00:00
|
|
|
}
|
2003-11-15 15:55:47 +00:00
|
|
|
redirect("view.php?id=$cm->id&mode=$mode&hook=$hook",get_string("entryapproved","glossary"),1);
|
2003-10-21 04:55:22 +00:00
|
|
|
die;
|
2004-02-18 20:52:44 +00:00
|
|
|
?>
|