mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
fix for :
$this->_form->getElement('allowedmods')-> updateAttributes(array('disabled' => 'disabled')) ; that didn't work in PHP 4. (calling a method on a returned object)
This commit is contained in:
parent
c345209c19
commit
e995c46e24
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user