mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-76974 javascript: convert remaining uses of old preferences API.
Implement component preference definition callbacks, update JS code to use the `core_user/repository` module instead of the now deprecated API.
This commit is contained in:
parent
d096c60e0c
commit
b30245b3e2
21 changed files with 180 additions and 38 deletions
|
@ -2125,8 +2125,10 @@ M.core_filepicker.init = function(Y, options) {
|
|||
},
|
||||
set_preference: function(name, value) {
|
||||
if (this.options.userprefs[name] != value) {
|
||||
M.util.set_user_preference('filepicker_' + name, value);
|
||||
this.options.userprefs[name] = value;
|
||||
require(['core_user/repository'], function(UserRepository) {
|
||||
UserRepository.setUserPreference('filepicker_' + name, value);
|
||||
this.options.userprefs[name] = value;
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
in_iframe: function () {
|
||||
|
|
|
@ -3190,11 +3190,6 @@ function initialise_filepicker($args) {
|
|||
$return->userprefs['recentlicense'] = get_user_preferences('filepicker_recentlicense', '');
|
||||
$return->userprefs['recentviewmode'] = get_user_preferences('filepicker_recentviewmode', '');
|
||||
|
||||
user_preference_allow_ajax_update('filepicker_recentrepository', PARAM_INT);
|
||||
user_preference_allow_ajax_update('filepicker_recentlicense', PARAM_SAFEDIR);
|
||||
user_preference_allow_ajax_update('filepicker_recentviewmode', PARAM_INT);
|
||||
|
||||
|
||||
// provided by form element
|
||||
$return->accepted_types = file_get_typegroup('extension', $args->accepted_types);
|
||||
$return->return_types = $args->return_types;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue