Skip to content

Commit

Permalink
Give groupmode selection to mod.html for all modules that use groupmo…
Browse files Browse the repository at this point in the history
…de. Also fix bug 2576
  • Loading branch information
gustav_delius committed Feb 17, 2005
1 parent 6c35123 commit 1ee55c4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
6 changes: 5 additions & 1 deletion course/lib.php
Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions mod/choice/mod.html
Expand Up @@ -71,14 +71,14 @@
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
emoticonhelpbutton("form", "text");
}
}
echo "<br />";
?>
</td>
<td>
<?php
<?php
print_textarea($usehtmleditor, 20, 60, 680, 400, "text", $form->text);

if ($usehtmleditor) {
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
Expand All @@ -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 "</div>";
}
?>
Expand Down Expand Up @@ -162,15 +162,15 @@
<tr>
<td align="right"><b><?php print_string("choiceopen", "choice") ?>:</b></td>
<td>

<?php
if (!$form->timeopen and $course->format == "weeks") {
$form->timeopen = $course->startdate + (($form->section - 1) * 608400);
}
print_date_selector("openday", "openmonth", "openyear", $form->timeopen);
print_time_selector("openhour", "openminute", $form->timeopen);
?>

<input type="hidden" name="hopenday" value="0" />
<input type="hidden" name="hopenmonth" value="0" />
<input type="hidden" name="hopenyear" value="0" />
Expand All @@ -181,15 +181,15 @@
<tr>
<td align="right"><b><?php print_string("choiceclose", "choice") ?>:</b></td>
<td>

<?php
if (!$form->timeclose and $course->format == "weeks") {
$form->timeclose = $course->startdate + (($form->section) * 608400);
}
print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose);
print_time_selector("closehour", "closeminute", $form->timeclose);
?>

<input type="hidden" name="hcloseday" value="0" />
<input type="hidden" name="hclosemonth" value="0" />
<input type="hidden" name="hcloseyear" value="0" />
Expand Down Expand Up @@ -258,7 +258,7 @@
<br />
</td>
</tr>
<?php print_visible_setting($form); ?>
<?php print_standard_coursemodule_settings($form); ?>
</table>

<center>
Expand Down
6 changes: 3 additions & 3 deletions mod/label/mod.html
@@ -1,4 +1,4 @@
<?php
<?php
if (!isset($form->content)) {
$form->content = '';
}
Expand All @@ -17,7 +17,7 @@
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
emoticonhelpbutton("form", "description");
}
}
?>
<br />
</font>
Expand All @@ -28,7 +28,7 @@
?>
</td>
</tr>

<?php print_visible_setting($form); ?>
</table>
<!-- these hidden variables are always the same -->
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
Expand Down
4 changes: 2 additions & 2 deletions mod/wiki/mod.html
Expand Up @@ -197,13 +197,13 @@
else {
$strchooseafile = get_string("chooseafile", "wiki");
echo "<input type=\"text\" name=\"initialcontent\" size=\"50\" value=\"$form->initialcontent\" alt=\"".get_string("initialcontent", "wiki")."\" />&nbsp;";
button_to_popup_window ("/files/index.php?choose=form.initialcontent&amp;id=$course->id",
button_to_popup_window ("/files/index.php?choose=form.initialcontent&amp;id=$course->id",
"wikifiles", $strchooseafile, 500, 750, $strchooseafile);
}
?>
</td>
</tr>
<?php print_visible_setting($form); ?>
<?php print_standard_coursemodule_settings($form); ?>
</table>
<!-- These hidden variables are always the same -->
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
Expand Down
4 changes: 2 additions & 2 deletions mod/workshop/mod.html
Expand Up @@ -329,7 +329,7 @@
<tr>
<td align="right"><b><?php print_string("usepassword", "workshop"); ?>:</b></td>
<td>
<?php
<?php
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "usepassword", $form->usepassword, "");
helpbutton("usepassword", get_string("usepassword", "workshop"), "workshop");
Expand Down Expand Up @@ -419,7 +419,7 @@
helpbutton("releasegrades", get_string("releaseteachergrades", "workshop"), "workshop");
?></td>
</tr>
<?php print_visible_setting($form); ?>
<?php print_standard_coursemodule_settings($form); ?>
</table>
<br />
<center>
Expand Down

0 comments on commit 1ee55c4

Please sign in to comment.