Skip to content

Commit

Permalink
Add a close button option
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel authored and daniel committed Jun 15, 2020
1 parent e736da4 commit 96b6c99
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions view/userLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
</div>
</div>
<script>
function openLoginWindow(){
function openLoginWindow() {
win = window.open('<?php echo $global['webSiteRootURL']; ?>user?redirectUri=<?php print isset($_GET['redirectUri']) ? $_GET['redirectUri'] : ""; ?>', 'Login Page', "width=640,height=480,scrollbars=no");
}
var win;
openLoginWindow();
var logintimer = setInterval(function () {
if (win.closed) {
clearInterval(logintimer);
document.location = "<?php print isset($_GET['redirectUri']) ? $_GET['redirectUri'] : $global['webSiteRootURL']; ?>";
}
}, 1000);
$(document).ready(function () {
if (!win || win.closed || typeof win.closed == 'undefined') {
//swal("<?php echo __("Sorry!"); ?>", "<?php echo __("In order to enjoy our login feature, you need to allow our pop-ups in your browser."); ?>", "error");
}
});
var win;
openLoginWindow();
var logintimer = setInterval(function () {
if (win.closed) {
clearInterval(logintimer);
document.location = "<?php print isset($_GET['redirectUri']) ? $_GET['redirectUri'] : $global['webSiteRootURL']; ?>";
}
}, 1000);
$(document).ready(function () {
if (!win || win.closed || typeof win.closed == 'undefined') {
//swal("<?php echo __("Sorry!"); ?>", "<?php echo __("In order to enjoy our login feature, you need to allow our pop-ups in your browser."); ?>", "error");
}
});
</script>
<?php
return false;
Expand All @@ -50,7 +50,20 @@ function openLoginWindow(){
<div class="hidden-xs col-sm-2 col-md-3 col-lg-4"></div>
<div class="col-xs-12 col-sm-8 col-md-6 col-lg-4 list-group-item ">
<fieldset>
<legend class=" hidden-xs"><?php echo __("Please sign in"); ?></legend>
<legend class=" hidden-xs">
<?php
echo __("Please sign in");
if (!empty($advancedCustomUser->userMustBeLoggedInCloseButtonURL)) {
?>
<div class="pull-right">
<a id="buttonMyNavbar" class=" btn btn-default navbar-btn" style="padding: 6px 12px; margin-right: 40px;" href="<?php echo $advancedCustomUser->userMustBeLoggedInCloseButtonURL; ?>">
<i class="fas fa-times"></i>
</a>
</div>
<?php
}
?>
</legend>


<?php
Expand Down

0 comments on commit 96b6c99

Please sign in to comment.