function definition_after_data() {
        $mform   = $this->_form;
        $columns = $this->_customdata['columns'];

        foreach ($columns as $column) {
            if ($mform->elementExists($column)) {
                $mform->removeElement($column);
            }
        }

        if (!in_array('password', $columns)) {
            // password resetting makes sense only if password specified in csv file
            if ($mform->elementExists('uuforcepasswordchange')) {
                $mform->removeElement('uuforcepasswordchange');
            }
        }
    }
function definition_after_data() {
        $mform   = $this->_form;
        $columns = $this->_customdata['columns'];

        foreach ($columns as $column) {
            if ($mform->elementExists($column)) {
                $mform->removeElement($column);
            }
        }

        if (!in_array('password', $columns)) {
            // password resetting makes sense only if password specified in csv file
            if ($mform->elementExists('uuforcepasswordchange')) {
                $mform->removeElement('uuforcepasswordchange');
            }
        }
    }
function definition_after_data ( ) { $ mform = $ this -> _form ; $ columns = $ this -> _customdata [ 'columns' ] ; foreach ( $ columns as $ column ) { if ( $ mform -> elementExists ( $ column ) ) { $ mform -> removeElement ( $ column ) ; } } if ( ! in_array ( 'password' , $ columns ) ) { // password resetting makes sense only if password specified in csv file if ( $ mform -> elementExists ( 'uuforcepasswordchange' ) ) { $ mform -> removeElement ( 'uuforcepasswordchange' ) ; } } }
Form tweaks that depend on current data.
Form tweaks that depend on current data .