redirect.php 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?php
use yii\helpers\Html;
use yii\helpers\Json;

/* @var $this \yii\base\View */
/* @var $url string */
/* @var $enforceRedirect boolean */
?>
<!DOCTYPE html>
<html>
<head>
12 13 14 15 16 17 18 19 20 21 22 23 24
    <script>
        function popupWindowRedirect(url, enforceRedirect)
        {
            if (window.opener && !window.opener.closed) {
                if (enforceRedirect === undefined || enforceRedirect) {
                    window.opener.location = url;
                }
                window.opener.focus();
                window.close();
            } else {
                window.location = url;
            }
        }
25
        popupWindowRedirect(<?= Json::encode($url) ?>, <?= Json::encode($enforceRedirect) ?>);
26
    </script>
27 28
</head>
<body>
Luciano Baraglia committed
29 30
<h2 id="title" style="display:none;">Redirecting back to the &quot;<?= Yii::$app->name ?>&quot;...</h2>
<h3 id="link"><a href="<?= $url ?>">Click here to return to the &quot;<?= Yii::$app->name ?>&quot;.</a></h3>
31
<script type="text/javascript">
32 33
    document.getElementById('title').style.display = '';
    document.getElementById('link').style.display = 'none';
34 35
</script>
</body>
Qiang Xue committed
36
</html>