protected static function get_browse_modes_from_display_format($format) {
        global $DB;

        $formats = array();
        $dp = $DB->get_record('glossary_formats', array('name' => $format), '*', IGNORE_MISSING);
        if ($dp) {
            $formats = glossary_get_visible_tabs($dp);
        }

        // Always add 'letter'.
        $modes = array('letter');

        if (in_array('category', $formats)) {
            $modes[] = 'cat';
        }
        if (in_array('date', $formats)) {
            $modes[] = 'date';
        }
        if (in_array('author', $formats)) {
            $modes[] = 'author';
        }

        return $modes;
    }
protected static function get_browse_modes_from_display_format($format) {
        global $DB;

        $formats = array();
        $dp = $DB->get_record('glossary_formats', array('name' => $format), '*', IGNORE_MISSING);
        if ($dp) {
            $formats = glossary_get_visible_tabs($dp);
        }

        // Always add 'letter'.
        $modes = array('letter');

        if (in_array('category', $formats)) {
            $modes[] = 'cat';
        }
        if (in_array('date', $formats)) {
            $modes[] = 'date';
        }
        if (in_array('author', $formats)) {
            $modes[] = 'author';
        }

        return $modes;
    }
protected static function get_browse_modes_from_display_format ( $ format ) { global $ DB ; $ formats = array ( ) ; $ dp = $ DB -> get_record ( 'glossary_formats' , array ( 'name' => $ format ) , '*' , IGNORE_MISSING ) ; if ( $ dp ) { $ formats = glossary_get_visible_tabs ( $ dp ) ; } // Always add 'letter'. $ modes = array ( 'letter' ) ; if ( in_array ( 'category' , $ formats ) ) { $ modes [ ] = 'cat' ; } if ( in_array ( 'date' , $ formats ) ) { $ modes [ ] = 'date' ; } if ( in_array ( 'author' , $ formats ) ) { $ modes [ ] = 'author' ; } return $ modes ; }
Get the browse modes from the display format.

This returns some of the terms that can be used when reporting a glossary being viewed.

@param  string $format The display format of the glossary.
@return array Containing some of all of the following: letter, cat, date, author.
Get the browse modes from the display format .