This repository has been archived by the owner on Jun 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.php
executable file
·176 lines (150 loc) · 6.82 KB
/
footer.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
/*
* MIT License
*
* Copyright (c) 2020 CodexiLab
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
?>
</div><!-- /.row -->
</main><!-- /.container -->
<?php osc_run_hook('after-main'); ?>
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- General Modal -->
<div class="modal fade" id="genModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"></div>
<div class="modal-body text-center">
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
<?php osc_show_widgets('footer');?>
<footer class="small mt-3">
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-12 text-center text-md-left">
<ul class="list-inline">
<?php if (osc_users_enabled()) : ?>
<?php if (osc_is_web_user_logged_in()) : ?>
<li class="list-inline-item"><?php echo sprintf(__('Hi %s', BENDERBS_THEME_FOLDER), osc_logged_user_name() . '!'); ?></li>
<li class="list-inline-item"><strong><a href="<?php echo osc_user_dashboard_url(); ?>"><?php _e('My account', BENDERBS_THEME_FOLDER); ?></a></strong></li>
<li class="list-inline-item"><a href="<?php echo osc_user_logout_url(); ?>"><?php _e('Logout', BENDERBS_THEME_FOLDER); ?></a></li>
<?php else: ?>
<li class="list-inline-item"><a href="<?php echo osc_user_login_url(); ?>"><?php _e('Login', BENDERBS_THEME_FOLDER); ?></a></li>
<?php if (osc_user_registration_enabled()) : ?>
<li class="list-inline-item"><a href="<?php echo osc_register_account_url(); ?>"><?php _e('Register for a free account', BENDERBS_THEME_FOLDER); ?></a></li>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</ul>
</div>
<div class="col-md-6 col-sm-12 text-center text-md-right">
<?php if (osc_users_enabled() || (!osc_users_enabled() && !osc_reg_user_post())) : ?>
<a href="<?php echo osc_item_post_url_in_category(); ?>" class="btn btn-danger btn-lg btn-block d-md-none"><?php _e("Publish your ad for free", BENDERBS_THEME_FOLDER);?></a>
<?php endif; ?>
<a href="<?php echo osc_contact_url(); ?>"><?php _e('Contact', BENDERBS_THEME_FOLDER); ?></a>
<?php osc_reset_static_pages(); while( osc_has_static_pages()) : ?>
<a href="<?php echo osc_static_page_url(); ?>"><?php echo osc_static_page_title(); ?></a>
<?php endwhile; ?>
<?php if (osc_count_web_enabled_locales() > 1) { ?>
<?php osc_goto_first_locale(); ?>
<strong><?php _e('Language:', BENDERBS_THEME_FOLDER); ?></strong>
<?php $i = 0; ?>
<?php while ( osc_has_web_enabled_locales() ) { ?>
<span><a id="<?php echo osc_locale_code(); ?>" href="<?php echo osc_change_language_url (osc_locale_code()); ?>"><?php echo osc_locale_name(); ?></a></span><?php if( $i == 0 ) { echo " · "; } ?>
<?php $i++; ?>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</footer>
<script>
<?php if (osc_users_enabled()) : ?>
<?php if (osc_is_web_user_logged_in()) : ?>
$(document).ready(function() {
$(".logout").click(function() {
$('#genModal').modal('show');
$('#genModal').on('shown.bs.modal', function(e) {
$("#genModal .modal-header").html('<h5 class="modal-title"><?php _e('Ready to Leave?', BENDERBS_THEME_FOLDER); ?></h5>');
$("#genModal .modal-body").html('<?php _e('Select "Logout" below if you are ready to end your current session.', BENDERBS_THEME_FOLDER); ?>');
let btnCancel = `
<button class="btn btn-secondary" type="button" onclick="genModalHide();return false;">
<?php _e('Cancel'); ?>
</button>
`
let btnLogout = `
<a class="btn btn-primary" href="<?php echo osc_user_logout_url(); ?>">
<?php _e('Logout', BENDERBS_THEME_FOLDER); ?>
</a>
`
$("#genModal .modal-footer").html(btnCancel+btnLogout);
});
});
});
function modalDeleteItem(url) {
$('#genModal').modal('show');
$('#genModal').on('shown.bs.modal', function(e) {
$("#genModal .modal-header").html('<h5 class="modal-title"><?php echo osc_esc_js(__('Message', BENDERBS_THEME_FOLDER)); ?></h5>');
$("#genModal .modal-body").html('<?php echo osc_esc_js(__('This action can not be undone. Are you sure you want to continue?', BENDERBS_THEME_FOLDER)) ?>');
let btnCancel = `
<button class="btn btn-secondary" type="button" onclick="genModalHide();return false;">
<?php echo osc_esc_js(__('Cancel')); ?>
</button>
`
let btnDelete = `
<a class="btn btn-primary" href="`+url+`">
<?php echo osc_esc_js(__('Delete', BENDERBS_THEME_FOLDER)); ?>
</a>
`
$("#genModal .modal-footer").html(btnCancel+btnDelete);
});
}
<?php endif; ?>
<?php endif; ?>
function copyPriceToClipboard(itemId, type) {
var btnPrice = 'price-'+type+'-'+itemId
var msgCopyTo = '<?php echo osc_esc_js(__('Copy to Clipboard', BENDERBS_THEME_FOLDER)); ?>'
var msgCopied = '<?php echo osc_esc_js(__('Copied!', BENDERBS_THEME_FOLDER)); ?>'
if (copyToClipboard(btnPrice) === true) {
$('#'+btnPrice).attr('data-original-title', msgCopied)
.tooltip('show')
.attr('data-original-title', msgCopyTo);
} else {
$('#'+btnPrice).attr('data-original-title', 'Copy with Ctrl-c')
.tooltip('show')
.attr('data-original-title', msgCopyTo);
}
}
</script>
<?php osc_run_hook('footer'); ?>
</body>
</html>