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.
$mform->setType('rootdir', PARAM_PLUGIN);
$mform->setAdvanced('rootdir');
$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'));
}
$this->add_action_buttons(false, get_string('installfromzipsubmit', 'tool_installaddon'));
}
defined('MOODLE_INTERNAL') || die();
$string['acknowledgement'] = 'Acknowledgement';
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!';
$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!';
*/
protected function validation_page_continue() {
*/
protected function validation_page_continue() {
$conturl = $this->validator->get_continue_url();
$conturl = $this->validator->get_continue_url();
if (is_null($conturl)) {
$contbutton = '';
if (is_null($conturl)) {
$contbutton = '';
} else {
$contbutton = $this->output->single_button(
$conturl, get_string('installaddon', 'tool_installaddon'), 'post',
array('class' => 'singlebutton continuebutton'));
} 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'));
}
$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;