$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)) {
$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();
* 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()) {
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,
'dirroot' => $CFG->dirroot,
'passfile' => $passfile,
'password' => $password,
- 'returnurl' => $upgradeurl->out(true),
+ 'returnurl' => $returnurl->out(false),
);
if (!empty($CFG->proxyhost)) {