{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template format_topcoll/toggleall

    Collapsed Topics toggle all template.

    Context variables required for this template:
    * ariacontrols - Aria controls references.
    * iconset - Icons set used.
    * rtl - Right to left?
    * sctcloseall - Close all string.
    * sctopenalall - Close all string.
    * spacer - Spacer markup.
    * toggleallhover - Change the toggle all icon on hover.
    * tctoggleiconsize - Toggle icon size.

    Example context (json):
    {
        "ariacontrols": "toggledsection-1 toggledsection-2",
        "iconset": "point",
        "rtl": false,
        "sctcloseall": "Close all",
        "sctopenall": "Open all",
        "spacer": "",
        "toggleallhover": true,
        "tctoggleiconsize": "medium"
    }
}}
<li id="toggle-all" class="tcsection main clearfix">
    {{#spacer}}
    <div class="{{^rtl}}left{{/rtl}}{{#rtl}}right{{/rtl}} side">{{{spacer}}}</div>
    {{/spacer}}
    <div class="content">
        <div class="sectionbody toggle-all-content toggle-{{iconset}} {{#toggleallhover}}toggle-{{iconset}}-hover{{/toggleallhover}}">
            <h4 id="toggles-all-opened" class="toggle-all on {{tctoggleiconsize}}" role="button" title="{{sctopenall}}" tabindex="0" aria-controls="{{ariacontrols}}">
                {{#str}}topcollopened, format_topcoll{{/str}}
            </h4>
            <h4 id="toggles-all-closed" class="toggle-all off {{tctoggleiconsize}}" role="button" title="{{sctcloseall}}" tabindex="0" aria-controls="{{ariacontrols}}">
                {{#str}}topcollclosed, format_topcoll{{/str}}
            </h4>
        </div>
    </div>
    {{#spacer}}
    <div class="{{^rtl}}right{{/rtl}}{{#rtl}}left{{/rtl}} side">{{{spacer}}}</div>
    {{/spacer}}
</li>
