1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
|
5 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
6 |
(at your option) any later version.
|
|
|
7 |
Moodle is distributed in the hope that it will be useful,
|
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
GNU General Public License for more details.
|
|
|
11 |
You should have received a copy of the GNU General Public License
|
|
|
12 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13 |
}}
|
|
|
14 |
{{!
|
|
|
15 |
@template core_group/comboboxsearch/resultset
|
|
|
16 |
|
|
|
17 |
Wrapping template for returned result items.
|
|
|
18 |
|
|
|
19 |
Context variables required for this template:
|
|
|
20 |
* groups - Our returned groups to render.
|
|
|
21 |
* instance - The instance ID of the combo box.
|
|
|
22 |
* searchterm - The entered text to find these results.
|
|
|
23 |
* hasgroups - Allow the handling where no users exist for the returned search term.
|
|
|
24 |
|
|
|
25 |
Example context (json):
|
|
|
26 |
{
|
|
|
27 |
"groups": [
|
|
|
28 |
{
|
|
|
29 |
"id": 2,
|
|
|
30 |
"name": "Foo bar",
|
|
|
31 |
"link": "http://foo.bar/grade/report/grader/index.php?id=42&userid=2"
|
|
|
32 |
},
|
|
|
33 |
{
|
|
|
34 |
"id": 3,
|
|
|
35 |
"name": "Bar Foo",
|
|
|
36 |
"link": "http://foo.bar/grade/report/grader/index.php?id=42&userid=3"
|
|
|
37 |
}
|
|
|
38 |
],
|
|
|
39 |
"instance": 25,
|
|
|
40 |
"searchterm": "Foo",
|
|
|
41 |
"hasresults": true
|
|
|
42 |
}
|
|
|
43 |
}}
|
|
|
44 |
{{<core/local/comboboxsearch/resultset}}
|
|
|
45 |
{{$listid}}groups{{/listid}}
|
|
|
46 |
{{$results}}
|
|
|
47 |
{{#groups}}
|
|
|
48 |
{{>core_group/comboboxsearch/resultitem}}
|
|
|
49 |
{{/groups}}
|
|
|
50 |
{{/results}}
|
|
|
51 |
{{/core/local/comboboxsearch/resultset}}
|