Merge branch 'MDL-31656-master-3' of git://git.luns.net.uk/moodle
[moodle.git] / lib / form / filemanager.js
index cd3b3ec..d97546b 100644 (file)
@@ -144,7 +144,9 @@ M.form_filemanager.init = function(Y, options) {
             this.filecount++;
             this.check_buttons();
             this.refresh(this.currentpath);
-            M.util.set_form_changed();
+            if (typeof M.core_formchangechecker != 'undefined') {
+                M.core_formchangechecker.set_form_changed();
+            }
         },
         check_buttons: function() {
             var button_addfile  = Y.one("#btnadd-"+this.client_id);
@@ -214,7 +216,9 @@ M.form_filemanager.init = function(Y, options) {
                                 scope.mkdir_dialog.hide();
                                 scope.refresh(filepath);
                                 Y.one('#fm-newname').set('value', '');
-                                M.util.set_form_changed();
+                                if (typeof M.core_formchangechecker != 'undefined') {
+                                    M.core_formchangechecker.set_form_changed();
+                                }
                             }
                         });
                     }
@@ -573,7 +577,9 @@ M.form_filemanager.init = function(Y, options) {
                         callback: function(id, obj, args) {
                             scope.filecount--;
                             scope.refresh(obj.filepath);
-                            M.util.set_form_changed();
+                            if (typeof M.core_formchangechecker != 'undefined') {
+                                M.core_formchangechecker.set_form_changed();
+                            }
                             if (scope.filecount < scope.maxfiles && scope.maxfiles!=-1) {
                                 var button_addfile  = Y.one("#btnadd-"+scope.client_id);
                                 button_addfile.setStyle('display', 'inline');
@@ -621,7 +627,9 @@ M.form_filemanager.init = function(Y, options) {
                                 alert(M.str.repository.fileexists);
                             } else {
                                 scope.refresh(obj.filepath);
-                                M.util.set_form_changed();
+                                if (typeof M.core_formchangechecker != 'undefined') {
+                                    M.core_formchangechecker.set_form_changed();
+                                }
                             }
                             Y.one('#fm-rename-input').set('value', '');
                             scope.rename_dialog.hide();
@@ -699,7 +707,9 @@ M.form_filemanager.init = function(Y, options) {
                             }
                             dialog.cancel();
                             scope.refresh(p);
-                            M.util.set_form_changed();
+                            if (typeof M.core_formchangechecker != 'undefined') {
+                                M.core_formchangechecker.set_form_changed();
+                            }
                         }
                     });
                 }