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

/* @var $this \yii\base\View */
/* @var $url string */
/* @var $enforceRedirect boolean */
?>
<!DOCTYPE html>
<html>
<head>
11 12 13 14 15 16 17 18 19 20 21 22 23
    <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;
            }
        }
24
        popupWindowRedirect(<?= Json::encode($url) ?>, <?= Json::encode($enforceRedirect) ?>);
25
    </script>
26 27
</head>
<body>
Luciano Baraglia committed
28 29
<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>
30
<script type="text/javascript">
31 32
    document.getElementById('title').style.display = '';
    document.getElementById('link').style.display = 'none';
33 34
</script>
</body>
Qiang Xue committed
35
</html>