| Línea 86... |
Línea 86... |
| 86 |
* Renders the user selector trigger element.
|
86 |
* Renders the user selector trigger element.
|
| 87 |
*
|
87 |
*
|
| 88 |
* @param object $course The course object.
|
88 |
* @param object $course The course object.
|
| 89 |
* @param int|null $userid The user ID.
|
89 |
* @param int|null $userid The user ID.
|
| 90 |
* @param int|null $groupid The group ID.
|
90 |
* @param int|null $groupid The group ID.
|
| - |
|
91 |
* @param string $usersearch Search string.
|
| 91 |
* @return string The raw HTML to render.
|
92 |
* @return string The raw HTML to render.
|
| 92 |
* @throws coding_exception
|
93 |
* @throws coding_exception
|
| - |
|
94 |
* @deprecated since Moodle 4.5. See user_selector use in \gradereport_user\output\action_bar::export_for_template.
|
| 93 |
*/
|
95 |
*/
|
| 94 |
public function users_selector(object $course, ?int $userid = null, ?int $groupid = null): string {
|
96 |
public function users_selector(object $course, ?int $userid = null, ?int $groupid = null, string $usersearch = ''): string {
|
| 95 |
$resetlink = new moodle_url('/grade/report/user/index.php', ['id' => $course->id, 'group' => 0]);
|
- |
|
| 96 |
$submitteduserid = optional_param('userid', '', PARAM_INT);
|
- |
|
| Línea 97... |
Línea -... |
| 97 |
|
- |
|
| 98 |
if ($submitteduserid) {
|
97 |
|
| 99 |
$user = core_user::get_user($submitteduserid);
|
- |
|
| 100 |
$currentvalue = fullname($user);
|
- |
|
| 101 |
} else {
|
- |
|
| 102 |
$currentvalue = '';
|
- |
|
| Línea 103... |
Línea 98... |
| 103 |
}
|
98 |
debugging('users_selector is deprecated.', DEBUG_DEVELOPER);
|
| 104 |
|
99 |
|
| 105 |
$data = [
|
100 |
$courserenderer = $this->page->get_renderer('core', 'course');
|
| 106 |
'currentvalue' => $currentvalue,
|
101 |
$resetlink = new moodle_url('/grade/report/user/index.php', ['id' => $course->id, 'group' => 0]);
|
| 107 |
'instance' => rand(),
|
102 |
$baseurl = new moodle_url('/grade/report/user/index.php', ['id' => $course->id]);
|
| 108 |
'resetlink' => $resetlink->out(false),
|
103 |
$this->page->requires->js_call_amd('gradereport_user/user', 'init', [$baseurl->out(false)]);
|
| 109 |
'name' => 'userid',
|
104 |
return $courserenderer->render(
|
| 110 |
'value' => $submitteduserid ?? '',
|
105 |
new \core_course\output\actionbar\user_selector(
|
| 111 |
'courseid' => $course->id,
|
- |
|
| 112 |
'group' => $groupid ?? 0,
|
- |
|
| 113 |
];
|
- |
|
| 114 |
|
106 |
course: $course,
|
| 115 |
$searchdropdown = new comboboxsearch(
|
- |
|
| 116 |
true,
|
- |
|
| 117 |
$this->render_from_template('core_user/comboboxsearch/user_selector', $data),
|
107 |
resetlink: $resetlink,
|
| 118 |
null,
|
- |
|
| 119 |
'user-search d-flex',
|
108 |
userid: $userid,
|
| 120 |
null,
|
109 |
groupid: $groupid,
|
| 121 |
'usersearchdropdown overflow-auto',
|
- |
|
| 122 |
null,
|
110 |
usersearch: $usersearch
|
| 123 |
false,
|
- |
|
| 124 |
);
|
- |
|
| 125 |
$this->page->requires->js_call_amd('gradereport_user/user', 'init');
|
111 |
)
|
| Línea 126... |
Línea 112... |
| 126 |
return $this->render_from_template($searchdropdown->get_template(), $searchdropdown->export_for_template($this));
|
112 |
);
|
| 127 |
}
|
113 |
}
|
| 128 |
|
114 |
|
| Línea 184... |
Línea 170... |
| 184 |
*
|
170 |
*
|
| 185 |
* @param int $userid The selected userid
|
171 |
* @param int $userid The selected userid
|
| 186 |
* @param int $userview The current view user setting constant
|
172 |
* @param int $userview The current view user setting constant
|
| 187 |
* @param int $courseid The course ID.
|
173 |
* @param int $courseid The course ID.
|
| 188 |
* @return string The raw HTML to render.
|
174 |
* @return string The raw HTML to render.
|
| - |
|
175 |
* @deprecated since Moodle 4.5 See select_menu use in \gradereport_user\output\action_bar::export_for_template.
|
| 189 |
*/
|
176 |
*/
|
| 190 |
public function view_mode_selector(int $userid, int $userview, int $courseid): string {
|
177 |
public function view_mode_selector(int $userid, int $userview, int $courseid): string {
|
| Línea -... |
Línea 178... |
| - |
|
178 |
|
| - |
|
179 |
debugging('view_mode_selector is deprecated.', DEBUG_DEVELOPER);
|
| 191 |
|
180 |
|
| 192 |
$viewasotheruser = new moodle_url('/grade/report/user/index.php', ['id' => $courseid, 'userid' => $userid,
|
181 |
$viewasotheruser = new moodle_url('/grade/report/user/index.php', ['id' => $courseid, 'userid' => $userid,
|
| 193 |
'userview' => GRADE_REPORT_USER_VIEW_USER]);
|
182 |
'userview' => GRADE_REPORT_USER_VIEW_USER]);
|
| 194 |
$viewasmyself = new moodle_url('/grade/report/user/index.php', ['id' => $courseid, 'userid' => $userid,
|
183 |
$viewasmyself = new moodle_url('/grade/report/user/index.php', ['id' => $courseid, 'userid' => $userid,
|