public function trans_format($name) {
        $name = trim($name);

        if ($name == 'moodle_auto_format') {
            return FORMAT_MOODLE;
        } else if ($name == 'html') {
            return FORMAT_HTML;
        } else if ($name == 'plain_text') {
            return FORMAT_PLAIN;
        } else if ($name == 'wiki_like') {
            return FORMAT_WIKI;
        } else if ($name == 'markdown') {
            return FORMAT_MARKDOWN;
        } else {
            debugging("Unrecognised text format '{$name}' in the import file. Assuming 'html'.");
            return FORMAT_HTML;
        }
    }
public function trans_format($name) {
        $name = trim($name);

        if ($name == 'moodle_auto_format') {
            return FORMAT_MOODLE;
        } else if ($name == 'html') {
            return FORMAT_HTML;
        } else if ($name == 'plain_text') {
            return FORMAT_PLAIN;
        } else if ($name == 'wiki_like') {
            return FORMAT_WIKI;
        } else if ($name == 'markdown') {
            return FORMAT_MARKDOWN;
        } else {
            debugging("Unrecognised text format '{$name}' in the import file. Assuming 'html'.");
            return FORMAT_HTML;
        }
    }
public function trans_format ( $ name ) { $ name = trim ( $ name ) ; if ( $ name == 'moodle_auto_format' ) { return FORMAT_MOODLE ; } else if ( $ name == 'html' ) { return FORMAT_HTML ; } else if ( $ name == 'plain_text' ) { return FORMAT_PLAIN ; } else if ( $ name == 'wiki_like' ) { return FORMAT_WIKI ; } else if ( $ name == 'markdown' ) { return FORMAT_MARKDOWN ; } else { debugging ( "Unrecognised text format '{$name}' in the import file. Assuming 'html'." ) ; return FORMAT_HTML ; } }
Translate human readable format name
into internal Moodle code number
Note the reverse function is called get_format.
@param string name format name from xml file
@return int Moodle format code
Translate human readable format name into internal Moodle code number Note the reverse function is called get_format .