Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 15... Línea 15...
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
defined('MOODLE_INTERNAL') || die;
17
defined('MOODLE_INTERNAL') || die;
18
 
18
 
-
 
19
use core\output\comboboxsearch;
19
use core\output\comboboxsearch;
20
use core_grades\output\action_bar;
20
use \core_grades\output\action_bar;
21
use core_grades\output\penalty_indicator;
Línea 21... Línea 22...
21
use core_message\helper;
22
use core_message\helper;
22
use core_message\api;
23
use core_message\api;
Línea 45... Línea 46...
45
     * Renders the group selector trigger element.
46
     * Renders the group selector trigger element.
46
     *
47
     *
47
     * @param object $course The course object.
48
     * @param object $course The course object.
48
     * @param string|null $groupactionbaseurl This parameter has been deprecated since 4.4 and should not be used anymore.
49
     * @param string|null $groupactionbaseurl This parameter has been deprecated since 4.4 and should not be used anymore.
49
     * @return string|null The raw HTML to render.
50
     * @return string|null The raw HTML to render.
-
 
51
     * @deprecated since 4.5. See replacement renderable \core_course\output\actionbar\group_selector instead.
-
 
52
     * @todo Final deprecation in Moodle 6.0. See MDL-82116.
50
     */
53
     */
-
 
54
    #[\core\attribute\deprecated(
-
 
55
        replacement: null,
-
 
56
        since: '4.5',
-
 
57
        reason: 'See replacement renderable \core_course\output\actionbar\group_selector.'
-
 
58
    )]
51
    public function group_selector(object $course, ?string $groupactionbaseurl = null): ?string {
59
    public function group_selector(object $course, ?string $groupactionbaseurl = null): ?string {
52
        global $USER;
60
        global $USER;
Línea -... Línea 61...
-
 
61
 
-
 
62
        \core\deprecation::emit_deprecation([$this, __FUNCTION__]);
53
 
63
 
54
        if ($groupactionbaseurl !== null) {
64
        if ($groupactionbaseurl !== null) {
55
            debugging(
65
            debugging(
56
                'The $groupactionbaseurl argument has been deprecated. Please remove it from your method calls.',
66
                'The $groupactionbaseurl argument has been deprecated. Please remove it from your method calls.',
57
                DEBUG_DEVELOPER,
67
                DEBUG_DEVELOPER,
Línea 101... Línea 111...
101
            true,
111
            true,
102
            $label,
112
            $label,
103
            'group',
113
            'group',
104
            $activegroup
114
            $activegroup
105
        );
115
        );
106
        return $this->render_from_template($groupdropdown->get_template(), $groupdropdown->export_for_template($this));
116
        return $this->render($groupdropdown);
107
    }
117
    }
Línea 108... Línea 118...
108
 
118
 
109
    /**
119
    /**
110
     * Build the data to render the initials bar filter within the gradebook.
120
     * Build the data to render the initials bar filter within the gradebook.
Línea 113... Línea 123...
113
     *
123
     *
114
     * @param object $course The course object.
124
     * @param object $course The course object.
115
     * @param context $context Our current context.
125
     * @param context $context Our current context.
116
     * @param string $slug The slug for the report that called this function.
126
     * @param string $slug The slug for the report that called this function.
117
     * @return stdClass The data to output.
127
     * @return stdClass The data to output.
-
 
128
     * @deprecated since 4.5. See replacement renderable \core_course\output\actionbar\initials_selector instead.
-
 
129
     * @todo Final deprecation in Moodle 6.0. See MDL-82421.
118
     */
130
     */
-
 
131
    #[\core\attribute\deprecated(
-
 
132
        replacement: null,
-
 
133
        since: '4.5',
-
 
134
        reason: 'See replacement renderable \core_course\output\actionbar\initials_selector.'
-
 
135
    )]
119
    public function initials_selector(
136
    public function initials_selector(
120
        object $course,
137
        object $course,
121
        context $context,
138
        context $context,
122
        string $slug
139
        string $slug
123
    ): stdClass {
140
    ): stdClass {
124
        global $SESSION, $COURSE;
141
        global $SESSION, $COURSE;
-
 
142
 
-
 
143
        \core\deprecation::emit_deprecation([$this, __FUNCTION__]);
125
        // User search.
144
        // User search.
126
        $searchvalue = optional_param('gpr_search', null, PARAM_NOTAGS);
145
        $searchvalue = optional_param('gpr_search', null, PARAM_NOTAGS);
127
        $userid = optional_param('grp_userid', null, PARAM_INT);
146
        $userid = optional_param('grp_userid', null, PARAM_INT);
128
        $url = new moodle_url($slug, ['id' => $course->id]);
147
        $url = new moodle_url($slug, ['id' => $course->id]);
129
        $firstinitial = $SESSION->gradereport["filterfirstname-{$context->id}"] ?? '';
148
        $firstinitial = $SESSION->gradereport["filterfirstname-{$context->id}"] ?? '';
Línea 216... Línea 235...
216
            }
235
            }
217
        }
236
        }
Línea 218... Línea 237...
218
 
237
 
219
        return $this->render_from_template('core_grades/user_heading', $headingdata);
238
        return $this->render_from_template('core_grades/user_heading', $headingdata);
-
 
239
    }
-
 
240
 
-
 
241
    /**
-
 
242
     * Renders the penalty indicator.
-
 
243
     *
-
 
244
     * @param penalty_indicator $penaltyindicator
-
 
245
     * @return string The HTML output
-
 
246
     */
-
 
247
    public function render_penalty_indicator(penalty_indicator $penaltyindicator): string {
-
 
248
        $data = $penaltyindicator->export_for_template($this);
-
 
249
        return $this->render_from_template($penaltyindicator->get_template(), $data);
220
    }
250
    }