| 1 | efrain | 1 | {{!
 | 
        
           |  |  | 2 |     This file is part of Moodle - http://moodle.org/
 | 
        
           |  |  | 3 |   | 
        
           |  |  | 4 |     Moodle is free software: you can redistribute it and/or modify
 | 
        
           |  |  | 5 |     it under the terms of the GNU General Public License as published by
 | 
        
           |  |  | 6 |     the Free Software Foundation, either version 3 of the License, or
 | 
        
           |  |  | 7 |     (at your option) any later version.
 | 
        
           |  |  | 8 |   | 
        
           |  |  | 9 |     Moodle is distributed in the hope that it will be useful,
 | 
        
           |  |  | 10 |     but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
        
           |  |  | 11 |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
        
           |  |  | 12 |     GNU General Public License for more details.
 | 
        
           |  |  | 13 |   | 
        
           |  |  | 14 |     You should have received a copy of the GNU General Public License
 | 
        
           |  |  | 15 |     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 | 
        
           |  |  | 16 | }}
 | 
        
           |  |  | 17 | {{!
 | 
        
           |  |  | 18 |     @template core_courseformat/local/content/section
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Displays a course section.
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Note: This template is a wrapper around the section/content template to allow course formats and theme designers to
 | 
        
           |  |  | 23 |     modify parts of the wrapper without having to copy/paste the entire template.
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 |     Example context (json):
 | 
        
           |  |  | 26 |     {
 | 
        
           |  |  | 27 |         "num": 3,
 | 
        
           |  |  | 28 |         "id": 35,
 | 
        
           | 1441 | ariadna | 29 |         "sectionname": "Section title",
 | 
        
           | 1 | efrain | 30 |         "controlmenu": "[tools menu]",
 | 
        
           |  |  | 31 |         "header": {
 | 
        
           |  |  | 32 |             "name": "Section title",
 | 
        
           |  |  | 33 |             "title": "<a href=\"http://moodle/course/view.php?id=5#section-0\">Section title</a>",
 | 
        
           |  |  | 34 |             "url": "#",
 | 
        
           | 1441 | ariadna | 35 |             "ishidden": true,
 | 
        
           |  |  | 36 |             "headinglevel": 3
 | 
        
           | 1 | efrain | 37 |         },
 | 
        
           |  |  | 38 |         "cmlist": {
 | 
        
           |  |  | 39 |             "cms": [
 | 
        
           |  |  | 40 |                 {
 | 
        
           |  |  | 41 |                     "cmitem": {
 | 
        
           |  |  | 42 |                         "cmformat": {
 | 
        
           |  |  | 43 |                             "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Forum example</span></a>",
 | 
        
           |  |  | 44 |                             "hasname": "true"
 | 
        
           |  |  | 45 |                         },
 | 
        
           |  |  | 46 |                         "id": 3,
 | 
        
           |  |  | 47 |                         "module": "forum",
 | 
        
           |  |  | 48 |                         "anchor": "activity-3",
 | 
        
           |  |  | 49 |                         "extraclasses": "newmessages"
 | 
        
           |  |  | 50 |                     }
 | 
        
           |  |  | 51 |                 },
 | 
        
           |  |  | 52 |                 {
 | 
        
           |  |  | 53 |                     "cmitem": {
 | 
        
           |  |  | 54 |                         "cmformat": {
 | 
        
           |  |  | 55 |                             "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Assign example</span></a>",
 | 
        
           |  |  | 56 |                             "hasname": "true"
 | 
        
           |  |  | 57 |                         },
 | 
        
           |  |  | 58 |                         "id": 4,
 | 
        
           |  |  | 59 |                         "anchor": "activity-4",
 | 
        
           |  |  | 60 |                         "module": "assign",
 | 
        
           |  |  | 61 |                         "extraclasses": ""
 | 
        
           |  |  | 62 |                     }
 | 
        
           |  |  | 63 |                 }
 | 
        
           |  |  | 64 |             ],
 | 
        
           |  |  | 65 |             "hascms": true
 | 
        
           |  |  | 66 |         },
 | 
        
           |  |  | 67 |         "ishidden": false,
 | 
        
           |  |  | 68 |         "iscurrent": true,
 | 
        
           |  |  | 69 |         "currentlink": "<span class=\"accesshide\">This topic</span>",
 | 
        
           |  |  | 70 |         "availability": {
 | 
        
           |  |  | 71 |             "info": "<span class=\"badge bg-info\">Hidden from students</span>",
 | 
        
           |  |  | 72 |             "hasavailability": true
 | 
        
           |  |  | 73 |         },
 | 
        
           |  |  | 74 |         "summary": {
 | 
        
           |  |  | 75 |             "summarytext": "Summary text!"
 | 
        
           |  |  | 76 |         },
 | 
        
           |  |  | 77 |         "controlmenu": {
 | 
        
           |  |  | 78 |             "menu": "<a href=\"#\" class=\"d-inline-block dropdown-toggle icon-no-margin\">Edit<b class=\"caret\"></b></a>",
 | 
        
           |  |  | 79 |             "hasmenu": true
 | 
        
           |  |  | 80 |         },
 | 
        
           |  |  | 81 |         "cmcontrols": "[Add an activity or resource]",
 | 
        
           |  |  | 82 |         "iscoursedisplaymultipage": true,
 | 
        
           | 1441 | ariadna | 83 |         "sectionreturnnum": 0,
 | 
        
           | 1 | efrain | 84 |         "contentcollapsed": false,
 | 
        
           |  |  | 85 |         "insertafter": true,
 | 
        
           |  |  | 86 |         "numsections": 42,
 | 
        
           |  |  | 87 |         "sitehome": false,
 | 
        
           |  |  | 88 |         "highlightedlabel" : "Highlighted"
 | 
        
           |  |  | 89 |     }
 | 
        
           |  |  | 90 | }}
 | 
        
           |  |  | 91 | <li id="section-{{num}}"
 | 
        
           |  |  | 92 |     class="section course-section main {{#onlysummary}} section-summary {{/onlysummary}} clearfix
 | 
        
           |  |  | 93 |             {{#ishidden}} hidden {{/ishidden}} {{#iscurrent}}{{^displayonesection}} current {{/displayonesection}}{{/iscurrent}}
 | 
        
           |  |  | 94 |             {{#isstealth}} orphaned {{/isstealth}}"
 | 
        
           |  |  | 95 |     data-sectionid="{{num}}"
 | 
        
           | 1441 | ariadna | 96 |     data-sectionreturnnum="{{sectionreturnnum}}"
 | 
        
           | 1 | efrain | 97 |     data-for="section"
 | 
        
           |  |  | 98 |     data-id="{{id}}"
 | 
        
           |  |  | 99 |     data-number="{{num}}"
 | 
        
           | 1441 | ariadna | 100 |     data-sectionname="{{sectionname}}"
 | 
        
           |  |  | 101 |     {{#isstealth}} data-orphan="true" {{/isstealth}}
 | 
        
           | 1 | efrain | 102 | >
 | 
        
           |  |  | 103 |     <div class="section-item">
 | 
        
           | 1441 | ariadna | 104 |         {{$ core_courseformat/local/content/section/content }}
 | 
        
           |  |  | 105 |             {{> core_courseformat/local/content/section/content }}
 | 
        
           |  |  | 106 |         {{/ core_courseformat/local/content/section/content }}
 | 
        
           | 1 | efrain | 107 |     </div>
 | 
        
           |  |  | 108 |   | 
        
           |  |  | 109 |     {{#insertafter}}
 | 
        
           |  |  | 110 |         {{#numsections}}
 | 
        
           |  |  | 111 |             {{$ core_courseformat/local/content/addsection}}
 | 
        
           |  |  | 112 |                 {{> core_courseformat/local/content/section/addsectiondivider }}
 | 
        
           |  |  | 113 |             {{/ core_courseformat/local/content/addsection}}
 | 
        
           |  |  | 114 |         {{/numsections}}
 | 
        
           |  |  | 115 |     {{/insertafter}}
 | 
        
           |  |  | 116 | </li>
 |