Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 1... Línea 1...
1
<?php
1
<?php
2
 
-
 
3
// This file is part of Moodle - http://moodle.org/
2
// This file is part of Moodle - http://moodle.org/
4
//
3
//
5
// Moodle is free software: you can redistribute it and/or modify
4
// Moodle is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
5
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
6
// the Free Software Foundation, either version 3 of the License, or
Línea 28... Línea 27...
28
 * @deprecated
27
 * @deprecated
29
 */
28
 */
Línea 30... Línea 29...
30
 
29
 
Línea 31... Línea -...
31
defined('MOODLE_INTERNAL') || die();
-
 
32
 
-
 
33
/* === Functions that needs to be kept longer in deprecated lib than normal time period === */
-
 
34
 
-
 
35
/**
-
 
36
 * @deprecated since 2.7 use new events instead
-
 
37
 */
-
 
38
function add_to_log() {
-
 
39
    throw new coding_exception('add_to_log() has been removed, please rewrite your code to the new events API');
-
 
40
}
-
 
41
 
-
 
42
/**
-
 
43
 * @deprecated since 2.6
-
 
44
 */
-
 
45
function events_trigger() {
-
 
46
    throw new coding_exception('events_trigger() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
47
}
30
defined('MOODLE_INTERNAL') || die();
48
 
31
 
49
/**
32
/**
50
 * List all core subsystems and their location
33
 * List all core subsystems and their location
51
 *
34
 *
Línea 57... Línea 40...
57
 * The location is optionally dirroot relative path. NULL means there is no special
40
 * The location is optionally dirroot relative path. NULL means there is no special
58
 * directory for this subsystem. If the location is set, the subsystem's
41
 * directory for this subsystem. If the location is set, the subsystem's
59
 * renderer.php is expected to be there.
42
 * renderer.php is expected to be there.
60
 *
43
 *
61
 * @deprecated since 2.6, use core_component::get_core_subsystems()
44
 * @deprecated since 2.6, use core_component::get_core_subsystems()
62
 *
-
 
63
 * @param bool $fullpaths false means relative paths from dirroot, use true for performance reasons
45
 * @param bool $fullpaths false means relative paths from dirroot, use true for performance reasons
64
 * @return array of (string)name => (string|null)location
46
 * @return array of (string)name => (string|null)location
65
 */
47
 */
-
 
48
#[\core\attribute\deprecated('core_component::get_core_subsystems', since: '4.5', mdl: 'MDL-82287')]
66
function get_core_subsystems($fullpaths = false) {
49
function get_core_subsystems($fullpaths = false) {
-
 
50
    \core\deprecation::emit_deprecation(__FUNCTION__);
67
    global $CFG;
51
    global $CFG;
Línea 68... Línea -...
68
 
-
 
69
    // NOTE: do not add any other debugging here, keep forever.
-
 
70
 
52
 
Línea 71... Línea 53...
71
    $subsystems = core_component::get_core_subsystems();
53
    $subsystems = core_component::get_core_subsystems();
72
 
54
 
73
    if ($fullpaths) {
55
    if ($fullpaths) {
Línea 90... Línea 72...
90
 
72
 
91
/**
73
/**
92
 * Lists all plugin types.
74
 * Lists all plugin types.
93
 *
75
 *
94
 * @deprecated since 2.6, use core_component::get_plugin_types()
-
 
95
 *
76
 * @deprecated since 2.6, use core_component::get_plugin_types()
96
 * @param bool $fullpaths false means relative paths from dirroot
77
 * @param bool $fullpaths false means relative paths from dirroot
97
 * @return array Array of strings - name=>location
78
 * @return array Array of strings - name=>location
-
 
79
 */
98
 */
80
#[\core\attribute\deprecated('core_component::get_plugin_types', since: '4.5', mdl: 'MDL-82287')]
-
 
81
function get_plugin_types($fullpaths = true) {
99
function get_plugin_types($fullpaths = true) {
82
    \core\deprecation::emit_deprecation(__FUNCTION__);
Línea 100... Línea -...
100
    global $CFG;
-
 
101
 
-
 
102
    // NOTE: do not add any other debugging here, keep forever.
83
    global $CFG;
Línea 103... Línea 84...
103
 
84
 
104
    $types = core_component::get_plugin_types();
85
    $types = core_component::get_plugin_types();
105
 
86
 
Línea 124... Línea 105...
124
 
105
 
125
/**
106
/**
126
 * Use when listing real plugins of one type.
107
 * Use when listing real plugins of one type.
127
 *
108
 *
128
 * @deprecated since 2.6, use core_component::get_plugin_list()
-
 
129
 *
109
 * @deprecated since 2.6, use core_component::get_plugin_list()
130
 * @param string $plugintype type of plugin
110
 * @param string $plugintype type of plugin
131
 * @return array name=>fulllocation pairs of plugins of given type
111
 * @return array name=>fulllocation pairs of plugins of given type
-
 
112
 */
132
 */
113
#[\core\attribute\deprecated('core_component::get_plugin_list', since: '4.5', mdl: 'MDL-82287')]
133
function get_plugin_list($plugintype) {
-
 
134
 
114
function get_plugin_list($plugintype) {
Línea 135... Línea 115...
135
    // NOTE: do not add any other debugging here, keep forever.
115
    \core\deprecation::emit_deprecation(__FUNCTION__);
136
 
116
 
137
    if ($plugintype === '') {
117
    if ($plugintype === '') {
Línea 144... Línea 124...
144
/**
124
/**
145
 * Get a list of all the plugins of a given type that define a certain class
125
 * Get a list of all the plugins of a given type that define a certain class
146
 * in a certain file. The plugin component names and class names are returned.
126
 * in a certain file. The plugin component names and class names are returned.
147
 *
127
 *
148
 * @deprecated since 2.6, use core_component::get_plugin_list_with_class()
128
 * @deprecated since 2.6, use core_component::get_plugin_list_with_class()
149
 *
-
 
150
 * @param string $plugintype the type of plugin, e.g. 'mod' or 'report'.
129
 * @param string $plugintype the type of plugin, e.g. 'mod' or 'report'.
151
 * @param string $class the part of the name of the class after the
130
 * @param string $class the part of the name of the class after the
152
 *      frankenstyle prefix. e.g 'thing' if you are looking for classes with
131
 *      frankenstyle prefix. e.g 'thing' if you are looking for classes with
153
 *      names like report_courselist_thing. If you are looking for classes with
132
 *      names like report_courselist_thing. If you are looking for classes with
154
 *      the same name as the plugin name (e.g. qtype_multichoice) then pass ''.
133
 *      the same name as the plugin name (e.g. qtype_multichoice) then pass ''.
155
 * @param string $file the name of file within the plugin that defines the class.
134
 * @param string $file the name of file within the plugin that defines the class.
156
 * @return array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum')
135
 * @return array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum')
157
 *      and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice').
136
 *      and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice').
158
 */
137
 */
-
 
138
#[\core\attribute\deprecated('core_component::get_plugin_list_with_class', since: '4.5', mdl: 'MDL-82287')]
159
function get_plugin_list_with_class($plugintype, $class, $file) {
139
function get_plugin_list_with_class($plugintype, $class, $file) {
160
 
-
 
161
    // NOTE: do not add any other debugging here, keep forever.
140
    \core\deprecation::emit_deprecation(__FUNCTION__);
162
 
-
 
163
    return core_component::get_plugin_list_with_class($plugintype, $class, $file);
141
    return core_component::get_plugin_list_with_class($plugintype, $class, $file);
164
}
142
}
Línea 165... Línea 143...
165
 
143
 
166
/**
144
/**
167
 * Returns the exact absolute path to plugin directory.
145
 * Returns the exact absolute path to plugin directory.
168
 *
146
 *
169
 * @deprecated since 2.6, use core_component::get_plugin_directory()
-
 
170
 *
147
 * @deprecated since 2.6, use core_component::get_plugin_directory()
171
 * @param string $plugintype type of plugin
148
 * @param string $plugintype type of plugin
172
 * @param string $name name of the plugin
149
 * @param string $name name of the plugin
173
 * @return string full path to plugin directory; NULL if not found
150
 * @return string full path to plugin directory; NULL if not found
-
 
151
 */
174
 */
152
#[\core\attribute\deprecated('core_component::get_plugin_directory', since: '4.5', mdl: 'MDL-82287')]
175
function get_plugin_directory($plugintype, $name) {
-
 
176
 
153
function get_plugin_directory($plugintype, $name) {
177
    // NOTE: do not add any other debugging here, keep forever.
-
 
178
 
154
    \core\deprecation::emit_deprecation(__FUNCTION__);
179
    if ($plugintype === '') {
155
    if ($plugintype === '') {
180
        $plugintype = 'mod';
156
        $plugintype = 'mod';
Línea 181... Línea 157...
181
    }
157
    }
Línea 185... Línea 161...
185
 
161
 
186
/**
162
/**
187
 * Normalize the component name using the "frankenstyle" names.
163
 * Normalize the component name using the "frankenstyle" names.
188
 *
164
 *
189
 * @deprecated since 2.6, use core_component::normalize_component()
-
 
190
 *
165
 * @deprecated since 2.6, use core_component::normalize_component()
191
 * @param string $component
166
 * @param string $component
192
 * @return array two-items list of [(string)type, (string|null)name]
167
 * @return array two-items list of [(string)type, (string|null)name]
-
 
168
 */
193
 */
169
#[\core\attribute\deprecated('core_component::normalize_component', since: '4.5', mdl: 'MDL-82287')]
194
function normalize_component($component) {
-
 
195
 
170
function normalize_component($component) {
196
    // NOTE: do not add any other debugging here, keep forever.
-
 
197
 
171
    \core\deprecation::emit_deprecation(__FUNCTION__);
198
    return core_component::normalize_component($component);
172
    return core_component::normalize_component($component);
Línea 199... Línea 173...
199
}
173
}
200
 
174
 
Línea 204... Línea 178...
204
 * @deprecated since 2.6, use core_component::normalize_component()
178
 * @deprecated since 2.6, use core_component::normalize_component()
205
 *
179
 *
206
 * @param string $component name such as 'moodle', 'mod_forum'
180
 * @param string $component name such as 'moodle', 'mod_forum'
207
 * @return string full path to component directory; NULL if not found
181
 * @return string full path to component directory; NULL if not found
208
 */
182
 */
-
 
183
#[\core\attribute\deprecated('core_component::get_component_directory', since: '4.5', mdl: 'MDL-82287')]
209
function get_component_directory($component) {
184
function get_component_directory($component) {
210
 
-
 
211
    // NOTE: do not add any other debugging here, keep forever.
185
    \core\deprecation::emit_deprecation(__FUNCTION__);
212
 
-
 
213
    return core_component::get_component_directory($component);
186
    return core_component::get_component_directory($component);
214
}
187
}
Línea 215... Línea 188...
215
 
188
 
216
/**
-
 
217
 * Get the context instance as an object. This function will create the
-
 
218
 * context instance if it does not exist yet.
-
 
219
 *
189
/**
220
 * @deprecated since 2.2, use context_course::instance() or other relevant class instead
-
 
221
 * @todo This will be deleted in Moodle 2.8, refer MDL-34472
-
 
222
 * @param integer $contextlevel The context level, for example CONTEXT_COURSE, or CONTEXT_MODULE.
-
 
223
 * @param integer $instance The instance id. For $level = CONTEXT_COURSE, this would be $course->id,
-
 
224
 *      for $level = CONTEXT_MODULE, this would be $cm->id. And so on. Defaults to 0
-
 
225
 * @param int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
-
 
226
 *      MUST_EXIST means throw exception if no record or multiple records found
-
 
227
 * @return context The context object.
-
 
228
 */
-
 
229
function get_context_instance($contextlevel, $instance = 0, $strictness = IGNORE_MISSING) {
-
 
230
 
-
 
231
    debugging('get_context_instance() is deprecated, please use context_xxxx::instance() instead.', DEBUG_DEVELOPER);
-
 
232
 
-
 
233
    $instances = (array)$instance;
-
 
234
    $contexts = array();
-
 
235
 
-
 
236
    $classname = context_helper::get_class_for_level($contextlevel);
-
 
237
 
-
 
238
    // we do not load multiple contexts any more, PAGE should be responsible for any preloading
-
 
239
    foreach ($instances as $inst) {
-
 
240
        $contexts[$inst] = $classname::instance($inst, $strictness);
-
 
241
    }
-
 
242
 
-
 
243
    if (is_array($instance)) {
-
 
244
        return $contexts;
-
 
245
    } else {
-
 
246
        return $contexts[$instance];
-
 
247
    }
-
 
248
}
-
 
249
/* === End of long term deprecated api list === */
-
 
250
 
-
 
251
/**
-
 
252
 * @deprecated since 2.7 - use new file picker instead
-
 
253
 */
-
 
254
function clam_log_upload() {
-
 
255
    throw new coding_exception('clam_log_upload() can not be used any more, please use file picker instead');
-
 
256
}
-
 
257
 
-
 
258
/**
-
 
259
 * @deprecated since 2.7 - use new file picker instead
-
 
260
 */
-
 
261
function clam_log_infected() {
-
 
262
    throw new coding_exception('clam_log_infected() can not be used any more, please use file picker instead');
-
 
263
}
-
 
264
 
-
 
265
/**
-
 
266
 * @deprecated since 2.7 - use new file picker instead
-
 
267
 */
-
 
268
function clam_change_log() {
-
 
269
    throw new coding_exception('clam_change_log() can not be used any more, please use file picker instead');
-
 
270
}
-
 
271
 
-
 
272
/**
-
 
273
 * @deprecated since 2.7 - infected files are now deleted in file picker
-
 
274
 */
-
 
275
function clam_replace_infected_file() {
-
 
276
    throw new coding_exception('clam_replace_infected_file() can not be used any more, please use file picker instead');
-
 
277
}
-
 
278
 
-
 
279
/**
-
 
280
 * @deprecated since 2.7
-
 
281
 */
-
 
282
function clam_handle_infected_file() {
-
 
283
    throw new coding_exception('clam_handle_infected_file() can not be used any more, please use file picker instead');
-
 
284
}
-
 
285
 
-
 
286
/**
-
 
287
 * @deprecated since 2.7
-
 
288
 */
-
 
289
function clam_scan_moodle_file() {
-
 
290
    throw new coding_exception('clam_scan_moodle_file() can not be used any more, please use file picker instead');
-
 
291
}
-
 
292
 
-
 
293
 
-
 
294
/**
-
 
295
 * @deprecated since 2.7 PHP 5.4.x should be always compatible.
-
 
296
 */
-
 
297
function password_compat_not_supported() {
-
 
298
    throw new coding_exception('Do not use password_compat_not_supported() - bcrypt is now always available');
-
 
299
}
-
 
300
 
-
 
301
/**
-
 
302
 * @deprecated since 2.6
-
 
303
 */
-
 
304
function session_get_instance() {
-
 
305
    throw new coding_exception('session_get_instance() is removed, use \core\session\manager instead');
-
 
306
}
-
 
307
 
-
 
308
/**
-
 
309
 * @deprecated since 2.6
-
 
310
 */
-
 
311
function session_is_legacy() {
-
 
312
    throw new coding_exception('session_is_legacy() is removed, do not use any more');
-
 
313
}
-
 
314
 
-
 
315
/**
-
 
316
 * @deprecated since 2.6
-
 
317
 */
-
 
318
function session_kill_all() {
-
 
319
    throw new coding_exception('session_kill_all() is removed, use \core\session\manager::kill_all_sessions() instead');
-
 
320
}
-
 
321
 
-
 
322
/**
-
 
323
 * @deprecated since 2.6
-
 
324
 */
-
 
325
function session_touch() {
-
 
326
    throw new coding_exception('session_touch() is removed, use \core\session\manager::touch_session() instead');
-
 
327
}
-
 
328
 
-
 
329
/**
-
 
330
 * @deprecated since 2.6
-
 
331
 */
-
 
332
function session_kill() {
-
 
333
    throw new coding_exception('session_kill() is removed, use \core\session\manager::kill_session() instead');
-
 
334
}
-
 
335
 
-
 
336
/**
-
 
337
 * @deprecated since 2.6
-
 
338
 */
-
 
339
function session_kill_user() {
-
 
340
    throw new coding_exception('session_kill_user() is removed, use \core\session\manager::kill_user_sessions() instead');
-
 
341
}
-
 
342
 
-
 
343
/**
-
 
344
 * @deprecated since 2.6
-
 
345
 */
-
 
346
function session_set_user() {
-
 
347
    throw new coding_exception('session_set_user() is removed, use \core\session\manager::set_user() instead');
-
 
348
}
-
 
349
 
-
 
350
/**
-
 
351
 * @deprecated since 2.6
190
 * @deprecated since 2.2, use context_course::instance() or other relevant class instead
-
 
191
 */
352
 */
192
#[\core\attribute\deprecated('\core\context::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
353
function session_is_loggedinas() {
193
function get_context_instance() {
354
    throw new coding_exception('session_is_loggedinas() is removed, use \core\session\manager::is_loggedinas() instead');
194
    \core\deprecation::emit_deprecation(__FUNCTION__);
Línea 355... Línea 195...
355
}
195
}
356
 
-
 
357
/**
-
 
358
 * @deprecated since 2.6
-
 
359
 */
-
 
360
function session_get_realuser() {
-
 
361
    throw new coding_exception('session_get_realuser() is removed, use \core\session\manager::get_realuser() instead');
-
 
362
}
-
 
363
 
-
 
364
/**
-
 
365
 * @deprecated since 2.6
-
 
366
 */
-
 
367
function session_loginas() {
-
 
368
    throw new coding_exception('session_loginas() is removed, use \core\session\manager::loginas() instead');
-
 
369
}
-
 
370
 
-
 
371
/**
-
 
372
 * @deprecated since 2.6
-
 
373
 */
196
 
374
function js_minify() {
-
 
375
    throw new coding_exception('js_minify() is removed, use core_minify::js_files() or core_minify::js() instead.');
-
 
376
}
-
 
377
 
-
 
378
/**
-
 
379
 * @deprecated since 2.6
-
 
380
 */
-
 
381
function css_minify_css() {
-
 
382
    throw new coding_exception('css_minify_css() is removed, use core_minify::css_files() or core_minify::css() instead.');
-
 
383
}
-
 
384
 
-
 
385
// === Deprecated before 2.6.0 ===
-
 
386
 
-
 
387
/**
197
/**
-
 
198
 * @deprecated since 2.5 - do not use, the textrotate.js will work it out automatically
388
 * @deprecated
199
 */
389
 */
200
#[\core\attribute\deprecated('Not replaced', since: '2.0', mdl: 'MDL-19756', final: true)]
390
function check_gd_version() {
201
function can_use_rotated_text() {
Línea 391... Línea 202...
391
    throw new coding_exception('check_gd_version() is removed, GD extension is always available now');
202
    \core\deprecation::emit_deprecation(__FUNCTION__);
392
}
203
}
393
 
204
 
-
 
205
/**
394
/**
206
 * @deprecated since 2.2
395
 * @deprecated
207
 */
396
 */
208
#[\core\attribute\deprecated('\core\context\system::instance', since: '2.2', mdl: 'MDL-34472', final: true)]
Línea 397... Línea 209...
397
function update_login_count() {
209
function get_system_context() {
-
 
210
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
211
}
-
 
212
 
398
    throw new coding_exception('update_login_count() is removed, all calls need to be removed');
213
/**
399
}
214
 * Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
-
 
215
 * provide this function with the language strings for sortasc and sortdesc.
400
 
216
 *
401
/**
217
 * @deprecated use $OUTPUT->arrow() instead.
402
 * @deprecated
218
 */
Línea 403... Línea 219...
403
 */
219
#[\core\attribute\deprecated('OUTPUT->[l|r]arrow', since: '2.0', mdl: 'MDL-19756', final: true)]
404
function reset_login_count() {
220
function print_arrow() {
405
    throw new coding_exception('reset_login_count() is removed, all calls need to be removed');
221
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
222
}
406
}
223
 
407
 
-
 
408
/**
224
/**
409
 * @deprecated
225
 * @deprecated since Moodle 4.0
Línea 410... Línea 226...
410
 */
226
 */
411
function update_log_display_entry() {
-
 
412
 
227
#[\core\attribute\deprecated('category_action_bar tertiary navigation', since: '4.0', mdl: 'MDL-73462', final: true)]
413
    throw new coding_exception('The update_log_display_entry() is removed, please use db/log.php description file instead.');
228
function print_course_request_buttons() {
-
 
229
    \core\deprecation::emit_deprecation(__FUNCTION__);
414
}
230
}
415
 
231
 
416
/**
232
/**
Línea 417... Línea 233...
417
 * @deprecated use the text formatting in a standard way instead (https://moodledev.io/docs/apis/subsystems/output#output-functions)
233
 * @deprecated since 4.2 Use \core\cron::run_main_process() instead.
418
 *             this was abused mostly for embedding of attachments
234
 */
419
 */
235
#[\core\attribute\deprecated('\core\cron::run_main_process()', since: '4.2', mdl: 'MDL-77186', final: true)]
-
 
236
function cron_run() {
420
function filter_text() {
237
    \core\deprecation::emit_deprecation(__FUNCTION__);
421
    throw new coding_exception('filter_text() can not be used anymore, use format_text(), format_string() etc instead.');
238
}
422
}
239
 
Línea 423... Línea 240...
423
 
240
/**
424
/**
-
 
425
 * @deprecated Loginhttps is no longer supported
-
 
426
 */
241
 * @deprecated since 4.2 Use \core\cron::run_scheduled_tasks() instead.
427
function httpsrequired() {
242
 */
-
 
243
#[\core\attribute\deprecated('\core\cron::run_scheduled_tasks()', since: '4.2', mdl: 'MDL-77186', final: true)]
428
    throw new coding_exception('httpsrequired() can not be used any more. Loginhttps is no longer supported.');
244
function cron_run_scheduled_tasks() {
429
}
-
 
430
 
245
    \core\deprecation::emit_deprecation(__FUNCTION__);
431
/**
246
}
Línea 432... Línea 247...
432
 * @deprecated since 3.1 - replacement legacy file API methods can be found on the moodle_url class, for example:
247
 
433
 * The moodle_url::make_legacyfile_url() method can be used to generate a legacy course file url. To generate
248
/**
434
 * course module file.php url the moodle_url::make_file_url() should be used.
249
 * @deprecated since 4.2 Use \core\cron::run_adhoc_tasks() instead.
-
 
250
 */
435
 */
251
#[\core\attribute\deprecated('\core\cron::run_adhoc_tasks()', since: '4.2', mdl: 'MDL-77186', final: true)]
436
function get_file_url() {
252
function cron_run_adhoc_tasks() {
437
    throw new coding_exception('get_file_url() can not be used anymore. Please use ' .
253
    \core\deprecation::emit_deprecation(__FUNCTION__);
Línea 438... Línea 254...
438
        'moodle_url factory methods instead.');
254
}
439
}
255
 
440
 
256
/**
-
 
257
 * @deprecated since 4.2 Use \core\cron::run_inner_scheduled_task() instead.
441
/**
258
 */
442
 * @deprecated use get_enrolled_users($context) instead.
259
#[\core\attribute\deprecated('\core\cron::run_inner_scheduled_task()', since: '4.2', mdl: 'MDL-77186', final: true)]
443
 */
260
function cron_run_inner_scheduled_task() {
Línea 444... Línea 261...
444
function get_course_participants() {
261
    \core\deprecation::emit_deprecation(__FUNCTION__);
445
    throw new coding_exception('get_course_participants() can not be used any more, use get_enrolled_users() instead.');
-
 
446
}
-
 
447
 
-
 
448
/**
-
 
449
 * @deprecated use is_enrolled($context, $userid) instead.
-
 
Línea 450... Línea -...
450
 */
-
 
451
function is_course_participant() {
262
}
452
    throw new coding_exception('is_course_participant() can not be used any more, use is_enrolled() instead.');
-
 
453
}
-
 
454
 
-
 
455
/**
-
 
456
 * @deprecated
-
 
457
 */
-
 
458
function get_recent_enrolments() {
-
 
459
    throw new coding_exception('get_recent_enrolments() is removed as it returned inaccurate results.');
-
 
460
}
263
 
-
 
264
/**
461
 
265
 * @deprecated since 4.2 Use \core\cron::run_inner_adhoc_task() instead.
462
/**
266
 */
463
 * @deprecated use clean_param($string, PARAM_FILE) instead.
-
 
464
 */
267
#[\core\attribute\deprecated('\core\cron::run_inner_adhoc_task()', since: '4.2', mdl: 'MDL-77186', final: true)]
Línea 465... Línea 268...
465
function detect_munged_arguments() {
268
function cron_run_inner_adhoc_task() {
466
    throw new coding_exception('detect_munged_arguments() can not be used any more, please use clean_param(,PARAM_FILE) instead.');
269
    \core\deprecation::emit_deprecation(__FUNCTION__);
467
}
270
}
-
 
271
 
468
 
272
/**
469
 
273
 
470
/**
-
 
471
 * @deprecated since 2.0 MDL-15919
274
 * @deprecated since 4.2 Use \core\cron::set_process_title() instead.
Línea 472... Línea 275...
472
 */
275
 */
473
function unzip_file() {
276
#[\core\attribute\deprecated('\core\cron::set_process_title()', since: '4.2', mdl: 'MDL-77186', final: true)]
474
    throw new coding_exception(__FUNCTION__ . '() is deprecated. '
277
function cron_set_process_title() {
-
 
278
    \core\deprecation::emit_deprecation(__FUNCTION__);
475
        . 'Please use the application/zip file_packer implementation instead.');
279
}
476
}
280
 
477
 
281
/**
Línea 478... Línea 282...
478
/**
282
 * @deprecated since 4.2 Use \core\cron::trace_time_and_memory() instead.
479
 * @deprecated since 2.0 MDL-15919
283
 */
480
 */
284
#[\core\attribute\deprecated('\core\cron::trace_time_and_memory()', since: '4.2', mdl: 'MDL-77186', final: true)]
-
 
285
function cron_trace_time_and_memory() {
481
function zip_files() {
286
    \core\deprecation::emit_deprecation(__FUNCTION__);
482
    throw new coding_exception(__FUNCTION__ . '() is deprecated. '
287
}
483
        . 'Please use the application/zip file_packer implementation instead.');
288
 
Línea 484... Línea 289...
484
}
289
/**
485
 
290
 * @deprecated since 4.2 Use \core\cron::prepare_core_renderer() instead.
486
/**
291
 */
-
 
292
#[\core\attribute\deprecated('\core\cron::prepare_core_renderer()', since: '4.2', mdl: 'MDL-77186', final: true)]
487
 * @deprecated use groups_get_all_groups() instead.
293
function cron_prepare_core_renderer() {
488
 */
294
    \core\deprecation::emit_deprecation(__FUNCTION__);
489
function mygroupid() {
295
}
Línea 490... Línea 296...
490
    throw new coding_exception('mygroupid() can not be used any more, please use groups_get_all_groups() instead.');
296
 
491
}
297
/**
492
 
298
 * @deprecated since 4.2. Use \core\cron::setup_user() instead.
-
 
299
 */
-
 
300
#[\core\attribute\deprecated('\core\cron::setup_user()', since: '4.2', mdl: 'MDL-77837', final: true)]
-
 
301
function cron_setup_user() {
-
 
302
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
303
}
-
 
304
 
493
/**
305
/**
494
 * @deprecated since Moodle 2.0 MDL-14617 - please do not use this function any more.
306
 * @deprecated since 4.3.
495
 */
307
 */
Línea 496... Línea 308...
496
function groupmode() {
308
#[\core\attribute\deprecated(since: '4.3', mdl: 'MDL-77837', final: true)]
497
    throw new coding_exception('groupmode() can not be used any more, please use groups_get_* instead.');
309
function badges_get_oauth2_service_options() {
498
}
310
    \core\deprecation::emit_deprecation(__FUNCTION__);
499
 
311
}
-
 
312
 
500
/**
313
/**
-
 
314
 * @deprecated since 4.3.
501
 * @deprecated Since year 2006 - please do not use this function any more.
315
 */
-
 
316
#[\core\attribute\deprecated(
502
 */
317
    since: '4.3',
503
function set_current_group() {
318
    reason: 'All functions associated with device specific themes are being removed',
504
    throw new coding_exception('set_current_group() can not be used anymore, please use $SESSION->currentgroup[$courseid] instead');
319
    mdl: 'MDL-77793',
Línea 505... Línea 320...
505
}
320
    final: true,
506
 
321
)]
507
/**
322
function theme_is_device_locked() {
508
 * @deprecated Since year 2006 - please do not use this function any more.
323
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
324
}
-
 
325
 
509
 */
326
/**
-
 
327
 * @deprecated since 4.3.
-
 
328
 */
-
 
329
#[\core\attribute\deprecated(
-
 
330
    since: '4.3',
510
function get_current_group() {
331
    reason: 'All functions associated with device specific themes are being removed',
511
    throw new coding_exception('get_current_group() can not be used any more, please use groups_get_* instead');
332
    mdl: 'MDL-77793',
Línea 512... Línea 333...
512
}
333
    final: true,
513
 
334
)]
-
 
335
function theme_get_locked_theme_for_device() {
-
 
336
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
337
}
-
 
338
 
-
 
339
/**
514
/**
340
 * @deprecated since 4.3.
-
 
341
 */
515
 * @deprecated Since Moodle 2.8
342
#[\core\attribute\deprecated(
516
 */
343
    'random_bytes()',
517
function groups_filter_users_by_course_module_visible() {
344
    since: '4.3',
518
    throw new coding_exception('groups_filter_users_by_course_module_visible() is removed. ' .
345
    reason: 'Since PHP 7.0 the random_bytes() is natively available and Moodle LMS requires greater than PHP 7.',
Línea 519... Línea -...
519
            'Replace with a call to \core_availability\info_module::filter_user_list(), ' .
-
 
520
            'which does basically the same thing but includes other restrictions such ' .
346
    mdl: 'MDL-78698',
-
 
347
    final: true,
-
 
348
)]
-
 
349
function random_bytes_emulate() {
521
            'as profile restrictions.');
350
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
351
}
-
 
352
 
522
}
353
/**
-
 
354
 * rc4encrypt
523
 
355
 *
524
/**
356
 * @param string $data        Data to encrypt.
-
 
357
 * @return string             The now encrypted data.
525
 * @deprecated Since Moodle 2.8
358
 *
Línea 526... Línea 359...
526
 */
359
 * @deprecated since Moodle 4.5 - please do not use this function any more, {@see \core\encryption::encrypt}
-
 
360
 */
-
 
361
#[\core\attribute\deprecated('\core\encryption::encrypt', since: '4.5', mdl: 'MDL-81940')]
-
 
362
function rc4encrypt($data) {
-
 
363
    // No initial deprecation notice here, as the following method triggers its own.
-
 
364
    return endecrypt(get_site_identifier(), $data, '');
527
function groups_course_module_visible() {
365
}
-
 
366
 
-
 
367
/**
528
    throw new coding_exception('groups_course_module_visible() is removed, use $cm->uservisible to decide whether the current
368
 * rc4decrypt
-
 
369
 *
529
        user can ' . 'access an activity.', DEBUG_DEVELOPER);
370
 * @param string $data        Data to decrypt.
530
}
371
 * @return string             The now decrypted data.
531
 
-
 
Línea 532... Línea -...
532
/**
-
 
533
 * @deprecated since 2.0
372
 *
534
 */
-
 
535
function error() {
373
 * @deprecated since Moodle 4.5 - please do not use this function any more, {@see \core\encryption::decrypt}
536
    throw new coding_exception('notlocalisederrormessage', 'error', $link, $message, 'error() is a removed, please call
-
 
537
            throw new \moodle_exception() instead of error()');
374
 */
Línea 538... Línea -...
538
}
-
 
539
 
375
#[\core\attribute\deprecated('\core\encryption::decrypt', since: '4.5', mdl: 'MDL-81940')]
540
 
376
function rc4decrypt($data) {
541
/**
377
    // No initial deprecation notice here, as the following method triggers its own.
542
 * @deprecated use $PAGE->theme->name instead.
-
 
543
 */
-
 
Línea 544... Línea -...
544
function current_theme() {
-
 
545
    throw new coding_exception('current_theme() can not be used any more, please use $PAGE->theme->name instead');
378
    return endecrypt(get_site_identifier(), $data, 'de');
546
}
-
 
547
 
379
}
548
/**
380
 
549
 * @deprecated
381
/**
Línea 550... Línea -...
550
 */
-
 
551
function formerr() {
-
 
552
    throw new coding_exception('formerr() is removed. Please change your code to use $OUTPUT->error_text($string).');
382
 * Based on a class by Mukul Sabharwal [mukulsabharwal @ yahoo.com]
553
}
-
 
554
 
-
 
555
/**
-
 
Línea 556... Línea -...
556
 * @deprecated use $OUTPUT->skip_link_target() in instead.
-
 
-
 
383
 *
557
 */
384
 * @param string $pwd The password to use when encrypting or decrypting
558
function skip_main_destination() {
385
 * @param string $data The data to be decrypted/encrypted
559
    throw new coding_exception('skip_main_destination() can not be used any more, please use $OUTPUT->skip_link_target() instead.');
386
 * @param string $case Either 'de' for decrypt or '' for encrypt
560
}
387
 * @return string
561
 
388
 *
Línea 562... Línea -...
562
/**
-
 
563
 * @deprecated use $OUTPUT->container() instead.
-
 
564
 */
-
 
565
function print_container() {
389
 * @deprecated since Moodle 4.5 - please do not use this function any more, {@see \core\encryption}
566
    throw new coding_exception('print_container() can not be used any more. Please use $OUTPUT->container() instead.');
-
 
567
}
-
 
Línea 568... Línea -...
568
 
-
 
569
/**
-
 
570
 * @deprecated use $OUTPUT->container_start() instead.
390
 */
571
 */
391
#[\core\attribute\deprecated(\core\encryption::class, since: '4.5', mdl: 'MDL-81940')]
Línea -... Línea 392...
-
 
392
function endecrypt($pwd, $data, $case) {
-
 
393
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
394
 
-
 
395
    if ($case == 'de') {
-
 
396
        $data = urldecode($data);
-
 
397
    }
-
 
398
 
572
function print_container_start() {
399
    $key[] = '';
-
 
400
    $box[] = '';
573
    throw new coding_exception('print_container_start() can not be used any more. Please use $OUTPUT->container_start() instead.');
401
    $pwdlength = strlen($pwd);
Línea 574... Línea 402...
574
}
402
 
575
 
403
    for ($i = 0; $i <= 255; $i++) {
576
/**
404
        $key[$i] = ord(substr($pwd, ($i % $pwdlength), 1));
577
 * @deprecated use $OUTPUT->container_end() instead.
405
        $box[$i] = $i;
-
 
406
    }
Línea 578... Línea 407...
578
 */
407
 
579
function print_container_end() {
408
    $x = 0;
Línea 580... Línea 409...
580
    throw new coding_exception('print_container_end() can not be used any more. Please use $OUTPUT->container_end() instead.');
409
 
581
}
410
    for ($i = 0; $i <= 255; $i++) {
582
 
411
        $x = ($x + $box[$i] + $key[$i]) % 256;
-
 
412
        $tempswap = $box[$i];
583
/**
413
        $box[$i] = $box[$x];
584
 * @deprecated since Moodle 2.0 MDL-19077 - use $OUTPUT->notification instead.
414
        $box[$x] = $tempswap;
585
 */
415
    }
Línea 586... Línea -...
586
function notify() {
-
 
587
    throw new coding_exception('notify() is removed, please use $OUTPUT->notification() instead');
-
 
588
}
-
 
589
 
-
 
590
/**
-
 
591
 * @deprecated use $OUTPUT->continue_button() instead.
-
 
592
 */
-
 
593
function print_continue() {
-
 
Línea 594... Línea 416...
594
    throw new coding_exception('print_continue() can not be used any more. Please use $OUTPUT->continue_button() instead.');
416
 
595
}
417
    $cipher = '';
596
 
-
 
597
/**
418
 
598
 * @deprecated use $PAGE methods instead.
419
    $a = 0;
599
 */
420
    $j = 0;
600
function print_header() {
-
 
601
 
-
 
602
    throw new coding_exception('print_header() can not be used any more. Please use $PAGE methods instead.');
-
 
603
}
-
 
604
 
-
 
605
/**
-
 
606
 * @deprecated use $PAGE methods instead.
-
 
607
 */
-
 
608
function print_header_simple() {
421
 
-
 
422
    for ($i = 0; $i < strlen($data); $i++) {
-
 
423
        $a = ($a + 1) % 256;
-
 
424
        $j = ($j + $box[$a]) % 256;
-
 
425
        $temp = $box[$a];
-
 
426
        $box[$a] = $box[$j];
-
 
427
        $box[$j] = $temp;
-
 
428
        $k = $box[(($box[$a] + $box[$j]) % 256)];
609
 
429
        $cipherby = ord(substr($data, $i, 1)) ^ $k;
-
 
430
        $cipher .= chr($cipherby);
610
    throw new coding_exception('print_header_simple() can not be used any more. Please use $PAGE methods instead.');
431
    }
-
 
432
 
611
}
433
    if ($case == 'de') {
Línea 612... Línea -...
612
 
-
 
613
/**
-
 
614
 * @deprecated use $OUTPUT->block() instead.
-
 
615
 */
434
        $cipher = urldecode(urlencode($cipher));
616
function print_side_block() {
435
    } else {
617
    throw new coding_exception('print_side_block() can not be used any more, please use $OUTPUT->block() instead.');
-
 
618
}
436
        $cipher = urlencode($cipher);
619
 
437
    }
620
/**
438
 
621
 * @deprecated since Moodle 3.6
-
 
622
 */
439
    return $cipher;
623
function print_textarea() {
-
 
624
    throw new coding_exception(
-
 
625
        'print_textarea() has been removed. Please use $OUTPUT->print_textarea() instead.'
440
}
626
    );
441
 
627
}
442
/**
628
 
443
 * @deprecated Since Moodle 4.5
629
/**
-
 
630
 * Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
444
 */
631
 * provide this function with the language strings for sortasc and sortdesc.
445
#[\core\attribute\deprecated('This method should not be used', since: '4.5', mdl: 'MDL-80275', final: true)]
632
 *
446
function disable_output_buffering(): void {
633
 * @deprecated use $OUTPUT->arrow() instead.
447
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
448
}
634
 * @todo final deprecation of this function once MDL-45448 is resolved
449
 
635
 *
450
 
636
 * If no sort string is associated with the direction, an arrow with no alt text will be printed/returned.
-
 
637
 *
451
/**
638
 * @global object
452
 * Prints a grade menu (as part of an existing form) with help showing all possible numerical grades and scales.
639
 * @param string $direction 'up' or 'down'
-
 
640
 * @param string $strsort The language string used for the alt attribute of this image
-
 
641
 * @param bool $return Whether to print directly or return the html string
453
 *
Línea 642... Línea 454...
642
 * @return string|void depending on $return
454
 * @todo Finish documenting this function
643
 *
455
 * @todo Deprecate: this is only used in a few contrib modules
644
 */
456
 *
645
function print_arrow($direction='up', $strsort=null, $return=false) {
457
 * @param int $courseid The course ID
646
    global $OUTPUT;
458
 * @param string $name
647
 
459
 * @param string $current
Línea 648... Línea 460...
648
    debugging('print_arrow() is deprecated. Please use $OUTPUT->arrow() instead.', DEBUG_DEVELOPER);
460
 * @param boolean $includenograde Include those with no grades
649
 
-
 
650
    if (!in_array($direction, array('up', 'down', 'right', 'left', 'move'))) {
-
 
651
        return null;
-
 
652
    }
-
 
653
 
-
 
654
    $return = null;
-
 
655
 
-
 
656
    switch ($direction) {
461
 * @param boolean $return If set to true returns rather than echo's
657
        case 'up':
462
 * @return string|bool|null Depending on value of $return
658
            $sortdir = 'asc';
463
 * @deprecated Since Moodle 4.5
659
            break;
464
 */
660
        case 'down':
-
 
661
            $sortdir = 'desc';
-
 
662
            break;
-
 
663
        case 'move':
-
 
664
            $sortdir = 'asc';
465
#[\core\attribute\deprecated('This method should not be used', since: '4.5', mdl: 'MDL-82157')]
665
            break;
-
 
666
        default:
-
 
667
            $sortdir = null;
-
 
668
            break;
-
 
669
    }
-
 
670
 
-
 
671
    // Prepare language string
466
function print_grade_menu($courseid, $name, $current, $includenograde=true, $return=false) {
672
    $strsort = '';
-
 
673
    if (empty($strsort) && !empty($sortdir)) {
-
 
674
        $strsort  = get_string('sort' . $sortdir, 'grades');
-
 
675
    }
-
 
676
 
-
 
677
    $return = ' ' . $OUTPUT->pix_icon('t/' . $direction, $strsort) . ' ';
-
 
678
 
-
 
679
    if ($return) {
-
 
680
        return $return;
-
 
681
    } else {
-
 
682
        echo $return;
-
 
683
    }
-
 
684
}
-
 
685
 
-
 
686
/**
-
 
687
 * @deprecated since Moodle 2.0
-
 
688
 */
-
 
689
function choose_from_menu() {
-
 
690
    throw new coding_exception('choose_from_menu() is removed. Please change your code to use html_writer::select().');
-
 
691
}
-
 
692
 
-
 
693
/**
-
 
694
 * @deprecated use $OUTPUT->help_icon_scale($courseid, $scale) instead.
467
    \core\deprecation::emit_deprecation(__FUNCTION__);
695
 */
-
 
696
function print_scale_menu_helpbutton() {
-
 
697
    throw new coding_exception('print_scale_menu_helpbutton() can not be used any more. '.
-
 
698
        'Please use $OUTPUT->help_icon_scale($courseid, $scale) instead.');
-
 
699
}
-
 
700
 
-
 
701
/**
-
 
702
 * @deprecated use html_writer::checkbox() instead.
-
 
703
 */
-
 
704
function print_checkbox() {
-
 
705
    throw new coding_exception('print_checkbox() can not be used any more. Please use html_writer::checkbox() instead.');
-
 
706
}
-
 
707
 
-
 
708
/**
-
 
709
 * @deprecated since Moodle 3.2
-
 
710
 */
-
 
711
function update_module_button() {
-
 
712
    throw new coding_exception('update_module_button() can not be used anymore. Activity modules should ' .
-
 
713
        'not add the edit module button, the link is already available in the Administration block. Themes ' .
-
 
714
        'can choose to display the link in the buttons row consistently for all module types.');
-
 
715
}
-
 
716
 
-
 
717
/**
-
 
718
 * @deprecated use $OUTPUT->navbar() instead
-
 
719
 */
-
 
720
function print_navigation () {
-
 
721
    throw new coding_exception('print_navigation() can not be used any more, please update use $OUTPUT->navbar() instead.');
-
 
722
}
-
 
723
 
-
 
724
/**
-
 
725
 * @deprecated Please use $PAGE->navabar methods instead.
-
 
726
 */
-
 
727
function build_navigation() {
-
 
728
    throw new coding_exception('build_navigation() can not be used any more, please use $PAGE->navbar methods instead.');
-
 
729
}
-
 
730
 
-
 
731
/**
-
 
732
 * @deprecated not relevant with global navigation in Moodle 2.x+
-
 
733
 */
-
 
734
function navmenu() {
-
 
735
    throw new coding_exception('navmenu() can not be used any more, it is no longer relevant with global navigation.');
-
 
736
}
-
 
737
 
-
 
738
/// CALENDAR MANAGEMENT  ////////////////////////////////////////////////////////////////
-
 
739
 
-
 
740
 
-
 
741
/**
-
 
742
 * @deprecated please use calendar_event::create() instead.
-
 
743
 */
-
 
744
function add_event() {
-
 
745
    throw new coding_exception('add_event() can not be used any more, please use calendar_event::create() instead.');
-
 
746
}
-
 
747
 
-
 
748
/**
-
 
749
 * @deprecated please calendar_event->update() instead.
-
 
750
 */
-
 
751
function update_event() {
-
 
752
    throw new coding_exception('update_event() is removed, please use calendar_event->update() instead.');
-
 
753
}
-
 
754
 
-
 
755
/**
-
 
756
 * @deprecated please use calendar_event->delete() instead.
-
 
757
 */
-
 
758
function delete_event() {
-
 
759
    throw new coding_exception('delete_event() can not be used any more, please use '.
-
 
760
        'calendar_event->delete() instead.');
-
 
761
}
-
 
762
 
-
 
763
/**
-
 
764
 * @deprecated please use calendar_event->toggle_visibility(false) instead.
-
 
765
 */
-
 
766
function hide_event() {
-
 
767
    throw new coding_exception('hide_event() can not be used any more, please use '.
-
 
768
        'calendar_event->toggle_visibility(false) instead.');
-
 
769
}
-
 
770
 
-
 
771
/**
-
 
772
 * @deprecated please use calendar_event->toggle_visibility(true) instead.
-
 
773
 */
-
 
774
function show_event() {
-
 
775
    throw new coding_exception('show_event() can not be used any more, please use '.
-
 
776
        'calendar_event->toggle_visibility(true) instead.');
-
 
777
}
-
 
778
 
-
 
779
/**
-
 
780
 * @deprecated since Moodle 2.2 use core_text::xxxx() instead.
-
 
781
 */
-
 
782
function textlib_get_instance() {
-
 
783
    throw new coding_exception('textlib_get_instance() can not be used any more, please use '.
-
 
784
        'core_text::functioname() instead.');
-
 
785
}
-
 
786
 
-
 
787
/**
-
 
788
 * @deprecated since 2.4
-
 
789
 */
-
 
790
function get_generic_section_name() {
-
 
791
    throw new coding_exception('get_generic_section_name() is deprecated. Please use appropriate functionality '
-
 
792
            .'from class core_courseformat\\base');
-
 
793
}
-
 
794
 
-
 
795
/**
-
 
796
 * @deprecated since 2.4
-
 
797
 */
-
 
798
function get_all_sections() {
-
 
799
    throw new coding_exception('get_all_sections() is removed. See phpdocs for this function');
-
 
800
}
-
 
801
 
-
 
802
/**
-
 
803
 * @deprecated since 2.4
468
    global $OUTPUT;
804
 */
469
 
-
 
470
    $output = '';
-
 
471
    $strscale = get_string('scale');
805
function add_mod_to_section() {
472
    $strscales = get_string('scales');
806
    throw new coding_exception('Function add_mod_to_section() is removed, please use course_add_cm_to_section()');
473
 
807
}
474
    $scales = get_scales_menu($courseid);
-
 
475
    foreach ($scales as $i => $scalename) {
-
 
476
        $grades[-$i] = $strscale .': '. $scalename;
-
 
477
    }
Línea 808... Línea -...
808
 
-
 
809
/**
-
 
810
 * @deprecated since 2.4
-
 
811
 */
478
    if ($includenograde) {
812
function get_all_mods() {
-
 
813
    throw new coding_exception('Function get_all_mods() is removed. Use get_fast_modinfo() and get_module_types_names() instead. See phpdocs for details');
479
        $grades[0] = get_string('nograde');
814
}
-
 
Línea 815... Línea -...
815
 
-
 
816
/**
-
 
817
 * @deprecated since 2.4
-
 
818
 */
-
 
819
function get_course_section() {
480
    }
820
    throw new coding_exception('Function get_course_section() is removed. Please use course_create_sections_if_missing() and get_fast_modinfo() instead.');
481
    for ($i=100; $i>=1; $i--) {
821
}
482
        $grades[$i] = $i;
822
 
483
    }
823
/**
484
    $output .= html_writer::select($grades, $name, $current, false);
824
 * @deprecated since 2.4
-
 
Línea 825... Línea -...
825
 */
-
 
826
function format_weeks_get_section_dates() {
485
 
827
    throw new coding_exception('Function format_weeks_get_section_dates() is removed. It is not recommended to'.
-
 
828
            ' use it outside of format_weeks plugin');
-
 
829
}
-
 
830
 
-
 
Línea 831... Línea -...
831
/**
-
 
832
 * @deprecated since 2.5
-
 
833
 */
-
 
834
function get_print_section_cm_text() {
-
 
835
    throw new coding_exception('Function get_print_section_cm_text() is removed. Please use '.
486
    $linkobject = '<span class="helplink">' . $OUTPUT->pix_icon('help', $strscales) . '</span>';
836
            'cm_info::get_formatted_content() and cm_info::get_formatted_name()');
487
    $link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => 1));
837
}
488
    $action = new popup_action('click', $link, 'ratingscales', array('height' => 400, 'width' => 500));
Línea 838... Línea -...
838
 
-
 
839
/**
489
    $output .= $OUTPUT->action_link($link, $linkobject, $action, array('title' => $strscales));
840
 * @deprecated since 2.5
-
 
-
 
490
 
-
 
491
    if ($return) {
-
 
492
        return $output;
841
 */
493
    } else {
-
 
494
        echo $output;
842
function print_section_add_menus() {
495
    }
843
    throw new coding_exception('Function print_section_add_menus() is removed. Please use course renderer '.
-
 
-
 
496
}
Línea 844... Línea -...
844
            'function course_section_add_cm_control()');
-
 
845
}
-
 
846
 
-
 
847
/**
-
 
848
 * @deprecated since 2.5. Please use:
-
 
849
 */
497
 
850
function make_editing_buttons() {
-
 
Línea 851... Línea -...
851
    throw new coding_exception('Function make_editing_buttons() is removed, please see PHPdocs in '.
-
 
852
            'lib/deprecatedlib.php on how to replace it');
-
 
853
}
-
 
854
 
-
 
855
/**
-
 
856
 * @deprecated since 2.5
498
/**
857
 */
-
 
Línea 858... Línea -...
858
function print_section() {
-
 
859
    throw new coding_exception(
-
 
860
        'Function print_section() is removed.' .
-
 
861
        ' Please use core_courseformat\\output\\local\\content\\section' .
-
 
862
        ' to render a course section instead.'
499
 * Resets specified user's password and send the new password to the user via email.
863
    );
-
 
864
}
-
 
Línea 865... Línea -...
865
 
-
 
866
/**
-
 
867
 * @deprecated since 2.5
-
 
868
 */
-
 
869
function print_overview() {
500
 *
870
    throw new coding_exception('Function print_overview() is removed. Use block course_overview to display this information');
501
 * @param stdClass $user A {@link $USER} object
871
}
502
 * @return bool Returns true if mail was sent OK and false if there was an error.
Línea 872... Línea 503...
872
 
503
 * @see setnew_password_and_mail()
873
/**
504
 * @deprecated Since Moodle 4.5
874
 * @deprecated since 2.5
505
 * @todo MDL-82646 Final deprecation in Moodle 6.0.
-
 
506
 */
-
 
507
#[\core\attribute\deprecated(
-
 
508
    since: '4.5',
-
 
509
    mdl: 'MDL-64148',
-
 
510
    replacement: 'setnew_password_and_mail()',
-
 
511
    reason: 'It is no longer used',
875
 */
512
)]
876
function print_recent_activity() {
513
function reset_password_and_mail($user) {
877
    throw new coding_exception('Function print_recent_activity() is removed. It is not recommended to'.
514
    \core\deprecation::emit_deprecation(__FUNCTION__);
Línea 878... Línea 515...
878
            ' use it outside of block_recent_activity');
515
    global $CFG;
879
}
516
 
880
 
517
    $site  = get_site();
-
 
518
    $supportuser = core_user::get_support_user();
-
 
519
 
-
 
520
    $userauth = get_auth_plugin($user->auth);
-
 
521
    if (!$userauth->can_reset_password() or !is_enabled_auth($user->auth)) {
-
 
522
        trigger_error("Attempt to reset user password for user $user->username with Auth $user->auth.");
-
 
523
        return false;
881
/**
524
    }
882
 * @deprecated since 2.5
525
 
883
 */
526
    $newpassword = generate_password();
Línea 884... Línea 527...
884
function delete_course_module() {
527
 
885
    throw new coding_exception('Function delete_course_module() is removed. Please use course_delete_module() instead.');
-
 
886
}
528
    if (!$userauth->user_update_password($user, $newpassword)) {
887
 
-
 
888
/**
-
 
889
 * @deprecated since 2.5
-
 
890
 */
-
 
891
function update_category_button() {
-
 
892
    throw new coding_exception('Function update_category_button() is removed. Pages to view '.
-
 
893
            'and edit courses are now separate and no longer depend on editing mode.');
-
 
894
}
529
        throw new \moodle_exception("cannotsetpassword");
895
 
530
    }
896
/**
-
 
897
 * @deprecated since 2.5
531
 
898
 */
-
 
899
function make_categories_list() {
-
 
900
    throw new coding_exception('Global function make_categories_list() is removed. Please use '.
532
    $a = new stdClass();
901
        'core_course_category::make_categories_list() and core_course_category::get_parents()');
533
    $a->firstname   = $user->firstname;
902
}
-
 
903
 
-
 
904
/**
-
 
905
 * @deprecated since 2.5
-
 
906
 */
-
 
907
function category_delete_move() {
-
 
908
    throw new coding_exception('Function category_delete_move() is removed. Please use ' .
-
 
909
        'core_course_category::delete_move() instead.');
-
 
910
}
-
 
911
 
-
 
912
/**
-
 
913
 * @deprecated since 2.5
534
    $a->lastname    = $user->lastname;
914
 */
-
 
915
function category_delete_full() {
-
 
916
    throw new coding_exception('Function category_delete_full() is removed. Please use ' .
-
 
917
        'core_course_category::delete_full() instead.');
-
 
918
}
535
    $a->sitename    = format_string($site->fullname);
919
 
536
    $a->username    = $user->username;
-
 
537
    $a->newpassword = $newpassword;
-
 
538
    $a->link        = $CFG->wwwroot .'/login/change_password.php';
-
 
539
    $a->signoff     = generate_email_signoff();
920
/**
540
 
921
 * @deprecated since 2.5
-
 
922
 */
541
    $message = get_string('newpasswordtext', '', $a);
-
 
542
 
-
 
543
    $subject  = format_string($site->fullname) .': '. get_string('changedpassword');
-
 
544
 
Línea 923... Línea -...
923
function move_category() {
-
 
-
 
545
    unset_user_preference('create_password', $user); // Prevent cron from generating the password.
924
    throw new coding_exception('Function move_category() is removed. Please use core_course_category::change_parent() instead.');
546
 
925
}
-
 
926
 
547
    // Directly email rather than using the messaging system to ensure its not routed to a popup or jabber.
927
/**
548
    return email_to_user($user, $supportuser, $subject, $message);
-
 
549
}
-
 
550
 
928
 * @deprecated since 2.5
551
/**
-
 
552
 * @deprecated Since Moodle 4.0 MDL-71175. Please use plagiarism_get_links() or plugin specific functions..
-
 
553
 */
-
 
554
#[\core\attribute\deprecated(
-
 
555
    replacement: 'plagiarism_get_links',
-
 
556
    since: '4.0',
-
 
557
    mdl: 'MDL-71175',
-
 
558
    final: true,
-
 
559
)]
-
 
560
function plagiarism_get_file_results(): void {
929
 */
561
    \core\deprecation::emit_deprecation(__FUNCTION__);
Línea 930... Línea 562...
930
function course_category_hide() {
562
}
-
 
563
 
-
 
564
/**
-
 
565
 * @deprecated Since Moodle 4.0 - Please use {plugin name}_before_standard_top_of_body_html instead.
931
    throw new coding_exception('Function course_category_hide() is removed. Please use core_course_category::hide() instead.');
566
 */
-
 
567
#[\core\attribute\deprecated(
932
}
568
    replacement: '{plugin name}_before_standard_top_of_body_html',
933
 
569
    since: '4.0',
934
/**
570
    mdl: 'MDL-71175',
935
 * @deprecated since 2.5
-
 
936
 */
-
 
937
function course_category_show() {
-
 
938
    throw new coding_exception('Function course_category_show() is removed. Please use core_course_category::show() instead.');
571
    final: true,
939
}
-
 
940
 
572
)]
941
/**
-
 
942
 * @deprecated since 2.5. Please use core_course_category::get($catid, IGNORE_MISSING) or
573
function plagiarism_update_status(): void {
943
 *     core_course_category::get($catid, MUST_EXIST).
-
 
944
 */
-
 
945
function get_course_category() {
-
 
946
    throw new coding_exception('Function get_course_category() is removed. Please use core_course_category::get(), ' .
574
    \core\deprecation::emit_deprecation(__FUNCTION__);
947
        'see phpdocs for more details');
-
 
948
}
575
}
949
 
-
 
950
/**
-
 
951
 * @deprecated since 2.5
-
 
952
 */
-
 
953
function create_course_category() {
576
 
954
    throw new coding_exception('Function create_course_category() is removed. Please use core_course_category::create(), ' .
577
/**
955
        'see phpdocs for more details');
-
 
956
}
-
 
957
 
-
 
958
/**
578
 * ?
959
 * @deprecated since 2.5. Please use core_course_category::get() and core_course_category::get_children()
-
 
960
 */
579
 *
961
function get_all_subcategories() {
-
 
962
    throw new coding_exception('Function get_all_subcategories() is removed. Please use appropriate methods() '.
-
 
963
        'of core_course_category class. See phpdocs for more details');
-
 
964
}
-
 
965
 
-
 
966
/**
-
 
967
 * @deprecated since 2.5. Please use core_course_category::get($parentid)->get_children().
580
 * @param string $modargs
968
 */
-
 
969
function get_child_categories() {
581
 * @param string $body Currently unused
970
    throw new coding_exception('Function get_child_categories() is removed. Use core_course_category::get_children() or see ' .
-
 
971
        'phpdocs for more details.');
-
 
972
}
-
 
973
 
-
 
974
/**
582
 *
975
 * @deprecated since 2.5
-
 
976
 */
583
 * @deprecated Since Moodle 5.0
977
function get_categories() {
584
 * @todo Final deprecation on Moodle 6.0. See MDL-83366.
978
    throw new coding_exception('Function get_categories() is removed. Please use ' .
585
 */
979
            'appropriate functions from class core_course_category');
-
 
980
}
-
 
981
 
-
 
982
/**
586
#[\core\attribute\deprecated(
983
* @deprecated since 2.5
-
 
984
*/
587
    replacement: null,
985
function print_course_search() {
588
    since: '5.0',
986
    throw new coding_exception('Function print_course_search() is removed, please use course renderer');
-
 
987
}
-
 
988
 
-
 
989
/**
589
    mdl: 'MDL-83366',
990
 * @deprecated since 2.5
-
 
991
 */
590
    reason: 'The function is no longer used with the removal of the unused and non-functioning admin/process_email.php.',
992
function print_my_moodle() {
591
)]
993
    throw new coding_exception('Function print_my_moodle() is removed, please use course renderer ' .
-
 
994
            'function frontpage_my_courses()');
-
 
995
}
-
 
996
 
592
function moodle_process_email($modargs, $body) {
997
/**
-
 
998
 * @deprecated since 2.5
593
    \core\deprecation::emit_deprecation(__FUNCTION__);
999
 */
594
    global $DB;
1000
function print_remote_course() {
595
 
1001
    throw new coding_exception('Function print_remote_course() is removed, please use course renderer');
-
 
1002
}
-
 
1003
 
-
 
1004
/**
-
 
1005
 * @deprecated since 2.5
-
 
1006
 */
596
    // The first char should be an unencoded letter. We'll take this as an action.
1007
function print_remote_host() {
597
    switch ($modargs[0]) {
1008
    throw new coding_exception('Function print_remote_host() is removed, please use course renderer');
598
        case 'B': { // Bounce.
1009
}
-
 
1010
 
-
 
1011
/**
-
 
1012
 * @deprecated since 2.5
599
            list(, $userid) = unpack('V', base64_decode(substr($modargs, 1, 8)));
1013
 */
600
            if ($user = $DB->get_record("user", array('id' => $userid), "id,email")) {
1014
function print_whole_category_list() {
601
                // Check the half md5 of their email.
1015
    throw new coding_exception('Function print_whole_category_list() is removed, please use course renderer');
602
                $md5check = substr(md5($user->email), 0, 16);
1016
}
-
 
1017
 
-
 
1018
/**
-
 
1019
 * @deprecated since 2.5
603
                if ($md5check == substr($modargs, -16)) {
1020
 */
604
                    set_bounce_count($user);
1021
function print_category_info() {
-
 
1022
    throw new coding_exception('Function print_category_info() is removed, please use course renderer');
-
 
1023
}
605
                }
1024
 
-
 
1025
/**
-
 
1026
 * @deprecated since 2.5
-
 
1027
 */
-
 
1028
function get_course_category_tree() {
-
 
1029
    throw new coding_exception('Function get_course_category_tree() is removed, please use course ' .
606
                // Else maybe they've already changed it?
1030
            'renderer or core_course_category class, see function phpdocs for more info');
-
 
1031
}
-
 
1032
 
-
 
1033
/**
-
 
1034
 * @deprecated since 2.5
607
            }
1035
 */
608
        }
1036
function print_courses() {
-
 
1037
    throw new coding_exception('Function print_courses() is removed, please use course renderer');
-
 
1038
}
-
 
1039
 
-
 
1040
/**
-
 
1041
 * @deprecated since 2.5
-
 
1042
 */
609
        break;
1043
function print_course() {
-
 
1044
    throw new coding_exception('Function print_course() is removed, please use course renderer');
-
 
1045
}
-
 
Línea 1046... Línea -...
1046
 
-
 
-
 
610
        // Maybe more later?
1047
/**
611
    }
1048
 * @deprecated since 2.5
612
}
1049
 */
613
 
1050
function get_category_courses_array() {
-
 
1051
    throw new coding_exception('Function get_category_courses_array() is removed, please use methods of ' .
614
/**
Línea 1052... Línea 615...
1052
        'core_course_category class');
615
 * Gets the default category for a module context.
1053
}
616
 * If no categories exist yet then default ones are created in all contexts.
1054
 
617
 *
1055
/**
-
 
1056
 * @deprecated since 2.5
-
 
1057
 */
-
 
1058
function get_category_courses_array_recursively() {
-
 
1059
    throw new coding_exception('Function get_category_courses_array_recursively() is removed, please use ' .
-
 
1060
        'methods of core_course_category class', DEBUG_DEVELOPER);
-
 
1061
}
-
 
1062
 
-
 
1063
/**
-
 
1064
 * @deprecated since Moodle 2.5 MDL-27814 - please do not use this function any more.
-
 
1065
 */
-
 
1066
function blog_get_context_url() {
618
 * @param array $contexts The context objects.
1067
    throw new coding_exception('Function  blog_get_context_url() is removed, getting params from context is not reliable for blogs.');
-
 
1068
}
-
 
1069
 
-
 
1070
/**
-
 
1071
 * @deprecated since 2.5
-
 
1072
 */
-
 
1073
function get_courses_wmanagers() {
-
 
1074
    throw new coding_exception('Function get_courses_wmanagers() is removed, please use ' .
-
 
1075
        'core_course_category::get_courses()');
-
 
1076
}
-
 
1077
 
-
 
1078
/**
-
 
1079
 * @deprecated since 2.5
-
 
1080
 */
-
 
1081
function convert_tree_to_html() {
-
 
1082
    throw new coding_exception('Function convert_tree_to_html() is removed. Consider using class tabtree and core_renderer::render_tabtree()');
-
 
1083
}
-
 
1084
 
-
 
1085
/**
-
 
1086
 * @deprecated since 2.5
-
 
1087
 */
-
 
1088
function convert_tabrows_to_tree() {
-
 
1089
    throw new coding_exception('Function convert_tabrows_to_tree() is removed. Consider using class tabtree');
-
 
1090
}
-
 
1091
 
-
 
1092
/**
-
 
1093
 * @deprecated since 2.5 - do not use, the textrotate.js will work it out automatically
-
 
1094
 */
-
 
1095
function can_use_rotated_text() {
-
 
1096
    debugging('can_use_rotated_text() is removed. JS feature detection is used automatically.');
-
 
1097
}
-
 
1098
 
-
 
1099
/**
-
 
1100
 * @deprecated since Moodle 2.2 MDL-35009 - please do not use this function any more.
-
 
1101
 */
-
 
1102
function get_context_instance_by_id() {
-
 
1103
    throw new coding_exception('get_context_instance_by_id() is now removed, please use context::instance_by_id($id) instead.');
-
 
1104
}
-
 
1105
 
-
 
1106
/**
-
 
1107
 * Returns system context or null if can not be created yet.
-
 
1108
 *
-
 
1109
 * @see context_system::instance()
-
 
1110
 * @deprecated since 2.2
-
 
1111
 * @param bool $cache use caching
-
 
1112
 * @return context system context (null if context table not created yet)
-
 
1113
 */
-
 
1114
function get_system_context($cache = true) {
-
 
1115
    debugging('get_system_context() is deprecated, please use context_system::instance() instead.', DEBUG_DEVELOPER);
-
 
1116
    return context_system::instance(0, IGNORE_MISSING, $cache);
-
 
1117
}
-
 
1118
 
-
 
1119
/**
-
 
1120
 * @deprecated since 2.2, use $context->get_parent_context_ids() instead
-
 
1121
 */
-
 
1122
function get_parent_contexts() {
-
 
1123
    throw new coding_exception('get_parent_contexts() is removed, please use $context->get_parent_context_ids() instead.');
-
 
1124
}
-
 
1125
 
-
 
1126
/**
-
 
1127
 * @deprecated since Moodle 2.2
-
 
1128
 */
-
 
1129
function get_parent_contextid() {
-
 
1130
    throw new coding_exception('get_parent_contextid() is removed, please use $context->get_parent_context() instead.');
-
 
1131
}
-
 
1132
 
-
 
1133
/**
-
 
1134
 * @deprecated since 2.2
-
 
1135
 */
-
 
1136
function get_child_contexts() {
-
 
1137
    throw new coding_exception('get_child_contexts() is removed, please use $context->get_child_contexts() instead.');
-
 
1138
}
-
 
1139
 
-
 
1140
/**
-
 
1141
 * @deprecated since 2.2
-
 
1142
 */
-
 
1143
function create_contexts() {
-
 
1144
    throw new coding_exception('create_contexts() is removed, please use context_helper::create_instances() instead.');
-
 
1145
}
-
 
1146
 
-
 
1147
/**
-
 
1148
 * @deprecated since 2.2
-
 
1149
 */
-
 
1150
function cleanup_contexts() {
-
 
1151
    throw new coding_exception('cleanup_contexts() is removed, please use context_helper::cleanup_instances() instead.');
-
 
1152
}
-
 
1153
 
-
 
1154
/**
-
 
1155
 * @deprecated since 2.2
-
 
1156
 */
-
 
1157
function build_context_path() {
-
 
1158
    throw new coding_exception('build_context_path() is removed, please use context_helper::build_all_paths() instead.');
-
 
1159
}
-
 
1160
 
-
 
1161
/**
-
 
1162
 * @deprecated since 2.2
-
 
1163
 */
-
 
1164
function rebuild_contexts() {
-
 
1165
    throw new coding_exception('rebuild_contexts() is removed, please use $context->reset_paths(true) instead.');
-
 
1166
}
-
 
1167
 
-
 
1168
/**
-
 
1169
 * @deprecated since Moodle 2.2
-
 
1170
 */
-
 
1171
function preload_course_contexts() {
-
 
1172
    throw new coding_exception('preload_course_contexts() is removed, please use context_helper::preload_course() instead.');
-
 
1173
}
-
 
1174
 
-
 
1175
/**
-
 
1176
 * @deprecated since Moodle 2.2
-
 
1177
 */
-
 
1178
function context_moved() {
-
 
1179
    throw new coding_exception('context_moved() is removed, please use context::update_moved() instead.');
-
 
1180
}
-
 
1181
 
-
 
1182
/**
-
 
1183
 * @deprecated since 2.2
-
 
1184
 */
-
 
1185
function fetch_context_capabilities() {
-
 
1186
    throw new coding_exception('fetch_context_capabilities() is removed, please use $context->get_capabilities() instead.');
-
 
1187
}
-
 
1188
 
-
 
1189
/**
-
 
1190
 * @deprecated since 2.2
-
 
1191
 */
-
 
1192
function context_instance_preload() {
-
 
1193
    throw new coding_exception('context_instance_preload() is removed, please use context_helper::preload_from_record() instead.');
-
 
1194
}
-
 
1195
 
-
 
1196
/**
-
 
1197
 * @deprecated since 2.2
-
 
1198
 */
-
 
1199
function get_contextlevel_name() {
-
 
1200
    throw new coding_exception('get_contextlevel_name() is removed, please use context_helper::get_level_name() instead.');
-
 
1201
}
-
 
1202
 
-
 
1203
/**
-
 
1204
 * @deprecated since 2.2
-
 
1205
 */
-
 
1206
function print_context_name() {
-
 
1207
    throw new coding_exception('print_context_name() is removed, please use $context->get_context_name() instead.');
-
 
1208
}
-
 
1209
 
-
 
1210
/**
-
 
1211
 * @deprecated since 2.2, use $context->mark_dirty() instead
-
 
1212
 */
-
 
1213
function mark_context_dirty() {
-
 
1214
    throw new coding_exception('mark_context_dirty() is removed, please use $context->mark_dirty() instead.');
-
 
1215
}
-
 
1216
 
-
 
1217
/**
-
 
1218
 * @deprecated since Moodle 2.2
-
 
1219
 */
-
 
1220
function delete_context() {
-
 
1221
    throw new coding_exception('delete_context() is removed, please use context_helper::delete_instance() ' .
-
 
1222
            'or $context->delete_content() instead.');
-
 
1223
}
-
 
1224
 
-
 
1225
/**
-
 
1226
 * @deprecated since 2.2
-
 
1227
 */
-
 
1228
function get_context_url() {
-
 
1229
    throw new coding_exception('get_context_url() is removed, please use $context->get_url() instead.');
-
 
1230
}
-
 
1231
 
-
 
1232
/**
-
 
1233
 * @deprecated since 2.2
-
 
1234
 */
-
 
1235
function get_course_context() {
-
 
1236
    throw new coding_exception('get_course_context() is removed, please use $context->get_course_context(true) instead.');
-
 
1237
}
-
 
1238
 
-
 
1239
/**
-
 
1240
 * @deprecated since 2.2
-
 
1241
 */
-
 
1242
function get_user_courses_bycap() {
-
 
1243
    throw new coding_exception('get_user_courses_bycap() is removed, please use enrol_get_users_courses() instead.');
-
 
1244
}
-
 
1245
 
-
 
1246
/**
-
 
1247
 * @deprecated since Moodle 2.2
-
 
1248
 */
-
 
1249
function get_role_context_caps() {
-
 
1250
    throw new coding_exception('get_role_context_caps() is removed, it is really slow. Don\'t use it.');
-
 
1251
}
-
 
1252
 
-
 
1253
/**
-
 
1254
 * @deprecated since 2.2
-
 
1255
 */
-
 
1256
function get_courseid_from_context() {
-
 
1257
    throw new coding_exception('get_courseid_from_context() is removed, please use $context->get_course_context(false) instead.');
-
 
1258
}
-
 
1259
 
-
 
1260
/**
-
 
1261
 * @deprecated since 2.2
-
 
1262
 */
-
 
1263
function context_instance_preload_sql() {
-
 
1264
    throw new coding_exception('context_instance_preload_sql() is removed, please use context_helper::get_preload_record_columns_sql() instead.');
-
 
1265
}
-
 
1266
 
-
 
1267
/**
-
 
1268
 * @deprecated since 2.2
-
 
1269
 */
-
 
1270
function get_related_contexts_string() {
-
 
1271
    throw new coding_exception('get_related_contexts_string() is removed, please use $context->get_parent_context_ids(true) instead.');
-
 
1272
}
-
 
1273
 
-
 
1274
/**
-
 
1275
 * @deprecated since 2.6
-
 
1276
 */
-
 
1277
function get_plugin_list_with_file() {
-
 
1278
    throw new coding_exception('get_plugin_list_with_file() is removed, please use core_component::get_plugin_list_with_file() instead.');
-
 
1279
}
-
 
1280
 
-
 
1281
/**
-
 
1282
 * @deprecated since 2.6
-
 
1283
 */
-
 
1284
function check_browser_operating_system() {
-
 
1285
    throw new coding_exception('check_browser_operating_system is removed, please update your code to use core_useragent instead.');
-
 
1286
}
-
 
1287
 
-
 
1288
/**
-
 
1289
 * @deprecated since 2.6
-
 
1290
 */
-
 
1291
function check_browser_version() {
-
 
1292
    throw new coding_exception('check_browser_version is removed, please update your code to use core_useragent instead.');
-
 
1293
}
-
 
1294
 
-
 
1295
/**
-
 
1296
 * @deprecated since 2.6
-
 
1297
 */
-
 
1298
function get_device_type() {
-
 
1299
    throw new coding_exception('get_device_type is removed, please update your code to use core_useragent instead.');
-
 
1300
}
-
 
1301
 
-
 
1302
/**
-
 
1303
 * @deprecated since 2.6
-
 
1304
 */
-
 
1305
function get_device_type_list() {
-
 
1306
    throw new coding_exception('get_device_type_list is removed, please update your code to use core_useragent instead.');
-
 
1307
}
-
 
1308
 
-
 
1309
/**
-
 
1310
 * @deprecated since 2.6
-
 
1311
 */
-
 
1312
function get_selected_theme_for_device_type() {
-
 
1313
    throw new coding_exception('get_selected_theme_for_device_type is removed, please update your code to use core_useragent instead.');
-
 
1314
}
-
 
1315
 
-
 
1316
/**
-
 
1317
 * @deprecated since 2.6
-
 
1318
 */
-
 
1319
function get_device_cfg_var_name() {
-
 
1320
    throw new coding_exception('get_device_cfg_var_name is removed, please update your code to use core_useragent instead.');
-
 
1321
}
-
 
1322
 
-
 
1323
/**
-
 
1324
 * @deprecated since 2.6
-
 
1325
 */
-
 
1326
function set_user_device_type() {
-
 
1327
    throw new coding_exception('set_user_device_type is removed, please update your code to use core_useragent instead.');
-
 
1328
}
-
 
1329
 
-
 
1330
/**
-
 
1331
 * @deprecated since 2.6
-
 
1332
 */
-
 
1333
function get_user_device_type() {
-
 
1334
    throw new coding_exception('get_user_device_type is removed, please update your code to use core_useragent instead.');
-
 
1335
}
-
 
1336
 
-
 
1337
/**
-
 
1338
 * @deprecated since 2.6
-
 
1339
 */
-
 
1340
function get_browser_version_classes() {
-
 
1341
    throw new coding_exception('get_browser_version_classes is removed, please update your code to use core_useragent instead.');
-
 
1342
}
-
 
1343
 
-
 
1344
/**
-
 
1345
 * @deprecated since Moodle 2.6
-
 
1346
 */
-
 
1347
function generate_email_supportuser() {
-
 
1348
    throw new coding_exception('generate_email_supportuser is removed, please use core_user::get_support_user');
-
 
1349
}
-
 
1350
 
-
 
1351
/**
-
 
1352
 * @deprecated since Moodle 2.6
-
 
1353
 */
-
 
1354
function badges_get_issued_badge_info() {
-
 
1355
    throw new coding_exception('Function badges_get_issued_badge_info() is removed. Please use core_badges_assertion class and methods to generate badge assertion.');
-
 
1356
}
-
 
1357
 
-
 
1358
/**
-
 
1359
 * @deprecated since 2.6
-
 
1360
 */
-
 
1361
function can_use_html_editor() {
-
 
1362
    throw new coding_exception('can_use_html_editor is removed, please update your code to assume it returns true.');
-
 
1363
}
-
 
1364
 
-
 
1365
 
-
 
1366
/**
-
 
1367
 * @deprecated since Moodle 2.7, use {@link user_count_login_failures()} instead.
-
 
1368
 */
-
 
1369
function count_login_failures() {
-
 
1370
    throw new coding_exception('count_login_failures() can not be used any more, please use user_count_login_failures().');
-
 
1371
}
-
 
1372
 
-
 
1373
/**
-
 
1374
 * @deprecated since 2.7 MDL-33099/MDL-44088 - please do not use this function any more.
-
 
1375
 */
-
 
1376
function ajaxenabled() {
-
 
1377
    throw new coding_exception('ajaxenabled() can not be used anymore. Update your code to work with JS at all times.');
-
 
1378
}
-
 
1379
 
-
 
1380
/**
-
 
1381
 * @deprecated Since Moodle 2.7 MDL-44070
-
 
1382
 */
-
 
1383
function coursemodule_visible_for_user() {
-
 
1384
    throw new coding_exception('coursemodule_visible_for_user() can not be used any more,
-
 
1385
            please use \core_availability\info_module::is_user_visible()');
-
 
1386
}
-
 
1387
 
-
 
1388
/**
-
 
1389
 * @deprecated since Moodle 2.8 MDL-36014, MDL-35618 this functionality is removed
-
 
1390
 */
-
 
1391
function enrol_cohort_get_cohorts() {
-
 
1392
    throw new coding_exception('Function enrol_cohort_get_cohorts() is removed, use '.
-
 
1393
        'cohort_get_available_cohorts() instead');
-
 
1394
}
-
 
1395
 
-
 
1396
/**
-
 
1397
 * @deprecated since Moodle 2.8 MDL-36014 please use cohort_can_view_cohort()
-
 
1398
 */
-
 
1399
function enrol_cohort_can_view_cohort() {
-
 
1400
    throw new coding_exception('Function enrol_cohort_can_view_cohort() is removed, use cohort_can_view_cohort() instead');
-
 
1401
}
-
 
1402
 
-
 
1403
/**
-
 
1404
 * @deprecated since Moodle 2.8 MDL-36014 use cohort_get_available_cohorts() instead
-
 
1405
 */
-
 
1406
function cohort_get_visible_list() {
-
 
1407
    throw new coding_exception('Function cohort_get_visible_list() is removed. Please use function cohort_get_available_cohorts() ".
-
 
1408
        "that correctly checks capabilities.');
-
 
1409
}
-
 
1410
 
-
 
1411
/**
-
 
1412
 * @deprecated since Moodle 2.8 MDL-35618 this functionality is removed
-
 
1413
 */
-
 
1414
function enrol_cohort_enrol_all_users() {
-
 
1415
    throw new coding_exception('enrol_cohort_enrol_all_users() is removed. This functionality is moved to enrol_manual.');
-
 
1416
}
-
 
1417
 
-
 
1418
/**
-
 
1419
 * @deprecated since Moodle 2.8 MDL-35618 this functionality is removed
-
 
1420
 */
-
 
1421
function enrol_cohort_search_cohorts() {
-
 
1422
    throw new coding_exception('enrol_cohort_search_cohorts() is removed. This functionality is moved to enrol_manual.');
-
 
1423
}
-
 
1424
 
-
 
1425
/* === Apis deprecated in since Moodle 2.9 === */
-
 
1426
 
-
 
1427
/**
-
 
1428
 * @deprecated since Moodle 2.9 MDL-49371 - please do not use this function any more.
-
 
1429
 */
-
 
1430
function message_current_user_is_involved() {
-
 
1431
    throw new coding_exception('message_current_user_is_involved() can not be used any more.');
-
 
1432
}
-
 
1433
 
-
 
1434
/**
-
 
1435
 * @deprecated since Moodle 2.9 MDL-45898 - please do not use this function any more.
-
 
1436
 */
-
 
1437
function profile_display_badges() {
-
 
1438
    throw new coding_exception('profile_display_badges() can not be used any more.');
-
 
1439
}
-
 
1440
 
-
 
1441
/**
-
 
1442
 * @deprecated since Moodle 2.9 MDL-45774 - Please do not use this function any more.
-
 
1443
 */
-
 
1444
function useredit_shared_definition_preferences() {
-
 
1445
    throw new coding_exception('useredit_shared_definition_preferences() can not be used any more.');
-
 
1446
}
-
 
1447
 
-
 
1448
 
-
 
1449
/**
-
 
1450
 * @deprecated since Moodle 2.9
-
 
1451
 */
-
 
1452
function calendar_normalize_tz() {
-
 
1453
    throw new coding_exception('calendar_normalize_tz() can not be used any more, please use core_date::normalise_timezone() instead.');
-
 
1454
}
-
 
1455
 
-
 
1456
/**
-
 
1457
 * @deprecated since Moodle 2.9
-
 
1458
 */
-
 
1459
function get_user_timezone_offset() {
-
 
1460
    throw new coding_exception('get_user_timezone_offset() can not be used any more, please use standard PHP DateTimeZone class instead');
-
 
1461
 
-
 
1462
}
-
 
1463
 
-
 
1464
/**
-
 
1465
 * @deprecated since Moodle 2.9
-
 
1466
 */
-
 
1467
function get_timezone_offset() {
-
 
1468
    throw new coding_exception('get_timezone_offset() can not be used any more, please use standard PHP DateTimeZone class instead');
-
 
1469
}
-
 
1470
 
-
 
1471
/**
-
 
1472
 * @deprecated since Moodle 2.9
-
 
1473
 */
-
 
1474
function get_list_of_timezones() {
-
 
1475
    throw new coding_exception('get_list_of_timezones() can not be used any more, please use core_date::get_list_of_timezones() instead');
-
 
1476
}
-
 
1477
 
-
 
1478
/**
-
 
1479
 * @deprecated since Moodle 2.9
-
 
1480
 */
-
 
1481
function update_timezone_records() {
-
 
1482
    throw new coding_exception('update_timezone_records() can not be used any more, please use standard PHP DateTime class instead');
-
 
1483
}
-
 
1484
 
-
 
1485
/**
-
 
1486
 * @deprecated since Moodle 2.9
-
 
1487
 */
-
 
1488
function calculate_user_dst_table() {
-
 
1489
    throw new coding_exception('calculate_user_dst_table() can not be used any more, please use standard PHP DateTime class instead');
-
 
1490
}
-
 
1491
 
-
 
1492
/**
-
 
1493
 * @deprecated since Moodle 2.9
-
 
1494
 */
-
 
1495
function dst_changes_for_year() {
-
 
1496
    throw new coding_exception('dst_changes_for_year() can not be used any more, please use standard DateTime class instead');
-
 
1497
}
-
 
1498
 
-
 
1499
/**
-
 
1500
 * @deprecated since Moodle 2.9
-
 
1501
 */
-
 
1502
function get_timezone_record() {
-
 
1503
    throw new coding_exception('get_timezone_record() can not be used any more, please use standard PHP DateTime class instead');
-
 
1504
}
-
 
1505
 
-
 
1506
/* === Apis deprecated since Moodle 3.0 === */
-
 
1507
/**
-
 
1508
 * @deprecated since Moodle 3.0 MDL-49360 - please do not use this function any more.
-
 
1509
 */
-
 
1510
function get_referer() {
-
 
1511
    throw new coding_exception('get_referer() can not be used any more. Please use get_local_referer() instead.');
-
 
1512
}
-
 
1513
 
-
 
1514
/**
-
 
1515
 * @deprecated since Moodle 3.0 use \core_useragent::is_web_crawler instead.
-
 
1516
 */
-
 
1517
function is_web_crawler() {
-
 
1518
    throw new coding_exception('is_web_crawler() can not be used any more. Please use core_useragent::is_web_crawler() instead.');
-
 
1519
}
-
 
1520
 
-
 
1521
/**
-
 
1522
 * @deprecated since Moodle 3.0 MDL-50287 - please do not use this function any more.
-
 
1523
 */
-
 
1524
function completion_cron() {
-
 
1525
    throw new coding_exception('completion_cron() can not be used any more. Functionality has been moved to scheduled tasks.');
-
 
1526
}
-
 
1527
 
-
 
1528
/**
-
 
1529
 * @deprecated since 3.0
-
 
1530
 */
-
 
1531
function coursetag_get_tags() {
-
 
1532
    throw new coding_exception('Function coursetag_get_tags() can not be used any more. ' .
-
 
1533
            'Userid is no longer used for tagging courses.');
-
 
1534
}
-
 
1535
 
-
 
1536
/**
-
 
1537
 * @deprecated since 3.0
-
 
1538
 */
-
 
1539
function coursetag_get_all_tags() {
-
 
1540
    throw new coding_exception('Function coursetag_get_all_tags() can not be used any more. Userid is no ' .
-
 
1541
        'longer used for tagging courses.');
-
 
1542
}
-
 
1543
 
-
 
1544
/**
-
 
1545
 * @deprecated since 3.0
-
 
1546
 */
-
 
1547
function coursetag_get_jscript() {
-
 
1548
    throw new coding_exception('Function coursetag_get_jscript() can not be used any more and is obsolete.');
-
 
1549
}
-
 
1550
 
-
 
1551
/**
-
 
1552
 * @deprecated since 3.0
-
 
1553
 */
-
 
1554
function coursetag_get_jscript_links() {
-
 
1555
    throw new coding_exception('Function coursetag_get_jscript_links() can not be used any more and is obsolete.');
-
 
1556
}
-
 
1557
 
-
 
1558
/**
-
 
1559
 * @deprecated since 3.0
-
 
1560
 */
-
 
1561
function coursetag_get_records() {
-
 
1562
    throw new coding_exception('Function coursetag_get_records() can not be used any more. ' .
-
 
1563
            'Userid is no longer used for tagging courses.');
-
 
1564
}
-
 
1565
 
-
 
1566
/**
-
 
1567
 * @deprecated since 3.0
-
 
1568
 */
-
 
1569
function coursetag_store_keywords() {
-
 
1570
    throw new coding_exception('Function coursetag_store_keywords() can not be used any more. ' .
-
 
1571
            'Userid is no longer used for tagging courses.');
-
 
1572
}
-
 
1573
 
-
 
1574
/**
-
 
1575
 * @deprecated since 3.0
-
 
1576
 */
-
 
1577
function coursetag_delete_keyword() {
-
 
1578
    throw new coding_exception('Function coursetag_delete_keyword() can not be used any more. ' .
-
 
1579
            'Userid is no longer used for tagging courses.');
-
 
1580
}
-
 
1581
 
-
 
1582
/**
-
 
1583
 * @deprecated since 3.0
-
 
1584
 */
-
 
1585
function coursetag_get_tagged_courses() {
-
 
1586
    throw new coding_exception('Function coursetag_get_tagged_courses() can not be used any more. ' .
-
 
1587
            'Userid is no longer used for tagging courses.');
-
 
1588
}
-
 
1589
 
-
 
1590
/**
-
 
1591
 * @deprecated since 3.0
-
 
1592
 */
-
 
1593
function coursetag_delete_course_tags() {
-
 
1594
    throw new coding_exception('Function coursetag_delete_course_tags() is deprecated. ' .
-
 
1595
            'Use core_tag_tag::remove_all_item_tags().');
-
 
1596
}
-
 
1597
 
-
 
1598
/**
-
 
1599
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->update() instead
-
 
1600
 */
-
 
1601
function tag_type_set() {
-
 
1602
    throw new coding_exception('tag_type_set() can not be used anymore. Please use ' .
-
 
1603
        'core_tag_tag::get($tagid)->update().');
-
 
1604
}
-
 
1605
 
-
 
1606
/**
-
 
1607
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->update() instead
-
 
1608
 */
-
 
1609
function tag_description_set() {
-
 
1610
    throw new coding_exception('tag_description_set() can not be used anymore. Please use ' .
-
 
1611
        'core_tag_tag::get($tagid)->update().');
-
 
1612
}
-
 
1613
 
-
 
1614
/**
-
 
1615
 * @deprecated since 3.1. Use core_tag_tag::get_item_tags() instead
-
 
1616
 */
-
 
1617
function tag_get_tags() {
-
 
1618
    throw new coding_exception('tag_get_tags() can not be used anymore. Please use ' .
-
 
1619
        'core_tag_tag::get_item_tags().');
-
 
1620
}
-
 
1621
 
-
 
1622
/**
-
 
1623
 * @deprecated since 3.1
-
 
1624
 */
-
 
1625
function tag_get_tags_array() {
-
 
1626
    throw new coding_exception('tag_get_tags_array() can not be used anymore. Please use ' .
-
 
1627
        'core_tag_tag::get_item_tags_array().');
-
 
1628
}
-
 
1629
 
-
 
1630
/**
-
 
1631
 * @deprecated since 3.1. Use core_tag_tag::get_item_tags_array() or $OUTPUT->tag_list(core_tag_tag::get_item_tags())
-
 
1632
 */
-
 
1633
function tag_get_tags_csv() {
-
 
1634
    throw new coding_exception('tag_get_tags_csv() can not be used anymore. Please use ' .
-
 
1635
        'core_tag_tag::get_item_tags_array() or $OUTPUT->tag_list(core_tag_tag::get_item_tags()).');
-
 
1636
}
-
 
1637
 
-
 
1638
/**
-
 
1639
 * @deprecated since 3.1. Use core_tag_tag::get_item_tags() instead
-
 
1640
 */
-
 
1641
function tag_get_tags_ids() {
-
 
1642
    throw new coding_exception('tag_get_tags_ids() can not be used anymore. Please consider using ' .
-
 
1643
        'core_tag_tag::get_item_tags() or similar methods.');
-
 
1644
}
-
 
1645
 
-
 
1646
/**
-
 
1647
 * @deprecated since 3.1. Use core_tag_tag::get_by_name() or core_tag_tag::get_by_name_bulk()
-
 
1648
 */
-
 
1649
function tag_get_id() {
-
 
1650
    throw new coding_exception('tag_get_id() can not be used anymore. Please use ' .
-
 
1651
        'core_tag_tag::get_by_name() or core_tag_tag::get_by_name_bulk()');
-
 
1652
}
-
 
1653
 
-
 
1654
/**
-
 
1655
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->update() instead
-
 
1656
 */
-
 
1657
function tag_rename() {
-
 
1658
    throw new coding_exception('tag_rename() can not be used anymore. Please use ' .
-
 
1659
        'core_tag_tag::get($tagid)->update()');
-
 
1660
}
-
 
1661
 
-
 
1662
/**
-
 
1663
 * @deprecated since 3.1. Use core_tag_tag::remove_item_tag() instead
-
 
1664
 */
-
 
1665
function tag_delete_instance() {
-
 
1666
    throw new coding_exception('tag_delete_instance() can not be used anymore. Please use ' .
-
 
1667
        'core_tag_tag::remove_item_tag()');
-
 
1668
}
-
 
1669
 
-
 
1670
/**
-
 
1671
 * @deprecated since 3.1. Use core_tag_tag::get_by_name()->get_tagged_items() instead
-
 
1672
 */
-
 
1673
function tag_find_records() {
-
 
1674
    throw new coding_exception('tag_find_records() can not be used anymore. Please use ' .
-
 
1675
        'core_tag_tag::get_by_name()->get_tagged_items()');
-
 
1676
}
-
 
1677
 
-
 
1678
/**
-
 
1679
 * @deprecated since 3.1
-
 
1680
 */
-
 
1681
function tag_add() {
-
 
1682
    throw new coding_exception('tag_add() can not be used anymore. You can use ' .
-
 
1683
        'core_tag_tag::create_if_missing(), however it should not be necessary since tags are ' .
-
 
1684
        'created automatically when assigned to items');
-
 
1685
}
-
 
1686
 
-
 
1687
/**
-
 
1688
 * @deprecated since 3.1. Use core_tag_tag::set_item_tags() or core_tag_tag::add_item_tag() instead
-
 
1689
 */
-
 
1690
function tag_assign() {
-
 
1691
    throw new coding_exception('tag_assign() can not be used anymore. Please use ' .
-
 
1692
        'core_tag_tag::set_item_tags() or core_tag_tag::add_item_tag() instead. Tag instance ' .
-
 
1693
        'ordering should not be set manually');
-
 
1694
}
-
 
1695
 
-
 
1696
/**
-
 
1697
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->count_tagged_items() instead
-
 
1698
 */
-
 
1699
function tag_record_count() {
-
 
1700
    throw new coding_exception('tag_record_count() can not be used anymore. Please use ' .
-
 
1701
        'core_tag_tag::get($tagid)->count_tagged_items().');
-
 
1702
}
-
 
1703
 
-
 
1704
/**
-
 
1705
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->is_item_tagged_with() instead
-
 
1706
 */
-
 
1707
function tag_record_tagged_with() {
-
 
1708
    throw new coding_exception('tag_record_tagged_with() can not be used anymore. Please use ' .
-
 
1709
        'core_tag_tag::get($tagid)->is_item_tagged_with().');
-
 
1710
}
-
 
1711
 
-
 
1712
/**
-
 
1713
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->flag() instead
-
 
1714
 */
-
 
1715
function tag_set_flag() {
-
 
1716
    throw new coding_exception('tag_set_flag() can not be used anymore. Please use ' .
-
 
1717
        'core_tag_tag::get($tagid)->flag()');
-
 
1718
}
-
 
1719
 
-
 
1720
/**
-
 
1721
 * @deprecated since 3.1. Use core_tag_tag::get($tagid)->reset_flag() instead
-
 
1722
 */
-
 
1723
function tag_unset_flag() {
-
 
1724
    throw new coding_exception('tag_unset_flag() can not be used anymore. Please use ' .
-
 
1725
        'core_tag_tag::get($tagid)->reset_flag()');
-
 
1726
}
-
 
1727
 
-
 
1728
/**
-
 
1729
 * @deprecated since 3.1
-
 
1730
 */
-
 
1731
function tag_print_cloud() {
-
 
1732
    throw new coding_exception('tag_print_cloud() can not be used anymore. Please use ' .
-
 
1733
        'core_tag_collection::get_tag_cloud(), templateable core_tag\output\tagcloud and ' .
-
 
1734
        'template core_tag/tagcloud.');
-
 
1735
}
-
 
1736
 
-
 
1737
/**
-
 
1738
 * @deprecated since 3.0
-
 
1739
 */
-
 
1740
function tag_autocomplete() {
-
 
1741
    throw new coding_exception('tag_autocomplete() can not be used anymore. New form ' .
-
 
1742
        'element "tags" does proper autocomplete.');
-
 
1743
}
-
 
1744
 
-
 
1745
/**
-
 
1746
 * @deprecated since 3.1
-
 
1747
 */
-
 
1748
function tag_print_description_box() {
-
 
1749
    throw new coding_exception('tag_print_description_box() can not be used anymore. ' .
-
 
1750
        'See core_tag_renderer for similar code');
-
 
1751
}
-
 
1752
 
-
 
1753
/**
-
 
1754
 * @deprecated since 3.1
-
 
1755
 */
-
 
1756
function tag_print_management_box() {
-
 
1757
    throw new coding_exception('tag_print_management_box() can not be used anymore. ' .
-
 
1758
        'See core_tag_renderer for similar code');
-
 
1759
}
-
 
1760
 
-
 
1761
/**
-
 
1762
 * @deprecated since 3.1
-
 
1763
 */
-
 
1764
function tag_print_search_box() {
-
 
1765
    throw new coding_exception('tag_print_search_box() can not be used anymore. ' .
-
 
1766
        'See core_tag_renderer for similar code');
-
 
1767
}
-
 
1768
 
-
 
1769
/**
-
 
1770
 * @deprecated since 3.1
-
 
1771
 */
-
 
1772
function tag_print_search_results() {
-
 
1773
    throw new coding_exception('tag_print_search_results() can not be used anymore. ' .
-
 
1774
        'In /tag/search.php the search results are printed using the core_tag/tagcloud template.');
-
 
1775
}
-
 
1776
 
-
 
1777
/**
-
 
1778
 * @deprecated since 3.1
-
 
1779
 */
-
 
1780
function tag_print_tagged_users_table() {
-
 
1781
    throw new coding_exception('tag_print_tagged_users_table() can not be used anymore. ' .
-
 
1782
        'See core_user_renderer for similar code');
-
 
1783
}
-
 
1784
 
-
 
1785
/**
-
 
1786
 * @deprecated since 3.1
-
 
1787
 */
-
 
1788
function tag_print_user_box() {
-
 
1789
    throw new coding_exception('tag_print_user_box() can not be used anymore. ' .
-
 
1790
        'See core_user_renderer for similar code');
-
 
1791
}
-
 
1792
 
-
 
1793
/**
-
 
1794
 * @deprecated since 3.1
-
 
1795
 */
-
 
1796
function tag_print_user_list() {
-
 
1797
    throw new coding_exception('tag_print_user_list() can not be used anymore. ' .
-
 
1798
        'See core_user_renderer for similar code');
-
 
1799
}
-
 
1800
 
-
 
1801
/**
-
 
1802
 * @deprecated since 3.1
-
 
1803
 */
-
 
1804
function tag_display_name() {
-
 
1805
    throw new coding_exception('tag_display_name() can not be used anymore. Please use ' .
-
 
1806
        'core_tag_tag::make_display_name().');
-
 
1807
 
-
 
1808
}
-
 
1809
 
-
 
1810
/**
-
 
1811
 * @deprecated since 3.1
-
 
1812
 */
-
 
1813
function tag_normalize() {
-
 
1814
    throw new coding_exception('tag_normalize() can not be used anymore. Please use ' .
-
 
1815
        'core_tag_tag::normalize().');
-
 
1816
}
-
 
1817
 
-
 
1818
/**
-
 
1819
 * @deprecated since 3.1
-
 
1820
 */
-
 
1821
function tag_get_related_tags_csv() {
-
 
1822
    throw new coding_exception('tag_get_related_tags_csv() can not be used anymore. Please ' .
-
 
1823
        'consider looping through array or using $OUTPUT->tag_list(core_tag_tag::get_item_tags()).');
-
 
1824
}
-
 
1825
 
-
 
1826
/**
-
 
1827
 * @deprecated since 3.1
-
 
1828
 */
-
 
1829
function tag_set() {
-
 
1830
    throw new coding_exception('tag_set() can not be used anymore. Please use ' .
-
 
1831
        'core_tag_tag::set_item_tags().');
-
 
1832
}
-
 
1833
 
-
 
1834
/**
-
 
1835
 * @deprecated since 3.1
-
 
1836
 */
-
 
1837
function tag_set_add() {
-
 
1838
    throw new coding_exception('tag_set_add() can not be used anymore. Please use ' .
-
 
1839
        'core_tag_tag::add_item_tag().');
-
 
1840
}
-
 
1841
 
-
 
1842
/**
-
 
1843
 * @deprecated since 3.1
-
 
1844
 */
-
 
1845
function tag_set_delete() {
-
 
1846
    throw new coding_exception('tag_set_delete() can not be used anymore. Please use ' .
-
 
1847
        'core_tag_tag::remove_item_tag().');
-
 
1848
}
-
 
1849
 
-
 
1850
/**
-
 
1851
 * @deprecated since 3.1
-
 
1852
 */
-
 
1853
function tag_get() {
-
 
1854
    throw new coding_exception('tag_get() can not be used anymore. Please use ' .
-
 
1855
        'core_tag_tag::get() or core_tag_tag::get_by_name().');
-
 
1856
}
-
 
1857
 
-
 
1858
/**
-
 
1859
 * @deprecated since 3.1
-
 
1860
 */
-
 
1861
function tag_get_related_tags() {
-
 
1862
    throw new coding_exception('tag_get_related_tags() can not be used anymore. Please use ' .
-
 
1863
        'core_tag_tag::get_correlated_tags(), core_tag_tag::get_related_tags() or ' .
-
 
1864
        'core_tag_tag::get_manual_related_tags().');
-
 
1865
}
-
 
1866
 
-
 
1867
/**
-
 
1868
 * @deprecated since 3.1
-
 
1869
 */
-
 
1870
function tag_delete() {
-
 
1871
    throw new coding_exception('tag_delete() can not be used anymore. Please use ' .
-
 
1872
        'core_tag_tag::delete_tags().');
-
 
1873
}
-
 
1874
 
-
 
1875
/**
-
 
1876
 * @deprecated since 3.1
-
 
1877
 */
-
 
1878
function tag_delete_instances() {
-
 
1879
    throw new coding_exception('tag_delete_instances() can not be used anymore. Please use ' .
-
 
1880
        'core_tag_tag::delete_instances().');
-
 
1881
}
-
 
1882
 
-
 
1883
/**
-
 
1884
 * @deprecated since 3.1
-
 
1885
 */
-
 
1886
function tag_cleanup() {
-
 
1887
    throw new coding_exception('tag_cleanup() can not be used anymore. Please use ' .
-
 
1888
        '\core\task\tag_cron_task::cleanup().');
-
 
1889
}
-
 
1890
 
-
 
1891
/**
-
 
1892
 * @deprecated since 3.1
-
 
1893
 */
-
 
1894
function tag_bulk_delete_instances() {
-
 
1895
    throw new coding_exception('tag_bulk_delete_instances() can not be used anymore. Please use ' .
-
 
1896
        '\core\task\tag_cron_task::bulk_delete_instances().');
-
 
1897
 
-
 
1898
}
-
 
1899
 
-
 
1900
/**
-
 
1901
 * @deprecated since 3.1
-
 
1902
 */
-
 
1903
function tag_compute_correlations() {
-
 
1904
    throw new coding_exception('tag_compute_correlations() can not be used anymore. Please use ' .
-
 
1905
        'use \core\task\tag_cron_task::compute_correlations().');
-
 
1906
}
-
 
1907
 
-
 
1908
/**
-
 
1909
 * @deprecated since 3.1
-
 
1910
 */
-
 
1911
function tag_process_computed_correlation() {
-
 
1912
    throw new coding_exception('tag_process_computed_correlation() can not be used anymore. Please use ' .
-
 
1913
        'use \core\task\tag_cron_task::process_computed_correlation().');
-
 
1914
}
-
 
1915
 
-
 
1916
/**
-
 
1917
 * @deprecated since 3.1
-
 
1918
 */
-
 
1919
function tag_cron() {
-
 
1920
    throw new coding_exception('tag_cron() can not be used anymore. Please use ' .
-
 
1921
        'use \core\task\tag_cron_task::execute().');
-
 
1922
}
-
 
1923
 
-
 
1924
/**
-
 
1925
 * @deprecated since 3.1
-
 
1926
 */
-
 
1927
function tag_find_tags() {
-
 
1928
    throw new coding_exception('tag_find_tags() can not be used anymore.');
-
 
1929
}
-
 
1930
 
-
 
1931
/**
-
 
1932
 * @deprecated since 3.1
-
 
1933
 */
-
 
1934
function tag_get_name() {
-
 
1935
    throw new coding_exception('tag_get_name() can not be used anymore.');
-
 
1936
}
-
 
1937
 
-
 
1938
/**
-
 
1939
 * @deprecated since 3.1
-
 
1940
 */
-
 
1941
function tag_get_correlated() {
-
 
1942
    throw new coding_exception('tag_get_correlated() can not be used anymore. Please use ' .
-
 
1943
        'use core_tag_tag::get_correlated_tags().');
-
 
1944
 
-
 
1945
}
-
 
1946
 
-
 
1947
/**
-
 
1948
 * @deprecated since 3.1
-
 
1949
 */
-
 
1950
function tag_cloud_sort() {
-
 
1951
    throw new coding_exception('tag_cloud_sort() can not be used anymore. Similar method can ' .
-
 
1952
        'be found in core_tag_collection::cloud_sort().');
-
 
1953
}
-
 
1954
 
-
 
1955
/**
-
 
1956
 * @deprecated since Moodle 3.1
-
 
1957
 */
-
 
1958
function events_load_def() {
-
 
1959
    throw new coding_exception('events_load_def() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
1960
 
-
 
1961
}
-
 
1962
 
-
 
1963
/**
-
 
1964
 * @deprecated since Moodle 3.1
-
 
1965
 */
-
 
1966
function events_queue_handler() {
-
 
1967
    throw new coding_exception('events_queue_handler() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
1968
}
-
 
1969
 
-
 
1970
/**
-
 
1971
 * @deprecated since Moodle 3.1
-
 
1972
 */
-
 
1973
function events_dispatch() {
-
 
1974
    throw new coding_exception('events_dispatch() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
1975
}
-
 
1976
 
-
 
1977
/**
-
 
1978
 * @deprecated since Moodle 3.1
-
 
1979
 */
-
 
1980
function events_process_queued_handler() {
-
 
1981
    throw new coding_exception(
-
 
1982
        'events_process_queued_handler() has been deprecated along with all Events 1 API in favour of Events 2 API.'
-
 
1983
    );
-
 
1984
}
-
 
1985
 
-
 
1986
/**
-
 
1987
 * @deprecated since Moodle 3.1
-
 
1988
 */
-
 
1989
function events_update_definition() {
-
 
1990
    throw new coding_exception(
-
 
1991
        'events_update_definition has been deprecated along with all Events 1 API in favour of Events 2 API.'
-
 
1992
    );
-
 
1993
}
-
 
1994
 
-
 
1995
/**
-
 
1996
 * @deprecated since Moodle 3.1
-
 
1997
 */
-
 
1998
function events_cron() {
-
 
1999
    throw new coding_exception('events_cron() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
2000
}
-
 
2001
 
-
 
2002
/**
-
 
2003
 * @deprecated since Moodle 3.1
-
 
2004
 */
-
 
2005
function events_trigger_legacy() {
-
 
2006
    throw new coding_exception('events_trigger_legacy() has been deprecated along with all Events 1 API in favour of Events 2 API.');
619
 * @return stdClass|null The default category - the category in the first module context supplied in $contexts
2007
}
-
 
2008
 
-
 
2009
/**
-
 
2010
 * @deprecated since Moodle 3.1
-
 
2011
 */
-
 
2012
function events_is_registered() {
-
 
2013
    throw new coding_exception('events_is_registered() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
2014
}
-
 
2015
 
-
 
2016
/**
-
 
2017
 * @deprecated since Moodle 3.1
-
 
2018
 */
-
 
2019
function events_pending_count() {
-
 
2020
    throw new coding_exception('events_pending_count() has been deprecated along with all Events 1 API in favour of Events 2 API.');
-
 
2021
}
-
 
2022
 
-
 
2023
/**
-
 
2024
 * @deprecated since Moodle 3.0 - this is a part of clamav plugin now.
-
 
2025
 */
-
 
2026
function clam_message_admins() {
-
 
2027
    throw new coding_exception('clam_message_admins() can not be used anymore. Please use ' .
-
 
2028
        'message_admins() method of \antivirus_clamav\scanner class.');
-
 
2029
}
-
 
2030
 
-
 
2031
/**
-
 
2032
 * @deprecated since Moodle 3.0 - this is a part of clamav plugin now.
-
 
2033
 */
-
 
2034
function get_clam_error_code() {
-
 
2035
    throw new coding_exception('get_clam_error_code() can not be used anymore. Please use ' .
-
 
2036
        'get_clam_error_code() method of \antivirus_clamav\scanner class.');
-
 
2037
}
-
 
2038
 
-
 
2039
/**
-
 
2040
 * @deprecated since 3.1
-
 
2041
 */
-
 
2042
function course_get_cm_rename_action() {
-
 
2043
    throw new coding_exception('course_get_cm_rename_action() can not be used anymore. Please use ' .
-
 
2044
        'inplace_editable https://docs.moodle.org/dev/Inplace_editable.');
-
 
2045
 
-
 
2046
}
-
 
2047
 
-
 
2048
/**
-
 
2049
 * @deprecated since Moodle 3.1
-
 
2050
 */
-
 
2051
function course_scale_used() {
-
 
2052
    throw new coding_exception('course_scale_used() can not be used anymore. Plugins can ' .
-
 
2053
        'implement <modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
-
 
2054
}
-
 
2055
 
-
 
2056
/**
-
 
2057
 * @deprecated since Moodle 3.1
-
 
2058
 */
-
 
2059
function site_scale_used() {
-
 
2060
    throw new coding_exception('site_scale_used() can not be used anymore. Plugins can implement ' .
-
 
2061
        '<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
-
 
2062
}
-
 
2063
 
-
 
2064
/**
-
 
2065
 * @deprecated since Moodle 3.1. Use external_api::external_function_info().
-
 
2066
 */
-
 
2067
function external_function_info() {
-
 
2068
    throw new coding_exception('external_function_info() can not be used any'.
-
 
2069
        'more. Please use external_api::external_function_info() instead.');
-
 
2070
}
-
 
2071
 
-
 
2072
/**
-
 
2073
 * @deprecated since Moodle 3.2
-
 
2074
 * @see csv_import_reader::load_csv_content()
-
 
2075
 */
-
 
2076
function get_records_csv() {
-
 
2077
    throw new coding_exception('get_records_csv() can not be used anymore. Please use ' .
-
 
2078
        'lib/csvlib.class.php csv_import_reader() instead.');
-
 
2079
}
-
 
2080
 
-
 
2081
/**
-
 
2082
 * @deprecated since Moodle 3.2
-
 
2083
 */
-
 
2084
function put_records_csv() {
-
 
2085
    throw new coding_exception(__FUNCTION__ . '() has been removed, please use \core\dataformat::download_data() instead');
-
 
2086
}
-
 
2087
 
-
 
2088
/**
-
 
2089
 * @deprecated since Moodle 3.2
-
 
2090
 */
-
 
2091
function css_is_colour() {
-
 
2092
    throw new coding_exception('css_is_colour() can not be used anymore.');
-
 
2093
}
-
 
2094
 
-
 
2095
/**
-
 
2096
 * @deprecated since Moodle 3.2
-
 
2097
 */
-
 
2098
function css_is_width() {
-
 
2099
    throw new coding_exception('css_is_width() can not be used anymore.');
-
 
2100
}
-
 
2101
 
-
 
2102
/**
-
 
2103
 * @deprecated since Moodle 3.2
-
 
2104
 */
-
 
2105
function css_sort_by_count() {
-
 
2106
    throw new coding_exception('css_sort_by_count() can not be used anymore.');
-
 
2107
}
-
 
2108
 
-
 
2109
/**
-
 
2110
 * @deprecated since Moodle 3.2
-
 
2111
 */
-
 
2112
function message_get_course_contexts() {
-
 
2113
    throw new coding_exception('message_get_course_contexts() can not be used anymore.');
-
 
2114
}
-
 
2115
 
-
 
2116
/**
-
 
2117
 * @deprecated since Moodle 3.2
-
 
2118
 */
-
 
2119
function message_remove_url_params() {
-
 
2120
    throw new coding_exception('message_remove_url_params() can not be used anymore.');
-
 
2121
}
-
 
2122
 
-
 
2123
/**
-
 
2124
 * @deprecated since Moodle 3.2
-
 
2125
 */
-
 
2126
function message_count_messages() {
-
 
2127
    throw new coding_exception('message_count_messages() can not be used anymore.');
-
 
2128
}
-
 
2129
 
-
 
2130
/**
-
 
2131
 * @deprecated since Moodle 3.2
-
 
2132
 */
-
 
2133
function message_count_blocked_users() {
-
 
2134
    throw new coding_exception('message_count_blocked_users() can not be used anymore. Please use ' .
-
 
2135
        '\core_message\api::count_blocked_users() instead.');
-
 
2136
}
-
 
2137
 
-
 
2138
/**
-
 
2139
 * @deprecated since Moodle 3.2
-
 
2140
 */
-
 
2141
function message_contact_link() {
-
 
2142
    throw new coding_exception('message_contact_link() can not be used anymore.');
-
 
2143
}
-
 
2144
 
-
 
2145
/**
-
 
2146
 * @deprecated since Moodle 3.2
-
 
2147
 */
-
 
2148
function message_get_recent_notifications() {
-
 
2149
    throw new coding_exception('message_get_recent_notifications() can not be used anymore.');
-
 
2150
}
-
 
2151
 
-
 
2152
/**
-
 
2153
 * @deprecated since Moodle 3.2
-
 
2154
 */
-
 
2155
function message_history_link() {
-
 
2156
    throw new coding_exception('message_history_link() can not be used anymore.');
-
 
2157
}
-
 
2158
 
-
 
2159
/**
-
 
2160
 * @deprecated since Moodle 3.2
-
 
2161
 */
-
 
2162
function message_search() {
-
 
2163
    throw new coding_exception('message_search() can not be used anymore.');
-
 
2164
}
-
 
2165
 
-
 
2166
/**
-
 
2167
 * @deprecated since Moodle 3.2
-
 
2168
 */
-
 
2169
function message_shorten_message() {
-
 
2170
    throw new coding_exception('message_shorten_message() can not be used anymore.');
-
 
2171
}
-
 
2172
 
-
 
2173
/**
-
 
2174
 * @deprecated since Moodle 3.2
-
 
2175
 */
-
 
2176
function message_get_fragment() {
-
 
2177
    throw new coding_exception('message_get_fragment() can not be used anymore.');
-
 
2178
}
-
 
2179
 
-
 
2180
/**
-
 
2181
 * @deprecated since Moodle 3.2
-
 
2182
 */
-
 
2183
function message_get_history() {
-
 
2184
    throw new coding_exception('message_get_history() can not be used anymore.');
-
 
2185
}
-
 
2186
 
-
 
2187
/**
-
 
2188
 * @deprecated since Moodle 3.2
-
 
2189
 */
-
 
2190
function message_get_contact_add_remove_link() {
-
 
2191
    throw new coding_exception('message_get_contact_add_remove_link() can not be used anymore.');
-
 
2192
}
-
 
2193
 
-
 
2194
/**
-
 
2195
 * @deprecated since Moodle 3.2
-
 
2196
 */
-
 
2197
function message_get_contact_block_link() {
-
 
2198
    throw new coding_exception('message_get_contact_block_link() can not be used anymore.');
-
 
2199
}
-
 
2200
 
-
 
2201
/**
-
 
2202
 * @deprecated since Moodle 3.2
-
 
2203
 */
-
 
2204
function message_mark_messages_read() {
-
 
2205
    throw new coding_exception('message_mark_messages_read() can not be used anymore. Please use ' .
-
 
2206
        '\core_message\api::mark_all_messages_as_read() instead.');
-
 
2207
}
-
 
2208
 
-
 
2209
/**
-
 
2210
 * @deprecated since Moodle 3.2
-
 
2211
 */
-
 
2212
function message_can_post_message() {
-
 
2213
    throw new coding_exception('message_can_post_message() can not be used anymore. Please use ' .
-
 
2214
        '\core_message\api::can_send_message() instead.');
-
 
2215
}
-
 
2216
 
-
 
2217
/**
-
 
2218
 * @deprecated since Moodle 3.2
-
 
2219
 */
-
 
2220
function message_is_user_non_contact_blocked() {
-
 
2221
    throw new coding_exception('message_is_user_non_contact_blocked() can not be used anymore. Please use ' .
-
 
2222
        '\core_message\api::is_user_non_contact_blocked() instead.');
-
 
2223
}
-
 
2224
 
-
 
2225
/**
-
 
2226
 * @deprecated since Moodle 3.2
-
 
2227
 */
-
 
2228
function message_is_user_blocked() {
-
 
2229
    throw new coding_exception('message_is_user_blocked() can not be used anymore. Please use ' .
-
 
2230
        '\core_message\api::is_user_blocked() instead.');
-
 
2231
}
-
 
2232
 
-
 
2233
/**
-
 
2234
 * @deprecated since Moodle 3.2
-
 
2235
 */
-
 
2236
function print_log() {
-
 
2237
    throw new coding_exception('print_log() can not be used anymore. Please use the ' .
-
 
2238
        'report_log framework instead.');
-
 
2239
}
-
 
2240
 
-
 
2241
/**
-
 
2242
 * @deprecated since Moodle 3.2
-
 
2243
 */
-
 
2244
function print_mnet_log() {
-
 
2245
    throw new coding_exception('print_mnet_log() can not be used anymore. Please use the ' .
-
 
2246
        'report_log framework instead.');
-
 
2247
}
-
 
2248
 
-
 
2249
/**
-
 
2250
 * @deprecated since Moodle 3.2
-
 
2251
 */
-
 
2252
function print_log_csv() {
-
 
2253
    throw new coding_exception('print_log_csv() can not be used anymore. Please use the ' .
-
 
2254
        'report_log framework instead.');
-
 
2255
}
-
 
2256
 
-
 
2257
/**
-
 
2258
 * @deprecated since Moodle 3.2
-
 
2259
 */
-
 
2260
function print_log_xls() {
-
 
2261
    throw new coding_exception('print_log_xls() can not be used anymore. Please use the ' .
-
 
2262
        'report_log framework instead.');
-
 
2263
}
-
 
2264
 
-
 
2265
/**
-
 
2266
 * @deprecated since Moodle 3.2
-
 
2267
 */
-
 
2268
function print_log_ods() {
-
 
2269
    throw new coding_exception('print_log_ods() can not be used anymore. Please use the ' .
-
 
2270
        'report_log framework instead.');
-
 
2271
}
-
 
2272
 
-
 
2273
/**
-
 
2274
 * @deprecated since Moodle 3.2
-
 
2275
 */
-
 
2276
function build_logs_array() {
-
 
2277
    throw new coding_exception('build_logs_array() can not be used anymore. Please use the ' .
-
 
2278
        'report_log framework instead.');
-
 
2279
}
-
 
2280
 
-
 
2281
/**
-
 
2282
 * @deprecated since Moodle 3.2
-
 
2283
 */
-
 
2284
function get_logs_usercourse() {
-
 
2285
    throw new coding_exception('get_logs_usercourse() can not be used anymore. Please use the ' .
-
 
2286
        'report_log framework instead.');
-
 
2287
}
-
 
2288
 
-
 
2289
/**
-
 
2290
 * @deprecated since Moodle 3.2
-
 
2291
 */
-
 
2292
function get_logs_userday() {
-
 
2293
    throw new coding_exception('get_logs_userday() can not be used anymore. Please use the ' .
-
 
2294
        'report_log framework instead.');
-
 
2295
}
-
 
2296
 
-
 
2297
/**
-
 
2298
 * @deprecated since Moodle 3.2
-
 
2299
 */
-
 
2300
function get_logs() {
-
 
2301
    throw new coding_exception('get_logs() can not be used anymore. Please use the ' .
-
 
2302
        'report_log framework instead.');
-
 
2303
}
-
 
2304
 
-
 
2305
/**
-
 
2306
 * @deprecated since Moodle 3.2
-
 
2307
 */
-
 
2308
function prevent_form_autofill_password() {
-
 
2309
    throw new coding_exception('prevent_form_autofill_password() can not be used anymore.');
-
 
2310
}
-
 
2311
 
-
 
2312
/**
-
 
2313
 * @deprecated since Moodle 3.3 MDL-57370
-
 
2314
 */
-
 
2315
function message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100) {
-
 
2316
    throw new coding_exception('message_get_recent_conversations() can not be used any more. ' .
-
 
2317
        'Please use \core_message\api::get_conversations() instead.', DEBUG_DEVELOPER);
-
 
2318
}
-
 
2319
 
-
 
2320
/**
-
 
2321
 * @deprecated since Moodle 3.2
-
 
2322
 */
-
 
2323
function calendar_preferences_button() {
-
 
2324
    throw new coding_exception('calendar_preferences_button() can not be used anymore. The calendar ' .
-
 
2325
        'preferences are now linked to the user preferences page.');
-
 
2326
}
-
 
2327
 
-
 
2328
/**
-
 
2329
 * @deprecated since 3.3
-
 
2330
 */
-
 
2331
function calendar_wday_name() {
-
 
2332
    throw new coding_exception('Function calendar_wday_name() is removed and no longer used in core.');
-
 
2333
}
-
 
2334
 
-
 
2335
/**
-
 
2336
 * @deprecated since 3.3
-
 
2337
 */
-
 
2338
function calendar_get_block_upcoming() {
-
 
2339
    throw new coding_exception('Function calendar_get_block_upcoming() is removed,' .
-
 
2340
        'Please see block_calendar_upcoming::get_content() for the correct API usage.');
-
 
2341
}
-
 
2342
 
-
 
2343
/**
-
 
2344
 * @deprecated since 3.3
-
 
2345
 */
-
 
2346
function calendar_print_month_selector() {
-
 
2347
    throw new coding_exception('Function calendar_print_month_selector() is removed and can no longer used in core.');
-
 
2348
}
-
 
2349
 
-
 
2350
/**
-
 
2351
 * @deprecated since 3.3
-
 
2352
 */
-
 
2353
function calendar_cron() {
-
 
2354
    throw new coding_exception('Function calendar_cron() is removed. Please use the core\task\calendar_cron_task instead.');
-
 
2355
}
-
 
2356
 
-
 
2357
/**
-
 
2358
 * @deprecated since Moodle 3.4 and removed immediately. MDL-49398.
-
 
2359
 */
-
 
2360
function load_course_context() {
-
 
2361
    throw new coding_exception('load_course_context() is removed. Do not use private functions or data structures.');
-
 
2362
}
-
 
2363
 
-
 
2364
/**
-
 
2365
 * @deprecated since Moodle 3.4 and removed immediately. MDL-49398.
-
 
2366
 */
-
 
2367
function load_role_access_by_context() {
-
 
2368
    throw new coding_exception('load_role_access_by_context() is removed. Do not use private functions or data structures.');
-
 
2369
}
-
 
2370
 
-
 
2371
/**
-
 
2372
 * @deprecated since Moodle 3.4 and removed immediately. MDL-49398.
-
 
2373
 */
-
 
2374
function dedupe_user_access() {
-
 
2375
    throw new coding_exception('dedupe_user_access() is removed. Do not use private functions or data structures.');
-
 
2376
}
-
 
2377
 
-
 
2378
/**
-
 
2379
 * @deprecated since Moodle 3.4. MDL-49398.
-
 
2380
 */
-
 
2381
function get_user_access_sitewide() {
-
 
2382
    throw new coding_exception('get_user_access_sitewide() is removed. Do not use private functions or data structures.');
-
 
2383
}
-
 
2384
 
-
 
2385
/**
-
 
2386
 * @deprecated since Moodle 3.4. MDL-59333
-
 
2387
 */
-
 
2388
function calendar_get_mini() {
-
 
2389
    throw new coding_exception('calendar_get_mini() has been removed. Please update your code to use calendar_get_view.');
-
 
2390
}
-
 
2391
 
-
 
2392
/**
-
 
2393
 * @deprecated since Moodle 3.4. MDL-59333
-
 
2394
 */
-
 
2395
function calendar_get_upcoming() {
-
 
2396
    throw new coding_exception('calendar_get_upcoming() has been removed. ' .
-
 
2397
            'Please see block_calendar_upcoming::get_content() for the correct API usage.');
-
 
2398
}
-
 
2399
 
-
 
2400
/**
-
 
2401
 * @deprecated since Moodle 3.4. MDL-50666
-
 
2402
 */
-
 
2403
function allow_override() {
-
 
2404
    throw new coding_exception('allow_override() has been removed. Please update your code to use core_role_set_override_allowed.');
-
 
2405
}
-
 
2406
 
-
 
2407
/**
-
 
2408
 * @deprecated since Moodle 3.4. MDL-50666
-
 
2409
 */
-
 
2410
function allow_assign() {
-
 
2411
    throw new coding_exception('allow_assign() has been removed. Please update your code to use core_role_set_assign_allowed.');
-
 
2412
}
-
 
2413
 
-
 
2414
/**
-
 
2415
 * @deprecated since Moodle 3.4. MDL-50666
-
 
2416
 */
-
 
2417
function allow_switch() {
-
 
2418
    throw new coding_exception('allow_switch() has been removed. Please update your code to use core_role_set_switch_allowed.');
-
 
2419
}
-
 
2420
 
-
 
2421
/**
-
 
2422
 * @deprecated since Moodle 3.5. MDL-61132
-
 
2423
 */
-
 
2424
function question_add_tops() {
-
 
2425
    throw new coding_exception(
-
 
2426
        'question_add_tops() has been removed. You may want to pass $top = true to get_categories_for_contexts().'
-
 
2427
    );
-
 
2428
}
-
 
2429
 
-
 
2430
/**
-
 
2431
 * @deprecated since Moodle 3.5. MDL-61132
-
 
2432
 */
-
 
2433
function question_is_only_toplevel_category_in_context() {
-
 
2434
    throw new coding_exception('question_is_only_toplevel_category_in_context() has been removed. '
-
 
2435
            . 'Please update your code to use question_is_only_child_of_top_category_in_context() instead.');
-
 
2436
}
-
 
2437
 
-
 
2438
/**
-
 
2439
 * @deprecated since Moodle 3.5
-
 
2440
 */
-
 
2441
function message_move_userfrom_unread2read() {
-
 
2442
    throw new coding_exception('message_move_userfrom_unread2read() has been removed.');
-
 
2443
}
-
 
2444
 
-
 
2445
/**
-
 
2446
 * @deprecated since Moodle 3.5
-
 
2447
 */
-
 
2448
function message_get_blocked_users() {
-
 
2449
    throw new coding_exception(
-
 
2450
        'message_get_blocked_users() has been removed, please use \core_message\api::get_blocked_users() instead.'
-
 
2451
    );
-
 
2452
}
-
 
2453
 
-
 
2454
/**
-
 
2455
 * @deprecated since Moodle 3.5
-
 
2456
 */
-
 
2457
function message_get_contacts() {
-
 
2458
    throw new coding_exception('message_get_contacts() has been removed.');
-
 
2459
}
-
 
2460
 
-
 
2461
/**
-
 
2462
 * @deprecated since Moodle 3.5
-
 
2463
 */
-
 
2464
function message_mark_message_read() {
-
 
2465
    throw new coding_exception('message_mark_message_read() has been removed, please use \core_message\api::mark_message_as_read()
-
 
2466
        or \core_message\api::mark_notification_as_read().');
-
 
2467
}
-
 
2468
 
-
 
2469
/**
-
 
2470
 * @deprecated since Moodle 3.5
-
 
2471
 */
-
 
2472
function message_can_delete_message() {
-
 
2473
    throw new coding_exception(
-
 
2474
        'message_can_delete_message() has been removed, please use \core_message\api::can_delete_message() instead.'
-
 
2475
    );
-
 
2476
}
-
 
2477
 
-
 
2478
/**
-
 
2479
 * @deprecated since Moodle 3.5
-
 
2480
 */
-
 
2481
function message_delete_message() {
-
 
2482
    throw new coding_exception(
-
 
2483
        'message_delete_message() has been removed, please use \core_message\api::delete_message() instead.'
-
 
2484
    );
-
 
2485
}
-
 
2486
 
-
 
2487
/**
-
 
2488
 * @deprecated since 3.6
-
 
2489
 */
-
 
2490
function calendar_get_all_allowed_types() {
-
 
2491
    throw new coding_exception(
-
 
2492
        'calendar_get_all_allowed_types() has been removed. Please use calendar_get_allowed_types() instead.'
-
 
2493
    );
-
 
2494
 
-
 
2495
}
-
 
2496
 
-
 
2497
/**
-
 
2498
 * @deprecated since Moodle 3.6.
-
 
2499
 */
-
 
2500
function groups_get_all_groups_for_courses() {
-
 
2501
    throw new coding_exception(
-
 
2502
        'groups_get_all_groups_for_courses() has been removed and can not be used anymore.'
-
 
2503
    );
-
 
2504
}
-
 
2505
 
-
 
2506
/**
-
 
2507
 * @deprecated since Moodle 3.6. Please use the Events 2 API.
-
 
2508
 */
-
 
2509
function events_get_cached() {
-
 
2510
    throw new coding_exception(
-
 
2511
        'Events API using $handlers array has been removed in favour of Events 2 API, please use it instead.'
-
 
2512
    );
-
 
2513
}
-
 
2514
 
-
 
2515
/**
-
 
2516
 * @deprecated since Moodle 3.6. Please use the Events 2 API.
-
 
2517
 */
-
 
2518
function events_uninstall() {
-
 
2519
    throw new coding_exception(
-
 
2520
        'Events API using $handlers array has been removed in favour of Events 2 API, please use it instead.'
-
 
2521
    );
-
 
2522
}
-
 
2523
 
-
 
2524
/**
-
 
2525
 * @deprecated since Moodle 3.6. Please use the Events 2 API.
-
 
2526
 */
-
 
2527
function events_cleanup() {
-
 
2528
    throw new coding_exception(
-
 
2529
        'Events API using $handlers array has been removed in favour of Events 2 API, please use it instead.'
-
 
2530
    );
-
 
2531
}
-
 
2532
 
-
 
2533
/**
-
 
2534
 * @deprecated since Moodle 3.6. Please use the Events 2 API.
-
 
2535
 */
-
 
2536
function events_dequeue() {
-
 
2537
    throw new coding_exception(
-
 
2538
        'Events API using $handlers array has been removed in favour of Events 2 API, please use it instead.'
-
 
2539
    );
-
 
2540
}
-
 
2541
 
-
 
2542
/**
-
 
2543
 * @deprecated since Moodle 3.6. Please use the Events 2 API.
-
 
2544
 */
-
 
2545
function events_get_handlers() {
-
 
2546
    throw new coding_exception(
-
 
2547
        'Events API using $handlers array has been removed in favour of Events 2 API, please use it instead.'
-
 
2548
    );
-
 
2549
}
-
 
2550
 
-
 
2551
/**
-
 
2552
 * @deprecated since Moodle 3.6. Please use the get_roles_used_in_context().
-
 
2553
 */
-
 
2554
function get_roles_on_exact_context() {
-
 
2555
    throw new coding_exception(
-
 
2556
        'get_roles_on_exact_context() has been removed, please use get_roles_used_in_context() instead.'
-
 
2557
    );
-
 
2558
}
-
 
2559
 
-
 
2560
/**
-
 
2561
 * @deprecated since Moodle 3.6. Please use the get_roles_used_in_context().
-
 
2562
 */
-
 
2563
function get_roles_with_assignment_on_context() {
-
 
2564
    throw new coding_exception(
-
 
2565
        'get_roles_with_assignment_on_context() has been removed, please use get_roles_used_in_context() instead.'
-
 
2566
    );
-
 
2567
}
-
 
2568
 
-
 
2569
/**
-
 
2570
 * @deprecated since Moodle 3.6
-
 
2571
 */
-
 
2572
function message_add_contact() {
-
 
2573
    throw new coding_exception(
-
 
2574
        'message_add_contact() has been removed. Please use \core_message\api::create_contact_request() instead. ' .
-
 
2575
        'If you wish to block or unblock a user please use \core_message\api::is_blocked() and ' .
-
 
2576
        '\core_message\api::block_user() or \core_message\api::unblock_user() respectively.'
-
 
2577
    );
-
 
2578
}
-
 
2579
 
-
 
2580
/**
-
 
2581
 * @deprecated since Moodle 3.6
-
 
2582
 */
-
 
2583
function message_remove_contact() {
-
 
2584
    throw new coding_exception(
-
 
2585
        'message_remove_contact() has been removed. Please use \core_message\api::remove_contact() instead.'
-
 
2586
    );
-
 
2587
}
-
 
2588
 
-
 
2589
/**
-
 
2590
 * @deprecated since Moodle 3.6
-
 
2591
 */
-
 
2592
function message_unblock_contact() {
-
 
2593
    throw new coding_exception(
-
 
2594
        'message_unblock_contact() has been removed. Please use \core_message\api::unblock_user() instead.'
-
 
2595
    );
-
 
2596
}
-
 
2597
 
-
 
2598
/**
-
 
2599
 * @deprecated since Moodle 3.6
-
 
2600
 */
-
 
2601
function message_block_contact() {
-
 
2602
    throw new coding_exception(
-
 
2603
        'message_block_contact() has been removed. Please use \core_message\api::is_blocked() and ' .
-
 
2604
        '\core_message\api::block_user() instead.'
-
 
2605
    );
-
 
2606
}
-
 
2607
 
-
 
2608
/**
-
 
2609
 * @deprecated since Moodle 3.6
-
 
2610
 */
-
 
2611
function message_get_contact() {
-
 
2612
    throw new coding_exception(
-
 
2613
        'message_get_contact() has been removed. Please use \core_message\api::get_contact() instead.'
-
 
2614
    );
-
 
2615
}
-
 
2616
 
-
 
2617
/**
-
 
2618
 * @deprecated since Moodle 3.7
-
 
2619
 */
-
 
2620
function get_courses_page() {
-
 
2621
    throw new coding_exception(
-
 
2622
        'Function get_courses_page() has been removed. Please use core_course_category::get_courses() ' .
-
 
2623
        'or core_course_category::search_courses()'
-
 
2624
    );
-
 
2625
}
-
 
2626
 
-
 
2627
/**
-
 
2628
 * @deprecated since Moodle 3.8
-
 
2629
 */
-
 
2630
function report_insights_context_insights(\context $context) {
-
 
2631
    throw new coding_exception(
-
 
2632
        'Function report_insights_context_insights() ' .
-
 
2633
        'has been removed. Please use \core_analytics\manager::cached_models_with_insights instead'
-
 
2634
    );
-
 
2635
}
-
 
2636
 
-
 
2637
/**
-
 
2638
 * @deprecated since 3.9
-
 
2639
 */
-
 
2640
function get_module_metadata() {
-
 
2641
    throw new coding_exception(
-
 
2642
        'get_module_metadata() has been removed. Please use \core_course\local\service\content_item_service instead.');
-
 
2643
}
-
 
2644
 
-
 
2645
/**
-
 
2646
 * @deprecated since Moodle 3.9 MDL-63580. Please use the \core\task\manager::run_from_cli($task).
-
 
2647
 */
-
 
2648
function cron_run_single_task() {
-
 
2649
    throw new coding_exception(
-
 
2650
        'cron_run_single_task() has been removed. Please use \\core\task\manager::run_from_cli() instead.'
-
 
2651
    );
-
 
2652
}
-
 
2653
 
-
 
2654
/**
-
 
2655
 * @deprecated since Moodle 3.9 MDL-52846. Please use new task API.
-
 
2656
 */
-
 
2657
function cron_execute_plugin_type() {
-
 
2658
    throw new coding_exception(
-
 
2659
        'cron_execute_plugin_type() has been removed. Please, use the Task API instead: ' .
-
 
2660
        'https://moodledev.io/docs/apis/subsystems/task.'
-
 
2661
    );
-
 
2662
}
-
 
2663
 
-
 
2664
/**
-
 
2665
 * @deprecated since Moodle 3.9 MDL-52846. Please use new task API.
-
 
2666
 */
-
 
2667
function cron_bc_hack_plugin_functions() {
-
 
2668
    throw new coding_exception(
-
 
2669
        'cron_bc_hack_plugin_functions() has been removed. Please, use the Task API instead: ' .
-
 
2670
        'https://moodledev.io/docs/apis/subsystems/task.'
-
 
2671
    );
-
 
2672
}
-
 
2673
 
-
 
2674
/**
-
 
2675
 * @deprecated since Moodle 3.9 MDL-68612 - See \core_user\table\participants_search for an improved way to fetch participants.
-
 
2676
 */
-
 
2677
function user_get_participants_sql() {
-
 
2678
    $deprecatedtext = __FUNCTION__ . '() has been removed. ' .
-
 
2679
                 'Please use \core\table\participants_search::class with table filtersets instead.';
-
 
2680
    throw new coding_exception($deprecatedtext);
-
 
2681
}
-
 
2682
 
-
 
2683
/**
-
 
2684
 * @deprecated since Moodle 3.9 MDL-68612 - See \core_user\table\participants_search for an improved way to fetch participants.
-
 
2685
 */
-
 
2686
function user_get_total_participants() {
-
 
2687
    $deprecatedtext = __FUNCTION__ . '() has been removed. ' .
-
 
2688
                      'Please use \core\table\participants_search::class with table filtersets instead.';
-
 
2689
    throw new coding_exception($deprecatedtext);
-
 
2690
}
620
*/
2691
 
-
 
2692
/**
-
 
2693
 * @deprecated since Moodle 3.9 MDL-68612 - See \core_user\table\participants_search for an improved way to fetch participants.
-
 
2694
 */
-
 
2695
function user_get_participants() {
-
 
2696
    $deprecatedtext = __FUNCTION__ . '() has been removed. ' .
-
 
2697
                      'Please use \core\table\participants_search::class with table filtersets instead.';
-
 
2698
    throw new coding_exception($deprecatedtext);
-
 
2699
}
-
 
2700
 
-
 
2701
/**
-
 
2702
 * @deprecated Since Moodle 3.9. MDL-65835
-
 
2703
 */
-
 
2704
function plagiarism_save_form_elements() {
-
 
2705
    throw new coding_exception(
-
 
2706
        'Function plagiarism_save_form_elements() has been removed. ' .
-
 
2707
        'Please use {plugin name}_coursemodule_edit_post_actions() instead.'
-
 
2708
    );
-
 
2709
}
-
 
2710
 
-
 
2711
/**
-
 
2712
 * @deprecated Since Moodle 3.9. MDL-65835
-
 
2713
 */
-
 
2714
function plagiarism_get_form_elements_module() {
-
 
2715
    throw new coding_exception(
-
 
2716
        'Function plagiarism_get_form_elements_module() has been removed. ' .
-
 
2717
        'Please use {plugin name}_coursemodule_standard_elements() instead.'
-
 
2718
    );
-
 
2719
}
-
 
2720
 
-
 
2721
/**
-
 
2722
 * @deprecated Since Moodle 3.9 - MDL-68500 please use {@see \core\dataformat::download_data}
-
 
2723
 */
-
 
2724
function download_as_dataformat() {
-
 
2725
    throw new coding_exception(__FUNCTION__ . '() has been removed, please use \core\dataformat::download_data() instead');
-
 
2726
}
-
 
2727
 
-
 
2728
/**
-
 
2729
 * @deprecated since Moodle 3.10
-
 
2730
 */
-
 
2731
function make_categories_options() {
-
 
2732
    throw new coding_exception(__FUNCTION__ . '() has been removed. ' .
-
 
2733
        'Please use \core_course_category::make_categories_list() instead.');
-
 
2734
}
-
 
2735
 
-
 
2736
/**
-
 
2737
 * @deprecated since 3.10
-
 
2738
 */
-
 
2739
function message_count_unread_messages() {
-
 
2740
    throw new coding_exception('message_count_unread_messages has been removed.');
621
#[\core\attribute\deprecated('This method should not be used', since: '5.0', mdl: 'MDL-71378')]
-
 
622
function question_make_default_categories($contexts): object {
2741
}
623
    global $DB;
2742
 
624
    static $preferredlevels = [
2743
/**
-
 
Línea 2744... Línea -...
2744
 * @deprecated since 3.10
-
 
2745
 */
625
        CONTEXT_COURSE => 4,
2746
function serialise_tool_proxy() {
-
 
2747
    throw new coding_exception('serialise_tool_proxy has been removed.');
626
        CONTEXT_MODULE => 3,
2748
}
627
        CONTEXT_COURSECAT => 2,
2749
 
628
        CONTEXT_SYSTEM => 1,
Línea 2750... Línea 629...
2750
/**
629
    ];
2751
 * @deprecated Since Moodle 3.11.
630
 
2752
 */
-
 
2753
function badges_check_backpack_accessibility() {
-
 
2754
    throw new coding_exception('badges_check_backpack_accessibility() can not be used any more, it was only used for OBv1.0');
631
    $toreturn = null;
2755
}
-
 
2756
 
-
 
2757
/**
-
 
2758
 * @deprecated Since Moodle 3.11.
632
    $preferredness = 0;
2759
 */
633
    // If it already exists, just return it.
2760
function badges_setup_backpack_js() {
-
 
2761
    throw new coding_exception('badges_setup_backpack_js() can not be used any more, it was only used for OBv1.0');
634
    foreach ($contexts as $key => $context) {
2762
}
-
 
2763
 
-
 
2764
/**
-
 
2765
 * @deprecated Since Moodle 3.11.
635
        $topcategory = question_get_top_category($context->id, true);
2766
 */
-
 
2767
function badges_local_backpack_js() {
636
        if (!$exists = $DB->record_exists("question_categories",
2768
    throw new coding_exception('badges_local_backpack_js() can not be used any more, it was only used for OBv1.0');
637
            ['contextid' => $context->id, 'parent' => $topcategory->id])) {
2769
}
-
 
2770
 
-
 
2771
/**
-
 
2772
 * @deprecated since Moodle 3.11 MDL-45242
638
            // Otherwise, we need to make one.
2773
 */
-
 
2774
function get_extra_user_fields() {
-
 
2775
    throw new coding_exception('get_extra_user_fields() has been removed. Please use the \core_user\fields API instead.');
-
 
2776
}
-
 
2777
 
-
 
2778
/**
-
 
2779
 * @deprecated since Moodle 3.11 MDL-45242
-
 
2780
 */
639
            $category = new stdClass();
-
 
640
            $contextname = $context->get_context_name(false, true);
-
 
641
            // Max length of name field is 255.
2781
function get_extra_user_fields_sql() {
642
            $category->name = shorten_text(get_string('defaultfor', 'question', $contextname), 255);
2782
    throw new coding_exception('get_extra_user_fields_sql() has been removed. Please use the \core_user\fields API instead.');
643
            $category->info = get_string('defaultinfofor', 'question', $contextname);
2783
}
-
 
Línea 2784... Línea -...
2784
 
-
 
2785
/**
644
            $category->contextid = $context->id;
2786
 * @deprecated since Moodle 3.11 MDL-45242
-
 
2787
 */
645
            $category->parent = $topcategory->id;
2788
function get_user_field_name() {
646
            // By default, all categories get this number, and are sorted alphabetically.
2789
    throw new coding_exception('get_user_field_name() has been removed. Please use \core_user\fields::get_display_name() instead');
-
 
Línea 2790... Línea -...
2790
}
-
 
2791
 
-
 
2792
/**
-
 
2793
 * @deprecated since Moodle 3.11 MDL-45242
647
            $category->sortorder = 999;
2794
 */
-
 
2795
function get_all_user_name_fields() {
648
            $category->stamp = make_unique_id_code();
2796
    throw new coding_exception('get_all_user_name_fields() is deprecated. Please use the \core_user\fields API instead');
649
            $category->id = $DB->insert_record('question_categories', $category);
2797
}
650
        } else {
2798
 
651
            $category = question_get_default_category($context->id, true);
Línea 2799... Línea -...
2799
/**
-
 
2800
 * @deprecated since Moodle 3.11 MDL-71051
652
        }
-
 
653
        $thispreferredness = $preferredlevels[$context->contextlevel];
-
 
654
        if (has_any_capability(['moodle/question:usemine', 'moodle/question:useall'], $context)) {
2801
 */
655
            $thispreferredness += 10;
2802
function profile_display_fields() {
656
        }
-
 
657
        if ($thispreferredness > $preferredness) {
2803
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
658
            $toreturn = $category;
2804
}
659
            $preferredness = $thispreferredness;
-
 
660
        }
2805
 
661
    }
Línea 2806... Línea -...
2806
/**
-
 
2807
 * @deprecated since Moodle 3.11 MDL-71051
-
 
2808
 */
-
 
2809
function profile_edit_category() {
662
 
2810
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
2811
}
-
 
2812
 
663
    if (!is_null($toreturn)) {
Línea 2813... Línea 664...
2813
/**
664
        $toreturn = clone($toreturn);
2814
 * @deprecated since Moodle 3.11 MDL-71051
665
    }
2815
 */
-
 
2816
function profile_edit_field() {
666
    return $toreturn;
2817
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
2818
}
-
 
2819
 
-
 
2820
/**
667
}
2821
 * @deprecated since Moodle 4.0 MDL-71953
-
 
2822
 */
-
 
2823
function calendar_process_subscription_row() {
668
 
2824
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
2825
}
-
 
2826
 
669
/**
2827
/**
-
 
2828
 * @deprecated since Moodle 4.0 MDL-71953
-
 
2829
 */
-
 
2830
function calendar_import_icalendar_events() {
-
 
2831
    throw new coding_exception(__FUNCTION__ . '() has been removed. Please use calendar_import_events_from_ical() instead.');
-
 
2832
}
-
 
2833
 
-
 
2834
/**
-
 
2835
 * @deprecated since Moodle 4.0. Tabs navigation has been replaced with tertiary navigation.
-
 
2836
 */
670
 * All question categories and their questions are deleted for this course.
2837
function grade_print_tabs() {
671
 *
2838
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
2839
}
-
 
2840
 
-
 
2841
/**
-
 
2842
 * @deprecated since Moodle 4.0. Dropdown box navigation has been replaced with tertiary navigation.
-
 
2843
 */
-
 
2844
function print_grade_plugin_selector() {
-
 
2845
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
2846
}
-
 
2847
 
-
 
2848
/**
-
 
2849
 * @deprecated since Moodle 4.0. Please use {@link course_modinfo::purge_course_section_cache_by_id()}
-
 
2850
 *             or {@link course_modinfo::purge_course_section_cache_by_number()} instead.
-
 
2851
 */
-
 
2852
function course_purge_section_cache() {
-
 
2853
    throw new coding_exception(__FUNCTION__ . '() has been removed. ' .
-
 
2854
        'Please use course_modinfo::purge_course_section_cache_by_id() ' .
-
 
2855
        'or course_modinfo::purge_course_section_cache_by_number() instead.');
672
 * @param stdClass $course an object representing the activity
2856
}
-
 
2857
 
-
 
2858
/**
-
 
2859
 * @deprecated since Moodle 4.0. Please use {@link course_modinfo::purge_course_module_cache()} instead.
-
 
2860
 */
-
 
2861
function course_purge_module_cache() {
-
 
2862
    throw new coding_exception(__FUNCTION__ . '() has been removed. ' .
-
 
2863
        'Please use course_modinfo::purge_course_module_cache() instead.');
-
 
2864
}
673
 * @param bool $notused this argument is not used any more. Kept for backwards compatibility.
2865
 
674
 * @return bool always true.
2866
/**
-
 
2867
 * @deprecated since Moodle 4.0. Please use {@link course_modinfo::get_array_of_activities()} instead.
675
 */
2868
 */
676
#[\core\attribute\deprecated('This method should not be used', since: '5.0', mdl: 'MDL-71378')]
2869
function get_array_of_activities() {
-
 
2870
    throw new coding_exception(__FUNCTION__ . '() has been removed. ' .
-
 
2871
        'Please use course_modinfo::get_array_of_activities() instead.');
-
 
2872
}
-
 
2873
 
-
 
2874
/**
-
 
2875
 * Abort execution by throwing of a general exception,
677
function question_delete_course($course, $notused = false): bool {
2876
 * default exception handler displays the error message in most cases.
-
 
2877
 *
-
 
2878
 * @deprecated since Moodle 4.1
-
 
2879
 * @todo MDL-74484 Final deprecation in Moodle 4.5.
678
    \core\deprecation::emit_deprecation(__FUNCTION__);
2880
 * @param string $errorcode The name of the language string containing the error message.
679
 
2881
 *      Normally this should be in the error.php lang file.
680
    $coursecontext = context_course::instance($course->id);
-
 
681
    question_delete_context($coursecontext->id);
2882
 * @param string $module The language file to get the error message from.
682
    return true;
2883
 * @param string $link The url where the user will be prompted to continue.
683
}
2884
 *      If no url is provided the user will be directed to the site index page.
684
 
2885
 * @param object $a Extra words and phrases that might be required in the error string
685
/**
2886
 * @param string $debuginfo optional debugging information
686
 * Category is about to be deleted,
2887
 * @return void, always throws exception!
687
 * 1/ All question categories and their questions are deleted for this course category.
2888
 */
-
 
2889
function print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null) {
688
 * 2/ All questions are moved to new category
-
 
689
 *
2890
    debugging("The function print_error() is deprecated. " .
690
 * @param stdClass|core_course_category $category course category object
-
 
691
 * @param stdClass|core_course_category $newcategory empty means everything deleted, otherwise id of
2891
            "Please throw a new moodle_exception instance instead.", DEBUG_DEVELOPER);
692
 *      category where content moved
-
 
693
 * @param bool $notused this argument is no longer used. Kept for backwards compatibility.
2892
    throw new \moodle_exception($errorcode, $module, $link, $a, $debuginfo);
694
 * @return boolean
Línea 2893... Línea 695...
2893
}
695
 */
2894
 
-
 
2895
/**
-
 
2896
 * Execute cron tasks
-
 
2897
 *
696
#[\core\attribute\deprecated('This method should not be used', since: '5.0', mdl: 'MDL-71378')]
2898
 * @param int|null $keepalive The keepalive time for this cron run.
697
function question_delete_course_category($category, $newcategory, $notused = false): bool {
2899
 * @deprecated since 4.2 Use \core\cron::run_main_process() instead.
-
 
2900
 */
-
 
2901
function cron_run(?int $keepalive = null): void {
698
    global $DB;
2902
    debugging(
699
    \core\deprecation::emit_deprecation(__FUNCTION__);
2903
        'The cron_run() function is deprecated. Please use \core\cron::run_main_process() instead.',
-
 
2904
        DEBUG_DEVELOPER
700
 
2905
    );
701
    $context = context_coursecat::instance($category->id);
Línea 2906... Línea 702...
2906
    \core\cron::run_main_process($keepalive);
702
    if (empty($newcategory)) {
2907
}
-
 
2908
 
-
 
2909
/**
-
 
2910
 * Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.
-
 
2911
 *
-
 
2912
 * @param   int     $timenow The time this process started.
703
        question_delete_context($context->id);
2913
 * @deprecated since 4.2 Use \core\cron::run_scheduled_tasks() instead.
-
 
2914
 */
704
 
2915
function cron_run_scheduled_tasks(int $timenow) {
-
 
2916
    debugging(
-
 
2917
        'The cron_run_scheduled_tasks() function is deprecated. Please use \core\cron::run_scheduled_tasks() instead.',
705
    } else {
2918
        DEBUG_DEVELOPER
706
        // Move question categories to the new context.
2919
    );
-
 
2920
    \core\cron::run_scheduled_tasks($timenow);
707
        if (!$newcontext = context_coursecat::instance($newcategory->id)) {
2921
}
708
            return false;
Línea 2922... Línea 709...
2922
 
709
        }
2923
/**
-
 
2924
 * Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.
-
 
2925
 *
-
 
2926
 * @param   int     $timenow The time this process started.
-
 
2927
 * @param   int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
710
 
2928
 * @param   bool    $checklimits Should we check limits?
711
        // Only move question categories if there is any question category at all!
2929
 * @deprecated since 4.2 Use \core\cron::run_adhoc_tasks() instead.
-
 
2930
 */
-
 
2931
function cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true) {
712
        if ($topcategory = question_get_top_category($context->id)) {
2932
    debugging(
713
            $newtopcategory = question_get_top_category($newcontext->id, true);
2933
        'The cron_run_adhoc_tasks() function is deprecated. Please use \core\cron::run_adhoc_tasks() instead.',
-
 
2934
        DEBUG_DEVELOPER
714
 
2935
    );
715
            question_move_category_to_context($topcategory->id, $context->id, $newcontext->id);
Línea 2936... Línea 716...
2936
    \core\cron::run_adhoc_tasks($timenow, $keepalive, $checklimits);
716
            $DB->set_field('question_categories', 'parent', $newtopcategory->id, ['parent' => $topcategory->id]);
2937
}
717
            // Now delete the top category.
2938
 
718
            $DB->delete_records('question_categories', ['id' => $topcategory->id]);
2939
/**
719
        }
2940
 * Shared code that handles running of a single scheduled task within the cron.
720
    }
-
 
721
 
2941
 *
722
    return true;
-
 
723
}
2942
 * Not intended for calling directly outside of this library!
724
 
2943
 *
725
/**
2944
 * @param \core\task\task_base $task
726
 * Check if the igbinary extension installed is buggy one
-
 
727
 *
2945
 * @deprecated since 4.2 Use \core\cron::run_inner_scheduled_task() instead.
728
 * There are a few php-igbinary versions that are buggy and
2946
 */
729
 * return any unserialised array with wrong index. This defeats
2947
function cron_run_inner_scheduled_task(\core\task\task_base $task) {
-
 
2948
    debugging(
730
 * key() and next() operations on them.
2949
        'The cron_run_inner_scheduled_task() function is deprecated. Please use \core\cron::run_inner_scheduled_task() instead.',
731
 *
-
 
732
 * This library is used by MUC and also by memcached and redis
2950
        DEBUG_DEVELOPER
733
 * when available.
-
 
734
 *
2951
    );
735
 * Let's inform if there is some problem when:
Línea 2952... Línea 736...
2952
    \core\cron::run_inner_scheduled_task($task);
736
 *   - php 7.2 is being used (php 7.3 and up are immune).
2953
}
-
 
2954
 
737
 *   - the igbinary extension is installed.
2955
/**
738
 *   - the version of the extension is between 3.2.2 and 3.2.4.
2956
 * Shared code that handles running of a single adhoc task within the cron.
-
 
2957
 *
-
 
2958
 * @param \core\task\adhoc_task $task
739
 *   - the buggy behaviour is reproduced.
2959
 * @deprecated since 4.2 Use \core\cron::run_inner_adhoc_task() instead.
-
 
2960
 */
-
 
2961
function cron_run_inner_adhoc_task(\core\task\adhoc_task $task) {
-
 
2962
    debugging(
-
 
2963
        'The cron_run_inner_adhoc_task() function is deprecated. Please use \core\cron::run_inner_adhoc_task() instead.',
-
 
2964
        DEBUG_DEVELOPER
-
 
2965
    );
-
 
2966
    \core\cron::run_inner_adhoc_task($task);
-
 
2967
}
-
 
2968
 
-
 
2969
/**
-
 
2970
 * Sets the process title
-
 
2971
 *
-
 
2972
 * This makes it very easy for a sysadmin to immediately see what task
-
 
2973
 * a cron process is running at any given moment.
-
 
2974
 *
-
 
2975
 * @param string $title process status title
-
 
2976
 * @deprecated since 4.2 Use \core\cron::set_process_title() instead.
-
 
2977
 */
-
 
2978
function cron_set_process_title(string $title) {
-
 
2979
    debugging(
740
 *
2980
        'The cron_set_process_title() function is deprecated. Please use \core\cron::set_process_title() instead.',
-
 
2981
        DEBUG_DEVELOPER
741
 * @param environment_results $result object to update, if relevant.
2982
    );
-
 
2983
    \core\cron::set_process_title($title);
-
 
2984
}
-
 
2985
 
-
 
2986
/**
-
 
2987
 * Output some standard information during cron runs. Specifically current time
-
 
2988
 * and memory usage. This method also does gc_collect_cycles() (before displaying
-
 
2989
 * memory usage) to try to help PHP manage memory better.
-
 
2990
 *
-
 
2991
 * @deprecated since 4.2 Use \core\cron::trace_time_and_memory() instead.
-
 
2992
 */
-
 
2993
function cron_trace_time_and_memory() {
-
 
2994
    debugging(
-
 
2995
        'The cron_trace_time_and_memory() function is deprecated. Please use \core\cron::trace_time_and_memory() instead.',
-
 
2996
        DEBUG_DEVELOPER
-
 
2997
    );
-
 
2998
    \core\cron::trace_time_and_memory();
-
 
2999
}
-
 
3000
 
-
 
3001
/**
-
 
3002
 * Prepare the output renderer for the cron run.
-
 
3003
 *
742
 * @return environment_results|null updated results or null.
3004
 * This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
743
 *
3005
 * any other.
744
 * @deprecated Since Moodle 5.0
3006
 *
745
 * @todo Final deprecation on Moodle 6.0. See MDL-83675.
3007
 * @param   bool    $restore Whether to restore the original PAGE and OUTPUT
746
 */
3008
 * @deprecated since 4.2 Use \core\cron::prepare_core_renderer() instead.
747
#[\core\attribute\deprecated(
-
 
748
    since: '5.0',
3009
 */
749
    mdl: 'MDL-73700',
3010
function cron_prepare_core_renderer($restore = false) {
-
 
3011
    debugging(
-
 
3012
        'The cron_prepare_core_renderer() function is deprecated. Please use \core\cron::prepare_core_renderer() instead.',
750
    reason: 'Remove all the old php version checks from core',
3013
        DEBUG_DEVELOPER
751
)]
3014
    );
752
function check_igbinary322_version(environment_results $result) {
3015
    \core\cron::prepare_core_renderer($restore);
753
    \core\deprecation::emit_deprecation(__FUNCTION__);
3016
}
754
    return null;
3017
 
755
}
Línea 3018... Línea 756...
3018
/**
756
 
3019
 * Sets up current user and course environment (lang, etc.) in cron.
757
/**
3020
 * Do not use outside of cron script!
758
 * @deprecated since Moodle 4.3 MDL-79313
3021
 *
-
 
3022
 * @param stdClass $user full user object, null means default cron user (admin),
-
 
3023
 *                 value 'reset' means reset internal static caches.
-
 
3024
 * @param stdClass $course full course record, null means $SITE
-
 
3025
 * @param bool $leavepagealone If specified, stops it messing with global page object
-
 
3026
 * @deprecated since 4.2. Use \core\core::setup_user() instead.
-
 
3027
 * @return void
-
 
3028
 */
759
 */
3029
function cron_setup_user($user = null, $course = null, $leavepagealone = false) {
-
 
3030
    debugging(
-
 
3031
        'The cron_setup_user() function is deprecated. ' .
-
 
3032
            'Please use \core\cron::setup_user() and reset_user_cache() as appropriate instead.',
-
 
3033
        DEBUG_DEVELOPER
-
 
3034
    );
-
 
3035
 
-
 
3036
    if ($user === 'reset') {
-
 
3037
        \core\cron::reset_user_cache();
760
#[\core\attribute\deprecated(null, since: '4.3', mdl: 'MDL-79313', final: true)]
3038
        return;
-
 
3039
    }
-
 
3040
 
-
 
3041
    \core\cron::setup_user($user, $course, $leavepagealone);
-
 
3042
}
-
 
3043
 
761
function calendar_top_controls() {
-
 
762
    \core\deprecation::emit_deprecation(__FUNCTION__);
-
 
763
}
-
 
764
 
-
 
765
/**
-
 
766
 * @deprecated since Moodle 4.3 MDL-79432
-
 
767
 */
-
 
768
#[\core\attribute\deprecated(null, since: '4.3', mdl: 'MDL-79432', final: true)]
3044
/**
769
function calendar_get_link_previous() {
-
 
770
    \core\deprecation::emit_deprecation(__FUNCTION__);
3045
 * Get OAuth2 services for the external backpack.
771
}
3046
 *
772
 
3047
 * @return array
773
/**
3048
 * @throws coding_exception
774
 * @deprecated since Moodle 4.3 MDL-79432
3049
 * @deprecated since 4.3.
-
 
3050
 */
-
 
3051
function badges_get_oauth2_service_options() {
-
 
3052
    debugging(
-
 
3053
        'badges_get_oauth2_service_options() is deprecated. Don\'t use it.',
-
 
3054
        DEBUG_DEVELOPER
-
 
3055
    );
-
 
3056
    global $DB;
-
 
3057
 
-
 
3058
    $issuers = core\oauth2\api::get_all_issuers();
-
 
3059
    $options = ['' => 'None'];
-
 
3060
    foreach ($issuers as $issuer) {
-
 
3061
        $options[$issuer->get('id')] = $issuer->get('name');
-
 
3062
    }
-
 
3063
 
775
 */
3064
    return $options;
-
 
3065
}
-
 
3066
 
-
 
3067
/**
-
 
3068
 * Checks if the given device has a theme defined in config.php.
-
 
3069
 *
-
 
3070
 * @param string $device The device
-
 
3071
 * @deprecated since 4.3.
-
 
3072
 * @return bool
-
 
3073
 */
-
 
3074
function theme_is_device_locked($device) {
-
 
3075
    debugging(
-
 
3076
        __FUNCTION__ . '() is deprecated.' .
-
 
3077
            'All functions associated with device specific themes are being removed.',
-
 
3078
        DEBUG_DEVELOPER
-
 
3079
    );
-
 
3080
    global $CFG;
-
 
3081
    $themeconfigname = core_useragent::get_device_type_cfg_var_name($device);
-
 
3082
    return isset($CFG->config_php_settings[$themeconfigname]);
-
 
3083
}
-
 
3084
 
776
#[\core\attribute\deprecated(null, since: '4.3', mdl: 'MDL-79432', final: true)]
3085
/**
-
 
3086
 * Returns the theme named defined in config.php for the given device.
-
 
3087
 *
-
 
3088
 * @param string $device The device
-
 
3089
 * @deprecated since 4.3.
-
 
3090
 * @return string or null
-
 
3091
 */
-
 
3092
function theme_get_locked_theme_for_device($device) {
-
 
3093
    debugging(
-
 
3094
        __FUNCTION__ . '() is deprecated.' .
-
 
3095
            'All functions associated with device specific themes are being removed.',
-
 
3096
        DEBUG_DEVELOPER
-
 
3097
    );
-
 
3098
    global $CFG;
-
 
3099
 
-
 
3100
    if (!theme_is_device_locked($device)) {
-
 
3101
        return null;
-
 
3102
    }
-
 
3103
 
-
 
3104
    $themeconfigname = core_useragent::get_device_type_cfg_var_name($device);
-
 
3105
    return $CFG->config_php_settings[$themeconfigname];
-
 
3106
}
-
 
3107
 
-
 
3108
/**
-
 
3109
 * Try to generate cryptographically secure pseudo-random bytes.
-
 
3110
 *
-
 
3111
 * Note this is achieved by fallbacking between:
-
 
3112
 *  - PHP 7 random_bytes().
-
 
3113
 *  - OpenSSL openssl_random_pseudo_bytes().
-
 
3114
 *  - In house random generator getting its entropy from various, hard to guess, pseudo-random sources.
-
 
3115
 *
-
 
3116
 * @param int $length requested length in bytes
-
 
3117
 * @deprecated since 4.3.
-
 
3118
 * @return string binary data
-
 
3119
 */
-
 
3120
function random_bytes_emulate($length) {
-
 
3121
    debugging(
-
 
3122
            __FUNCTION__ . '() is deprecated.' .
-
 
3123
            'Please use random_bytes instead.',
-
 
3124
            DEBUG_DEVELOPER
-
 
3125
    );
-
 
3126
    return random_bytes($length);
-
 
3127
}
-
 
3128
 
-
 
3129
/**
-
 
3130
 * @deprecated since Moodle 4.0
-
 
3131
 */
-
 
3132
function question_preview_url() {
-
 
3133
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
3134
}
-
 
3135
 
-
 
3136
/**
-
 
3137
 * @deprecated since Moodle 4.0
-
 
3138
 */
-
 
3139
function question_preview_popup_params() {
-
 
3140
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
3141
}
-
 
3142
 
-
 
3143
/**
-
 
3144
 * @deprecated since Moodle 4.0
-
 
3145
 */
-
 
3146
function question_hash() {
-
 
3147
    throw new coding_exception(__FUNCTION__ . '() has been removed.');
-
 
3148
}
777
function calendar_get_link_next() {
-
 
778
    \core\deprecation::emit_deprecation(__FUNCTION__);
3149
 
779
}
-
 
780
 
-
 
781
/**
-
 
782
 * Get the previous month.
-
 
783
 *
-
 
784
 * @param int $month the number of the month.
3150
/**
785
 * @param int $year the number of the year.
-
 
786
 * @return array previous month
3151
 * @deprecated since Moodle 4.0 MDL-71573
787
 *