diff --git a/admin/tool/installaddon/lang/en/tool_installaddon.php b/admin/tool/installaddon/lang/en/tool_installaddon.php index 236ad0057bb..76d27b980b1 100644 --- a/admin/tool/installaddon/lang/en/tool_installaddon.php +++ b/admin/tool/installaddon/lang/en/tool_installaddon.php @@ -50,6 +50,7 @@ $string['permcheckerror'] = 'Error while checking for write permission'; $string['permcheckprogress'] = 'Checking for write permission ...'; $string['permcheckresultno'] = 'Plugin type location {$a->path} is not writable'; $string['permcheckresultyes'] = 'Plugin type location {$a->path} is writable'; +$string['permcheckrepeat'] = 'Check again'; $string['pluginname'] = 'Plugin installer'; $string['remoterequestalreadyinstalled'] = 'There is a request to install plugin {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. However, this plugin is already installed on the site.'; $string['remoterequestconfirm'] = 'There is a request to install plugin {$a->name} ({$a->component}) version {$a->version} from the Moodle plugins directory on this site. If you continue, the plugin ZIP package will be downloaded for validation. Nothing will be installed yet.'; diff --git a/admin/tool/installaddon/renderer.php b/admin/tool/installaddon/renderer.php index c4c9706fcc4..51e298f0e89 100644 --- a/admin/tool/installaddon/renderer.php +++ b/admin/tool/installaddon/renderer.php @@ -83,7 +83,8 @@ class tool_installaddon_renderer extends plugin_renderer_base { $this->page->requires->yui_module('moodle-tool_installaddon-permcheck', 'M.tool_installaddon.permcheck.init', array(array('permcheckurl' => $permcheckurl->out()))); $this->page->requires->strings_for_js( - array('permcheckprogress', 'permcheckresultno', 'permcheckresultyes', 'permcheckerror'), 'tool_installaddon'); + array('permcheckprogress', 'permcheckresultno', 'permcheckresultyes', 'permcheckerror', 'permcheckrepeat'), + 'tool_installaddon'); $out = $this->output->header(); $out .= $this->index_page_heading(); diff --git a/admin/tool/installaddon/yui/permcheck/permcheck.js b/admin/tool/installaddon/yui/permcheck/permcheck.js index 97578b8a607..700f064d406 100644 --- a/admin/tool/installaddon/yui/permcheck/permcheck.js +++ b/admin/tool/installaddon/yui/permcheck/permcheck.js @@ -22,16 +22,25 @@ YUI.add('moodle-tool_installaddon-permcheck', function(Y) { this.config = config; var plugintypesel = Y.one('#tool_installaddon_installfromzip_plugintype'); if (plugintypesel) { - plugintypesel.on('change', this.check_for_permission, this); + plugintypesel.on('change', function() { + this.check_for_permission(plugintypesel); + }, this); + this.repeat_permcheck_icon = Y.Node.create('
'); + this.repeat_permcheck_icon.one('a').on('click', function(e) { + e.preventDefault(); + this.check_for_permission(plugintypesel); + }, this); } }, /** * @method check_for_permission - * @param {Event} e + * @param {Node} plugintypesel Plugin type selector node */ - check_for_permission : function(e) { - var plugintype = e.currentTarget.get('value'); + check_for_permission : function(plugintypesel) { + var plugintype = plugintypesel.get('value'); + if (plugintype == '') { return; } @@ -42,27 +51,10 @@ YUI.add('moodle-tool_installaddon-permcheck', function(Y) { 'sesskey' : M.cfg.sesskey, 'plugintype' : plugintype }, - 'arguments' : { - 'plugintypeselector' : e.currentTarget, - 'showresult' : function(msg, status) { - var resultline = Y.one('#tool_installaddon_installfromzip_permcheck'); - if (resultline) { - if (status === 'success') { - resultline.setContent('