public function make_toggle($key) {
        $attrs = array('href' => '#');

        // Do proper lang strings for title attributes exist for the given key?
        $strmanager = \get_string_manager();
        $titleall = get_string('all');
        $titlenone = get_string('none');
        if ($strmanager->string_exists(strtolower($key) . 'all', 'gradereport_singleview')) {
            $titleall = get_string(strtolower($key) . 'all', 'gradereport_singleview');
        }
        if ($strmanager->string_exists(strtolower($key) . 'none', 'gradereport_singleview')) {
            $titlenone = get_string(strtolower($key) . 'none', 'gradereport_singleview');
        }

        $all = html_writer::tag('a', get_string('all'), $attrs + array(
            'class' => 'include all ' . $key,
            'title' => $titleall
        ));

        $none = html_writer::tag('a', get_string('none'), $attrs + array(
            'class' => 'include none ' . $key,
            'title' => $titlenone
        ));

        return html_writer::tag('span', "$all / $none", array(
            'class' => 'inclusion_links'
        ));
    }
public function make_toggle($key) {
        $attrs = array('href' => '#');

        // Do proper lang strings for title attributes exist for the given key?
        $strmanager = \get_string_manager();
        $titleall = get_string('all');
        $titlenone = get_string('none');
        if ($strmanager->string_exists(strtolower($key) . 'all', 'gradereport_singleview')) {
            $titleall = get_string(strtolower($key) . 'all', 'gradereport_singleview');
        }
        if ($strmanager->string_exists(strtolower($key) . 'none', 'gradereport_singleview')) {
            $titlenone = get_string(strtolower($key) . 'none', 'gradereport_singleview');
        }

        $all = html_writer::tag('a', get_string('all'), $attrs + array(
            'class' => 'include all ' . $key,
            'title' => $titleall
        ));

        $none = html_writer::tag('a', get_string('none'), $attrs + array(
            'class' => 'include none ' . $key,
            'title' => $titlenone
        ));

        return html_writer::tag('span', "$all / $none", array(
            'class' => 'inclusion_links'
        ));
    }
public function make_toggle ( $ key ) { $ attrs = array ( 'href' => '#' ) ; // Do proper lang strings for title attributes exist for the given key? $ strmanager = \ get_string_manager ( ) ; $ titleall = get_string ( 'all' ) ; $ titlenone = get_string ( 'none' ) ; if ( $ strmanager -> string_exists ( strtolower ( $ key ) . 'all' , 'gradereport_singleview' ) ) { $ titleall = get_string ( strtolower ( $ key ) . 'all' , 'gradereport_singleview' ) ; } if ( $ strmanager -> string_exists ( strtolower ( $ key ) . 'none' , 'gradereport_singleview' ) ) { $ titlenone = get_string ( strtolower ( $ key ) . 'none' , 'gradereport_singleview' ) ; } $ all = html_writer :: tag ( 'a' , get_string ( 'all' ) , $ attrs + array ( 'class' => 'include all ' . $ key , 'title' => $ titleall ) ) ; $ none = html_writer :: tag ( 'a' , get_string ( 'none' ) , $ attrs + array ( 'class' => 'include none ' . $ key , 'title' => $ titlenone ) ) ; return html_writer :: tag ( 'span' , "$all / $none" , array ( 'class' => 'inclusion_links' ) ) ; }
Make the HTML element that toggles all the checkboxes on or off.

@param string $key A unique key for this control - inserted in the classes.
@return string
Make the HTML element that toggles all the checkboxes on or off .