New Course Formats and Blocks

Re: New Course Formats and Blocks

by John Papaioannou -
Number of replies: 0
Copy paste from the code:

if( isset($formats[$course->format]) ? $formats[$course->format] : !empty($formats['all'])) {
    // Allowed
}

// Translation: if the course format is explicitly accepted/rejected, use
// that setting. Otherwise, fallback to the 'all' format. The empty() test
// uses the trick that empty() fails if 'all' is either !isset() or false.

Jon