From 1ee55c41d9f12fcf7dafb93f9c8ea63a416b412d Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Thu, 17 Feb 2005 19:19:21 +0000 Subject: [PATCH] Give groupmode selection to mod.html for all modules that use groupmode. Also fix bug 2576 --- course/lib.php | 6 +++++- mod/choice/mod.html | 18 +++++++++--------- mod/label/mod.html | 6 +++--- mod/wiki/mod.html | 4 ++-- mod/workshop/mod.html | 4 ++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/course/lib.php b/course/lib.php index e49e152ce89..5ffaf1ab6c0 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1824,7 +1824,11 @@ function print_groupmode_setting($form, $course=NULL) { * Print visibility setting form element on module setup forms in mod/.../mod.html */ function print_visible_setting($form, $course=NULL) { - + if (empty($course)) { + if (! $course = get_record('course', 'id', $form->course)) { + error("This course doesn't exist"); + } + } if ($form->coursemodule) { $visible = get_field('course_modules', 'visible', 'id', $form->coursemodule); } else { diff --git a/mod/choice/mod.html b/mod/choice/mod.html index 94341833420..6e4822d58a7 100644 --- a/mod/choice/mod.html +++ b/mod/choice/mod.html @@ -71,14 +71,14 @@ helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); } else { emoticonhelpbutton("form", "text"); - } + } echo "
"; ?> - text); - + if ($usehtmleditor) { echo ''; } else { @@ -89,7 +89,7 @@ if (!$form->format) { $form->format = $defaultformat; } - choose_from_menu(format_text_menu(), "format", $form->format, ""); + choose_from_menu(format_text_menu(), "format", $form->format, ""); echo ""; } ?> @@ -162,7 +162,7 @@ : - + timeopen and $course->format == "weeks") { $form->timeopen = $course->startdate + (($form->section - 1) * 608400); @@ -170,7 +170,7 @@ print_date_selector("openday", "openmonth", "openyear", $form->timeopen); print_time_selector("openhour", "openminute", $form->timeopen); ?> - + @@ -181,7 +181,7 @@ : - + timeclose and $course->format == "weeks") { $form->timeclose = $course->startdate + (($form->section) * 608400); @@ -189,7 +189,7 @@ print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose); print_time_selector("closehour", "closeminute", $form->timeclose); ?> - + @@ -258,7 +258,7 @@
- +
diff --git a/mod/label/mod.html b/mod/label/mod.html index 863cfd9bc93..e67856f7ebd 100644 --- a/mod/label/mod.html +++ b/mod/label/mod.html @@ -1,4 +1,4 @@ -content)) { $form->content = ''; } @@ -17,7 +17,7 @@ helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); } else { emoticonhelpbutton("form", "description"); - } + } ?>
@@ -28,7 +28,7 @@ ?> - + diff --git a/mod/wiki/mod.html b/mod/wiki/mod.html index 6212669de8d..b2e055dfe34 100644 --- a/mod/wiki/mod.html +++ b/mod/wiki/mod.html @@ -197,13 +197,13 @@ else { $strchooseafile = get_string("chooseafile", "wiki"); echo "initialcontent\" alt=\"".get_string("initialcontent", "wiki")."\" /> "; - button_to_popup_window ("/files/index.php?choose=form.initialcontent&id=$course->id", + button_to_popup_window ("/files/index.php?choose=form.initialcontent&id=$course->id", "wikifiles", $strchooseafile, 500, 750, $strchooseafile); } ?> - + diff --git a/mod/workshop/mod.html b/mod/workshop/mod.html index db34359fe09..172ce89365d 100644 --- a/mod/workshop/mod.html +++ b/mod/workshop/mod.html @@ -329,7 +329,7 @@ : - usepassword, ""); helpbutton("usepassword", get_string("usepassword", "workshop"), "workshop"); @@ -419,7 +419,7 @@ helpbutton("releasegrades", get_string("releaseteachergrades", "workshop"), "workshop"); ?> - +