function write_setting($data) {
        $previous = $this->get_setting();

        if ($previous === null) {
            if ($data) {
                $this->regrade_all();
            }
        } else {
            if ($data != $previous) {
                $this->regrade_all();
            }
        }
        return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
    }
function write_setting($data) {
        $previous = $this->get_setting();

        if ($previous === null) {
            if ($data) {
                $this->regrade_all();
            }
        } else {
            if ($data != $previous) {
                $this->regrade_all();
            }
        }
        return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
    }
function write_setting ( $ data ) { $ previous = $ this -> get_setting ( ) ; if ( $ previous === null ) { if ( $ data ) { $ this -> regrade_all ( ) ; } } else { if ( $ data != $ previous ) { $ this -> regrade_all ( ) ; } } return ( $ this -> config_write ( $ this -> name , $ data ) ? '' : get_string ( 'errorsetting' , 'admin' ) ) ; }
Saves the new settings

@param mixed $data
@return string empty string or error message
Saves the new settings