This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
uio-markup.php
109 lines (93 loc) · 5.34 KB
/
uio-markup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<script type="text/javascript">
idi.setUpLoginOutPanel = function () {
var myPanel = fluid.slidingPanel(idi.selectors.loginContainer, {
selectors: {
panel: idi.selectors.loginPanel,
toggleButton: idi.selectors.loginToggleBtn
},
strings: {
<?php if ( is_user_logged_in() ) {
echo 'showText: "Logout", hideText: "Logout"';
} else {
echo 'showText: "Login", hideText: "Login"';
}?>
},
listeners: {
onPanelShow: function () {
// close UIO panel if it was open
idi.closeOpenedPanel($(idi.selectors.UIOiFrame), $(idi.selectors.UIOToggleButton));
<?php if ($_GET['idilogout'] == "true"): ?>
$(idi.selectors.loginForm).show();
$(idi.selectors.logoutText).hide();
<?php endif; ?>
}
}
});
<?php if ($_GET['idilogout'] == "true"): ?> //Logout has reloaded page, open panel with logout confirmation
$(idi.selectors.loginPanel).show();
$(idi.selectors.logoutText).show();
myPanel.model.isShowing = true;
<?php elseif ($_GET['idilogin'] == "failed"): ?>//Login errors, open panel with login form and errors
$(idi.selectors.loginPanel).show();
$(idi.selectors.loginForm).show();
myPanel.model.isShowing = true;
<?php else: ?> //Default behaviour
$(idi.selectors.loginPanel).hide();
$(idi.selectors.loginForm).show();
<?php endif; ?>
//Events
$('.idi-logout').click(function() { //Logout button
$(idi.selectors.loginPanel).hide();
$(idi.selectors.loginForm).hide();
});
$('.idi-login-link').click(function() { //Login link within logout text
$(idi.selectors.logoutText).hide();
$(idi.selectors.loginForm).show();
});
};
</script>
<!-- begin markup for UI Options Fat Panel -->
<div class="flc-uiOptions-fatPanel fl-uiOptions-fatPanel">
<div id="myUIOptions" class="flc-slidingPanel-panel flc-uiOptions-iframe"></div>
<div class="idi-slidingPanel-panel idi-loginOutPanel">
<div class="idi-logout-text fl-text-align-center" style="display: none;">
<p>You have been successfully logged out. <a href="#" class="idi-login-link">Login</a>.</p>
</div>
<div class="idi-login-form fl-centered " style="display: none;">
<?php if ($_GET['idilogin'] == "failed") { ?>
<p class="error fl-text-align-center">Invalid username or password.</p>
<?php } ?>
<form method="post" action="<?php echo wp_login_url(get_permalink());?>" id="loginform" name="loginform">
<div class="login-username">
<label for="user_login">Username</label>
<div>
<input type="text" placeholder="your username or email" tabindex="10" size="20" value="" class="input" id="user_login" name="log">
<!-- br/><div class="idi-login-extra idi-login-signup"><a href="">Sign up</a></div -->
</div>
</div>
<div class="login-password">
<label for="user_pass">Password</label>
<div>
<input type="password" placeholder="your password" tabindex="20" size="20" value="" class="input" id="user_pass" name="pwd">
<br/><div class="idi-login-extra idi-login-forgot"><a href="<?php echo wp_lostpassword_url(); ?>">Forgot my password</a></div>
</div>
</div>
<div class="login-submit">
<input type="submit" tabindex="100" value="Login" class="button-primary" id="wp-submit" name="wp-submit">
</div>
</form>
</div>
</div>
<div class="fl-panelBar">
<button class="flc-slidingPanel-toggleButton fl-toggleButton idi-uio-button">Preferences</button>
<?php if ( is_user_logged_in() ):
global $current_user;
get_currentuserinfo(); ?>
<a href="<?php echo wp_logout_url(add_query_arg( 'idilogout', 'true', get_permalink())); ?>" class="idi-logout fl-force-right"><button class="idi-slidingPanel-toggleButton fl-toggleButton idi-loginout">Login</button></a>
<div class="fl-force-right idi-loggedin">Logged in as <strong><?php echo $current_user->user_login; ?></strong></div>
<?php else: ?>
<button class="idi-slidingPanel-toggleButton fl-toggleButton idi-loginout">Login</button>
<?php endif; ?>
</div>
</div>
<!-- end markup for UI Options Fat Panel -->