Skip to content

Commit

Permalink
MDL-15926 Merged from 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Aug 4, 2008
1 parent 2953d1b commit ddd9cd0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion course/scales.php
Expand Up @@ -5,6 +5,7 @@
require_once("lib.php");

$id = required_param('id', PARAM_INT); // course id
$scaleid = optional_param('scaleid', 0, PARAM_INT); // scale id (show only this one)

if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error("invalidcourseid");
Expand All @@ -25,9 +26,27 @@
$strhelptext = get_string("helptext");
$stractivities = get_string("activities");


print_header($strscales);

if ($scaleid) {
if ($scale = get_record("scale", 'id', $scaleid)) {
if ($scale->courseid == 0 || $scale->courseid == $course->id) {

$scalemenu = make_menu_from_list($scale->scale);

print_simple_box_start("center");
print_heading($scale->name);
echo "<center>";
choose_from_menu($scalemenu, "", "", "");
echo "</center>";
echo text_to_html($scale->description);
print_simple_box_end();
close_window_button();
exit;
}
}
}

if ($scales = $DB->get_records("scale", array("courseid"=>$course->id), "name ASC")) {
print_heading($strcustomscales);

Expand Down

0 comments on commit ddd9cd0

Please sign in to comment.