Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
<?php
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
namespace core_course\output\actionbar;
18
 
19
use core\output\named_templatable;
20
use core\output\renderable;
21
use core\output\renderer_base;
22
 
23
/**
24
 * Renderable class for the group selection dropdown form.
25
 *
26
 * This form is the content for the group_selector renderable, which itself is an extension of the comboboxsearch component.
27
 * {@see group_selector}.
28
 *
29
 * @package    core_course
30
 * @copyright  2024 Jake Dallimore <jrhdallimore@gmail.com>
31
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 */
33
class group_selector_dropdown_form implements renderable, named_templatable {
34
 
35
    /**
36
     * The class constructor.
37
     *
38
     * @param \context $context The context instance.
39
     */
40
    public function __construct(
41
        protected \context $context
42
    ) {
43
    }
44
 
45
    public function export_for_template(renderer_base $output) {
46
        return [
47
            'courseid' => $this->context->get_course_context()->instanceid,
48
            'currentvalue' => optional_param('groupsearchvalue', '', PARAM_NOTAGS),
49
            'instance' => rand(),
50
        ];
51
    }
52
 
53
    public function get_template_name(renderer_base $renderer): string {
54
        return 'core_group/comboboxsearch/searchbody';
55
    }
56
}