From 550e03463b0fe071d282f24f6f2071dd3f09da59 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Fri, 2 Jun 2017 11:22:15 +0800 Subject: [PATCH] MDL-59008 repository: add reload parent window support to callback --- repository/repository_callback.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/repository/repository_callback.php b/repository/repository_callback.php index 83fb5e38e57..19cb9fa7aa3 100644 --- a/repository/repository_callback.php +++ b/repository/repository_callback.php @@ -69,6 +69,23 @@ $repo->callback(); // manually. $strhttpsbug = json_encode(get_string('cannotaccessparentwin', 'repository')); $strrefreshnonjs = get_string('refreshnonjsfilepicker', 'repository'); +$reloadparent = optional_param('reloadparent', false, PARAM_BOOL); +// If this request is coming from a popup, close window and reload parent window. +if ($reloadparent == true) { + $js = << + + + + + +EOD; + die($js); +} + $js =<<