Skip to content

Commit

Permalink
fix for :
Browse files Browse the repository at this point in the history
$this->_form->getElement('allowedmods')->
                        updateAttributes(array('disabled' => 'disabled')) ;
 that didn't work in PHP 4. (calling a method on a returned object)
  • Loading branch information
jamiesensei committed Oct 19, 2006
1 parent c345209 commit e995c46
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions course/edit_form.php
Expand Up @@ -308,7 +308,7 @@ function definition() {
$mform->setHelpButton('costgrp', array('cost', get_string('cost')), true);
$mform->setDefault('cost', '');
$mform->setDefault('currency', empty($CFG->enrol_currency) ? 'USD' : $CFG->enrol_currency);

}

//--------------------------------------------------------------------------------
Expand Down Expand Up @@ -373,15 +373,16 @@ function definition() {

}
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){
Expand Down

0 comments on commit e995c46

Please sign in to comment.