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_user/comboboxsearch/user_selector
|
|
|
19 |
|
|
|
20 |
The user selector trigger element.
|
|
|
21 |
|
|
|
22 |
Context variables required for this template:
|
|
|
23 |
* name - The name of the input element representing the user search combobox.
|
|
|
24 |
* value - The value of the input element representing the user search combobox.
|
|
|
25 |
* currentvalue - If the user has already searched, set the value to that.
|
|
|
26 |
* courseid - The course ID.
|
|
|
27 |
* group - The group ID.
|
|
|
28 |
* resetlink - The link to reset the page.
|
|
|
29 |
|
|
|
30 |
Example context (json):
|
|
|
31 |
{
|
|
|
32 |
"name": "input-1",
|
|
|
33 |
"value": "0",
|
|
|
34 |
"currentvalue": "bar",
|
|
|
35 |
"courseid": 2,
|
|
|
36 |
"group": 25,
|
|
|
37 |
"resetlink": "grade/report/grader/index.php?id=2"
|
|
|
38 |
}
|
|
|
39 |
}}
|
|
|
40 |
<span class="d-none" data-region="courseid" data-courseid="{{courseid}}"></span>
|
|
|
41 |
<span class="d-none" data-region="groupid" data-groupid="{{group}}"></span>
|
|
|
42 |
<span class="d-none" data-region="instance" data-instance="{{instance}}"></span>
|
|
|
43 |
{{< core/search_input_auto }}
|
|
|
44 |
{{$label}}{{#str}}searchusers, core{{/str}}{{/label}}
|
|
|
45 |
{{$placeholder}}{{#str}}searchusers, core{{/str}}{{/placeholder}}
|
|
|
46 |
{{$value}}{{currentvalue}}{{/value}}
|
|
|
47 |
{{$additionalattributes}}
|
|
|
48 |
role="combobox"
|
|
|
49 |
aria-expanded="false"
|
|
|
50 |
aria-controls="user-{{instance}}-result-listbox"
|
|
|
51 |
aria-autocomplete="list"
|
|
|
52 |
aria-haspopup="listbox"
|
|
|
53 |
data-input-element="user-input-{{uniqid}}-{{instance}}"
|
|
|
54 |
{{/additionalattributes}}
|
|
|
55 |
{{/ core/search_input_auto }}
|
|
|
56 |
{{#currentvalue}}
|
|
|
57 |
<a class="ml-2 btn btn-link border-0 align-self-center" href="{{resetlink}}" data-action="resetpage" role="link" aria-label="{{#str}}clearsearch, core{{/str}}">
|
|
|
58 |
{{#str}}clear{{/str}}
|
|
|
59 |
</a>
|
|
|
60 |
{{/currentvalue}}
|
|
|
61 |
<input type="hidden" name="{{name}}" value="{{value}}" id="user-input-{{uniqid}}-{{instance}}"/>
|