Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for bug that value of restrictmodules field wasn't available whic…

…h breaks disabling of allowedmods multiple select
  • Loading branch information...
commit 0d26ea7af9fea4cb4123806157d1e7583cc78189 1 parent a44091b
jamiesensei authored
Showing with 5 additions and 3 deletions.
  1. +2 −2 course/edit2.php
  2. +3 −1 course/edit_form.php
View
4 course/edit2.php
@@ -164,9 +164,9 @@
if(!isset($default->defaultrole)) {
$default->defaultrole = 0; // Use site default
}
- include("edit_form.php");
$mform->setDefaults((array)$default);
-
+ include("edit_form.php");
+
/* //setconstant overrides data coming from the form as well as default
//we use this to pass data into the form which we've already processed.
$mform->setConstants(array('id'=>$id,
View
4 course/edit_form.php
@@ -204,7 +204,9 @@
"((this.selectedIndex==0)?true:false);"));
$mods = array(0=>get_string('allownone'));
$mods += get_records_menu("modules", '','','','id, name');
- $disabled=($mform->exportValue('restrictmodules')===0) ? array('disabled' => 'disabled') : array();
+ $disabled=($mform->exportValue('restrictmodules')==1) ? array() :array('disabled' => 'disabled') ;
+
+
$mform->addElement('select', 'allowedmods', get_string("to"),$mods,
array('multiple'=>"multiple", 'size'=>"10", 'id'=>"allowedmods")
+$disabled);
Please sign in to comment.
Something went wrong with that request. Please try again.