Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for Bug #1901 - now "greys out" the privacy of results select if …

…"do not publish" is selected.
  • Loading branch information...
commit 90572dbb907ba629f71fac32c3a97242ccb761bc 1 parent af40722
danmarsden authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 mod/choice/mod.html
View
13 mod/choice/mod.html
@@ -194,12 +194,22 @@
</td>
</tr>
+<script type="text/javascript">
+function lockprivacy() { /* lockoptions() doesn't work with select's so use this method instead.*/
+ if (document.form.release.options[0].selected) {
+ lockoption('form', 'publish');
+ } else {
+ unlockoption('form', 'publish');
+ }
+ return(true);
+}
+</script>
<tr valign="top">
<td align="right"><strong><?php print_string("publish","choice") ?>:</strong></td>
<td>
<?php
require_once("$CFG->dirroot/mod/choice/lib.php");
- choose_from_menu($CHOICE_RELEASE, "release", "$form->release", "");
+ choose_from_menu($CHOICE_RELEASE, "release", "$form->release", "", "return lockprivacy()");
?>
<br />
</td>
@@ -213,6 +223,7 @@
choose_from_menu($CHOICE_PUBLISH, "publish", "$form->publish", "");
?>
<br />
+ <input type="hidden" name="hpublish" value="0" />
</td>
</tr>
Please sign in to comment.
Something went wrong with that request. Please try again.