mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-48493 admin: Move the acknowledgement to the plugin validation page
Previously, the acknowledgement was required only when installing plugins from the ZIP file. It is valid when installing plugins from the Plugins directory, too. So we display it at the validator page now to make sure it is displayed in both cases. There is no need to require the admin to check the acknowledgement box now. We do not do that anywhere in admin UI (and there are more dangerous operations than installing a plugin). Admins still can deploy plugins manually without this tool anyway. And at the end, they are admins. They should know what they are doing. Simply displaying the acknowledgement message before they click the install button is enough.
This commit is contained in:
parent
1f6a9391ef
commit
edb13e3c2d
@ -67,10 +67,6 @@ class tool_installaddon_installfromzip_form extends moodleform {
|
||||
$mform->setType('rootdir', PARAM_PLUGIN);
|
||||
$mform->setAdvanced('rootdir');
|
||||
|
||||
$mform->addElement('checkbox', 'acknowledgement', get_string('acknowledgement', 'tool_installaddon'),
|
||||
' '.get_string('acknowledgementtext', 'tool_installaddon'));
|
||||
$mform->addRule('acknowledgement', get_string('acknowledgementmust', 'tool_installaddon'), 'required', null, 'client');
|
||||
|
||||
$this->add_action_buttons(false, get_string('installfromzipsubmit', 'tool_installaddon'));
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$string['acknowledgement'] = 'Acknowledgement';
|
||||
$string['acknowledgementmust'] = 'You must acknowledge this';
|
||||
$string['acknowledgementtext'] = 'I understand that it is my responsibility to have full backups of this site prior to installing additional plugins. I accept and understand that plugins (especially but not only those originating in unofficial sources) may contain security holes, can make the site unavailable, or cause private data leaks or loss.';
|
||||
$string['featuredisabled'] = 'The plugin installer is disabled on this site.';
|
||||
$string['installaddon'] = 'Install plugin!';
|
||||
|
@ -381,19 +381,26 @@ class tool_installaddon_renderer extends plugin_renderer_base {
|
||||
*/
|
||||
protected function validation_page_continue() {
|
||||
|
||||
$output = '';
|
||||
$conturl = $this->validator->get_continue_url();
|
||||
|
||||
if (is_null($conturl)) {
|
||||
$contbutton = '';
|
||||
|
||||
} else {
|
||||
$contbutton = $this->output->single_button(
|
||||
$conturl, get_string('installaddon', 'tool_installaddon'), 'post',
|
||||
array('class' => 'singlebutton continuebutton'));
|
||||
$output .= $this->output->heading(get_string('acknowledgement', 'tool_installaddon'), 3);
|
||||
$output .= $this->output->container(get_string('acknowledgementtext', 'tool_installaddon'));
|
||||
}
|
||||
|
||||
$cancelbutton = $this->output->single_button(
|
||||
new moodle_url('/admin/tool/installaddon/index.php'), get_string('cancel', 'core'), 'get',
|
||||
array('class' => 'singlebutton cancelbutton'));
|
||||
|
||||
return $this->output->container($cancelbutton.$contbutton, 'postvalidationbuttons');
|
||||
$output .= $this->output->container($cancelbutton.$contbutton, 'postvalidationbuttons');
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user