mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-39249-upgrade-wizard' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
816659ed9e
@ -152,7 +152,7 @@ if ($fetchremote) {
|
||||
$deployer = available_update_deployer::instance();
|
||||
if ($deployer->enabled()) {
|
||||
$myurl = new moodle_url($PAGE->url, array('updatesonly' => $updatesonly, 'contribonly' => $contribonly));
|
||||
$deployer->initialize($myurl, $myurl);
|
||||
$deployer->initialize($myurl, new moodle_url('/admin'));
|
||||
|
||||
$deploydata = $deployer->submitted_data();
|
||||
if (!empty($deploydata)) {
|
||||
|
@ -279,10 +279,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
$output .= $this->output->container(get_string('updatepluginconfirmexternal', 'core_plugin', $repotype), 'updatepluginconfirmexternal');
|
||||
}
|
||||
|
||||
$widget = $deployer->make_execution_widget($data['updateinfo']);
|
||||
$widget = $deployer->make_execution_widget($data['updateinfo'], $data['returnurl']);
|
||||
$output .= $this->output->render($widget);
|
||||
|
||||
$output .= $this->output->single_button($data['returnurl'], get_string('cancel', 'core'), 'get');
|
||||
$output .= $this->output->single_button($data['callerurl'], get_string('cancel', 'core'), 'get');
|
||||
|
||||
$output .= $this->container_end();
|
||||
$output .= $this->footer();
|
||||
|
@ -2003,9 +2003,10 @@ class available_update_deployer {
|
||||
* Prepares a renderable widget to execute installation of an available update.
|
||||
*
|
||||
* @param available_update_info $info component version to deploy
|
||||
* @param moodle_url $returnurl URL to return after the installation execution
|
||||
* @return renderable
|
||||
*/
|
||||
public function make_execution_widget(available_update_info $info) {
|
||||
public function make_execution_widget(available_update_info $info, moodle_url $returnurl = null) {
|
||||
global $CFG;
|
||||
|
||||
if (!$this->initialized()) {
|
||||
@ -2022,7 +2023,11 @@ class available_update_deployer {
|
||||
|
||||
list($passfile, $password) = $this->prepare_authorization();
|
||||
|
||||
$upgradeurl = new moodle_url('/admin');
|
||||
if (is_null($returnurl)) {
|
||||
$returnurl = new moodle_url('/admin');
|
||||
} else {
|
||||
$returnurl = $returnurl;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'upgrade' => true,
|
||||
@ -2035,7 +2040,7 @@ class available_update_deployer {
|
||||
'dirroot' => $CFG->dirroot,
|
||||
'passfile' => $passfile,
|
||||
'password' => $password,
|
||||
'returnurl' => $upgradeurl->out(true),
|
||||
'returnurl' => $returnurl->out(false),
|
||||
);
|
||||
|
||||
if (!empty($CFG->proxyhost)) {
|
||||
@ -2206,7 +2211,7 @@ class available_update_deployer {
|
||||
if (!empty($this->callerurl)) {
|
||||
$data['callerurl'] = $this->callerurl->out(false);
|
||||
}
|
||||
if (!empty($this->callerurl)) {
|
||||
if (!empty($this->returnurl)) {
|
||||
$data['returnurl'] = $this->returnurl->out(false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user