]> git.mjollnir.org Git - moodle.git/commitdiff
fix for :
authorjamiesensei <jamiesensei>
Thu, 19 Oct 2006 07:12:11 +0000 (07:12 +0000)
committerjamiesensei <jamiesensei>
Thu, 19 Oct 2006 07:12:11 +0000 (07:12 +0000)
$this->_form->getElement('allowedmods')->
                        updateAttributes(array('disabled' => 'disabled')) ;
 that didn't work in PHP 4. (calling a method on a returned object)

course/edit_form.php

index 71e29854b5fd1099ace19698a98ec7a2f48b9fd1..1729bddd8ee4b17350aa0aaaf71e4ca78ec3a1eb 100644 (file)
@@ -308,7 +308,7 @@ class course_edit_form extends moodleform {
             $mform->setHelpButton('costgrp', array('cost', get_string('cost')), true);
             $mform->setDefault('cost', '');
             $mform->setDefault('currency', empty($CFG->enrol_currency) ? 'USD' : $CFG->enrol_currency);
-            
+
         }
 
 //--------------------------------------------------------------------------------
@@ -373,15 +373,16 @@ class course_edit_form extends moodleform {
 
     }
     function definition_after_data(){
-        
-        if ($this->_form->elementExists('allowedmods')){
-            if ($this->_form->exportValue('restrictmodules')!=1){
-                $this->_form->getElement('allowedmods')->
-                        updateAttributes(array('disabled' => 'disabled')) ;
-            }
-            
-        }
-    }
+       $mform=&$this->_form;
+       if ($mform->elementExists('allowedmods')){
+           if ($mform->exportValue('restrictmodules')!=1){
+               $allowedmods=&$mform->getElement('allowedmods');
+               $allowedmods->
+                       updateAttributes(array('disabled'
+                        => 'disabled')) ;
+           }
+       }
+   }
 
 /// perform some extra moodle validation
     function validation($data){