| 1 |
<?php |
| 2 |
/** |
| 3 |
* @version 1.0 |
| 4 |
* @package Booking Calendar |
| 5 |
* @subpackage Welcome Panel Functions |
| 6 |
* @category Functions |
| 7 |
* |
| 8 |
* @author wpdevelop |
| 9 |
* @link https://wpbookingcalendar.com/ |
| 10 |
* @email info@wpbookingcalendar.com |
| 11 |
* |
| 12 |
* @modified 2023-10-24 |
| 13 |
*/ |
| 14 |
|
| 15 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
// <editor-fold defaultstate="collapsed" desc=" == Welcome Content == " > |
| 20 |
|
| 21 |
/** |
| 22 |
* Show Welcome Panel with links |
| 23 |
* |
| 24 |
* @global type $wpbc_Dismiss |
| 25 |
*/ |
| 26 |
function wpbc_welcome_panel() { |
| 27 |
|
| 28 |
?> |
| 29 |
<style type="text/css" media="screen"> |
| 30 |
/*<![CDATA[*/ |
| 31 |
/* WPBC Welcome Panel */ |
| 32 |
/* //FixIn: 8.9.3.6 */ |
| 33 |
.wpbc-panel .welcome-panel .welcome-panel-column-container { |
| 34 |
display: block; |
| 35 |
margin-top: 0px; |
| 36 |
padding: 0px; |
| 37 |
background: #fff; |
| 38 |
} |
| 39 |
|
| 40 |
.wpbc-panel .welcome-panel .welcome-panel-column ul { |
| 41 |
margin: 1.8em 1em 1em 0; |
| 42 |
} |
| 43 |
|
| 44 |
.wpbc-panel .welcome-panel { |
| 45 |
background-blend-mode: overlay; |
| 46 |
font-size: 14px; |
| 47 |
line-height: 1.3; |
| 48 |
} |
| 49 |
|
| 50 |
.wpbc-panel .welcome-panel-column { |
| 51 |
display: block; |
| 52 |
} |
| 53 |
|
| 54 |
.wpbc-panel .welcome-panel::before { |
| 55 |
content: none; |
| 56 |
} |
| 57 |
|
| 58 |
.wpbc-panel .welcome-panel-content { |
| 59 |
min-height: 100px; |
| 60 |
} |
| 61 |
|
| 62 |
/* End //FixIn: 8.9.3.6 */ |
| 63 |
.wpbc-panel .welcome-panel { |
| 64 |
background: #fff; |
| 65 |
border-color: #DFDFDF; |
| 66 |
position: relative; |
| 67 |
overflow: auto; |
| 68 |
margin: 5px 0 20px; |
| 69 |
padding: 23px 10px 12px; |
| 70 |
border-width: 1px; |
| 71 |
border-style: solid; |
| 72 |
border-radius: 3px; |
| 73 |
font-size: 13px; |
| 74 |
line-height: 2.1em; |
| 75 |
} |
| 76 |
|
| 77 |
.wpbc-panel .welcome-panel h3 { |
| 78 |
margin: 0; |
| 79 |
font-size: 21px; |
| 80 |
font-weight: 400; |
| 81 |
line-height: 1.2; |
| 82 |
} |
| 83 |
|
| 84 |
.wpbc-panel .welcome-panel h4 { |
| 85 |
margin: 0.8rem 0; |
| 86 |
font-weight: 600; |
| 87 |
font-size: 1.1rem; |
| 88 |
color: #7a7a7a; |
| 89 |
} |
| 90 |
.wpbc-panel .welcome-panel a { |
| 91 |
color: #21759B; |
| 92 |
} |
| 93 |
.wpbc-panel .welcome-panel .about-description { |
| 94 |
margin: -10px 0 5px; |
| 95 |
color: #7a7a7a; |
| 96 |
font-size: 20px; |
| 97 |
font-weight: 600; |
| 98 |
border-bottom: 1px solid #eee; |
| 99 |
padding-bottom: 10px; |
| 100 |
padding-left: 0.5em; |
| 101 |
} |
| 102 |
|
| 103 |
.wpbc-panel .welcome-panel .button.button-hero { |
| 104 |
margin: 15px 0 3px; |
| 105 |
} |
| 106 |
|
| 107 |
.wpbc-panel .welcome-panel-content { |
| 108 |
display: flex; |
| 109 |
flex-flow: row wrap; |
| 110 |
justify-content: flex-start; |
| 111 |
align-items: flex-start; |
| 112 |
align-content: flex-start; |
| 113 |
} |
| 114 |
.wpbc-panel .welcome-panel-content > * { |
| 115 |
flex: 1 1 auto; |
| 116 |
} |
| 117 |
.wpbc-panel .welcome-panel .welcome-panel-column-container { |
| 118 |
clear: both; |
| 119 |
overflow: hidden; |
| 120 |
position: relative; |
| 121 |
|
| 122 |
display: flex; |
| 123 |
flex-flow: row wrap; |
| 124 |
justify-content: space-between; |
| 125 |
align-items: flex-start; |
| 126 |
align-content: flex-start; |
| 127 |
padding: 0 1em; |
| 128 |
} |
| 129 |
.wpbc-panel .welcome-panel .welcome-panel-column:first-child { |
| 130 |
flex: 1 1 40%; |
| 131 |
} |
| 132 |
.wpbc-panel .welcome-panel .welcome-panel-column { |
| 133 |
flex: 1 1 30%; |
| 134 |
min-width: 18em; |
| 135 |
} |
| 136 |
.wpbc-panel .welcome-panel .welcome-panel-column:last-child { |
| 137 |
flex: 1 1 20%; |
| 138 |
} |
| 139 |
/*.welcome-panel-column.welcome-panel-last h4{*/ |
| 140 |
/* font-size: 1.1em;*/ |
| 141 |
/*}*/ |
| 142 |
/*.wpbc-panel .welcome-panel .welcome-panel-column.welcome-panel-last .welcome-icon{*/ |
| 143 |
/* font-size: 1em;*/ |
| 144 |
/*}*/ |
| 145 |
/*.wpbc-panel .welcome-panel .welcome-panel-column.welcome-panel-last li{*/ |
| 146 |
/* padding:0;*/ |
| 147 |
/*}*/ |
| 148 |
.wpbc-panel .welcome-panel-column p { |
| 149 |
margin-top: 7px; |
| 150 |
} |
| 151 |
|
| 152 |
.wpbc-panel .welcome-panel .welcome-icon { |
| 153 |
background: #fff; |
| 154 |
padding: 0 1em 0 0; |
| 155 |
font-size: 15px; |
| 156 |
line-height: 1.84em; |
| 157 |
} |
| 158 |
|
| 159 |
.wpbc-panel .welcome-panel .welcome-add-page { |
| 160 |
background-position: 0 2px; |
| 161 |
} |
| 162 |
|
| 163 |
.wpbc-panel .welcome-panel .welcome-edit-page { |
| 164 |
background-position: 0 -90px; |
| 165 |
} |
| 166 |
|
| 167 |
.wpbc-panel .welcome-panel .welcome-learn-more { |
| 168 |
background-position: 0 -136px; |
| 169 |
} |
| 170 |
|
| 171 |
.wpbc-panel .welcome-panel .welcome-comments { |
| 172 |
background-position: 0 -182px; |
| 173 |
} |
| 174 |
|
| 175 |
.wpbc-panel .welcome-panel .welcome-view-site { |
| 176 |
background-position: 0 -274px; |
| 177 |
} |
| 178 |
|
| 179 |
.wpbc-panel .welcome-panel .welcome-widgets-menus { |
| 180 |
line-height: 14px; |
| 181 |
font-size: 0.8rem; |
| 182 |
} |
| 183 |
|
| 184 |
.wpbc-panel .welcome-panel .welcome-write-blog { |
| 185 |
background-position: 0 -44px; |
| 186 |
} |
| 187 |
|
| 188 |
.wpbc-panel .welcome-panel .welcome-panel-column ul { |
| 189 |
margin: 0.8em 1em 1em 0; |
| 190 |
} |
| 191 |
|
| 192 |
.wpbc-panel .welcome-panel .welcome-panel-column li { |
| 193 |
line-height: 1.8em; |
| 194 |
list-style-type: none; |
| 195 |
} |
| 196 |
|
| 197 |
.wpbc_panel_get_started_dismiss:hover, |
| 198 |
.wpbc_panel_get_started_dismiss:active, |
| 199 |
.wpbc_panel_get_started_dismiss:focus, |
| 200 |
.wpbc_panel_get_started_dismiss { |
| 201 |
position: absolute; |
| 202 |
right: 12px; |
| 203 |
top: 12px; |
| 204 |
box-shadow: none; |
| 205 |
outline: none; |
| 206 |
} |
| 207 |
|
| 208 |
@media screen and (max-width: 870px) { |
| 209 |
.wpbc-panel .welcome-panel .welcome-panel-column, |
| 210 |
.wpbc-panel .welcome-panel .welcome-panel-column:first-child { |
| 211 |
display: block; |
| 212 |
float: none; |
| 213 |
width: 100%; |
| 214 |
} |
| 215 |
|
| 216 |
.wpbc-panel .welcome-panel .welcome-panel-column li { |
| 217 |
display: inline-block; |
| 218 |
margin-right: 13px; |
| 219 |
} |
| 220 |
|
| 221 |
.wpbc-panel .welcome-panel .welcome-panel-column ul { |
| 222 |
margin: 0.4em 0 0; |
| 223 |
} |
| 224 |
|
| 225 |
.wpbc-panel .welcome-panel .welcome-icon { |
| 226 |
/*padding-left: 25px;*/ |
| 227 |
} |
| 228 |
} |
| 229 |
|
| 230 |
/*]]>*/ |
| 231 |
</style> |
| 232 |
<script type="text/javascript"> |
| 233 |
jQuery( document ).ready( function (){ |
| 234 |
setTimeout( function (){ |
| 235 |
if ( jQuery( '#wpbc-panel-get-started' ).is( ':visible' ) ){ |
| 236 |
jQuery( '#wpbc-panel-get-started' ).slideUp( 1000 ); |
| 237 |
} |
| 238 |
}, 60000 ); |
| 239 |
} ); |
| 240 |
</script> |
| 241 |
<div id="wpbc-panel-get-started" class="wpbc-panel" style="display:none;"> |
| 242 |
<div class="welcome-panel"><?php |
| 243 |
|
| 244 |
$is_panel_visible = wpbc_is_dismissed( 'wpbc-panel-get-started', array( |
| 245 |
'title' => '<i class="menu_icon icon-1x wpbc_icn_close"></i> ', |
| 246 |
'hint' => __( 'Dismiss', 'booking' ), |
| 247 |
'class' => 'wpbc_panel_get_started_dismiss', |
| 248 |
'css' => 'background: #fff;border-radius: 7px;' |
| 249 |
)); |
| 250 |
if ( $is_panel_visible ) { |
| 251 |
wpbc_welcome_panel_content(); |
| 252 |
} |
| 253 |
|
| 254 |
?> </div> |
| 255 |
</div> <?php |
| 256 |
} |
| 257 |
|
| 258 |
|
| 259 |
/** |
| 260 |
* Content of Welcome Panel with links |
| 261 |
* |
| 262 |
*/ |
| 263 |
function wpbc_welcome_panel_content() { |
| 264 |
|
| 265 |
?> |
| 266 |
<div class="welcome-panel-content"> |
| 267 |
<p class="about-description"><?php _e( 'We’ve assembled some links to get you started:','booking'); ?></p> |
| 268 |
<div class="welcome-panel-column-container"> |
| 269 |
<div class="welcome-panel-column"> |
| 270 |
<h4><?php _e( 'Get Started','booking'); ?></h4> |
| 271 |
<ul> |
| 272 |
<?php |
| 273 |
$is_wp_post_booking = false; |
| 274 |
$wp_post_booking = get_page_by_path( 'wpbc-booking' ); |
| 275 |
if ( empty( ! $wp_post_booking ) ) { |
| 276 |
|
| 277 |
$wp_post_booking_absolute = get_permalink( $wp_post_booking->ID ); |
| 278 |
|
| 279 |
if ( ! empty( $wp_post_booking_absolute ) ) { |
| 280 |
|
| 281 |
$wp_post_booking_relative = wpbc_make_link_relative( $wp_post_booking_absolute ); |
| 282 |
if ( wpbc_is_shortcode_exist_in_page( $wp_post_booking_relative, '[booking' ) ) { |
| 283 |
$is_wp_post_booking = true; |
| 284 |
?> |
| 285 |
<li> |
| 286 |
<div class="welcome-icon" style="margin: 25px 0 15px;"><?php |
| 287 |
printf( __( 'Start by using the %spre-configured booking page%s we have set up.', 'booking' ) |
| 288 |
, '<strong><a href="' . esc_url( $wp_post_booking_absolute ) . '" class="button button-secondary" target="_blank">', '</a></strong>' |
| 289 |
); |
| 290 |
?></div> |
| 291 |
</li><?php |
| 292 |
} |
| 293 |
} |
| 294 |
} |
| 295 |
?><li> |
| 296 |
<div class="welcome-icon" style="margin-bottom: 15px;"><?php |
| 297 |
printf( __( '%sIntegrate booking form%s into a page on your website in just a few clicks.', 'booking' ) |
| 298 |
, '<strong><a href="' . esc_url( wpbc_get_resources_url() ) . '" class="button button-primary">', '</a></strong>' |
| 299 |
); |
| 300 |
?></div> |
| 301 |
</li><?php |
| 302 |
|
| 303 |
?><li><span class="welcome-icon" style="font-size: 0.95em;"><?php |
| 304 |
printf( __('Learn how to %sAdd the Booking Form or Calendar to your page%s in WordPress Block Editor, Elementor, or other non-standard editors.','booking') |
| 305 |
, '<strong><a href="https://wpbookingcalendar.com/faq/insert-booking-calendar-into-page/" target="_blank">', '</a></strong>' |
| 306 |
); |
| 307 |
echo '</span><span class="welcome-icon" style="font-size: 0.95em;">'; |
| 308 |
printf( __('See %sall shortcodes%s of the Booking Calendar that you can use in pages.','booking') |
| 309 |
, '<strong><a href="https://wpbookingcalendar.com/faq/#shortcodes" target="_blank">', '</a></strong>' |
| 310 |
// , '<a href="' . admin_url( 'edit.php?post_type=page' ) . '">', '</a>' |
| 311 |
// , '<a href="' . admin_url( 'edit.php' ) . '">', '</a>' |
| 312 |
); |
| 313 |
?></span></li> |
| 314 |
</ul> |
| 315 |
</div> |
| 316 |
<div class="welcome-panel-column welcome-panel-last"> |
| 317 |
<h4><?php _e( 'Next Steps','booking'); ?></h4> |
| 318 |
<ul> |
| 319 |
|
| 320 |
<?php if ( ! empty( $wp_post_booking_absolute ) ) { ?> |
| 321 |
<li><div class="welcome-icon"><?php |
| 322 |
printf( __('Start creating %snew bookings%s from %syour page%s or in the %sAdmin Panel%s.','booking') |
| 323 |
, '<strong>', '</strong>' |
| 324 |
, '<strong><a href="' . esc_url( $wp_post_booking_absolute ) . '" target="_blank">', '</a></strong>' |
| 325 |
, '<a href="' . esc_url( wpbc_get_new_booking_url() ) . '">', '</a>' |
| 326 |
); |
| 327 |
?></div></li> |
| 328 |
<?php } ?> |
| 329 |
|
| 330 |
<li><div class="welcome-icon"><?php |
| 331 |
printf( __( 'Check %sBooking Listing%s page for new bookings.','booking') |
| 332 |
, '<a href="' . esc_url( wpbc_get_bookings_url(true, false) . '&view_mode=vm_listing' ) . '">', '</a>' |
| 333 |
); |
| 334 |
?></div></li> |
| 335 |
<li><div class="welcome-icon"><?php |
| 336 |
printf( __( 'Configure %sForm Fields%s, %sEmails%s and other %sSettings%s.' ,'booking') |
| 337 |
, '<a href="' . esc_url( wpbc_get_settings_url(true, false) . '&tab=form' ) . '">', '</a>' |
| 338 |
, '<a href="' . esc_url( wpbc_get_settings_url(true, false) . '&tab=email' ) . '">', '</a>' |
| 339 |
, '<a href="' . esc_url( wpbc_get_settings_url(true, false) ) . '">', '</a>' |
| 340 |
); |
| 341 |
?></div></li> |
| 342 |
</ul> |
| 343 |
<?php /* ?> |
| 344 |
</div> |
| 345 |
<div class="welcome-panel-column welcome-panel-last"> |
| 346 |
<?php */ ?> |
| 347 |
<h4><?php _e( 'Have a questions?','booking'); ?></h4> |
| 348 |
<ul> |
| 349 |
<li><span class="welcome-icon"><?php |
| 350 |
printf( __( 'See %sFAQ%s.' ,'booking'), |
| 351 |
'<a href="https://wpbookingcalendar.com/faq/" target="_blank">', |
| 352 |
'</a>' ); |
| 353 |
echo '</span><span class="welcome-icon">'; |
| 354 |
printf( __( 'Contact %sSupport%s.','booking'), |
| 355 |
'<a href="https://wpbookingcalendar.com/support/" target="_blank">', |
| 356 |
'</a>' ); |
| 357 |
/* |
| 358 |
?></div></li> |
| 359 |
<li><div class="welcome-icon"><?php |
| 360 |
printf( __( 'Check out our %sHelp%s' ,'booking'), |
| 361 |
'<a href="https://wpbookingcalendar.com/help/" target="_blank">', |
| 362 |
'</a>' ); |
| 363 |
?></div></li> |
| 364 |
<li><div class="welcome-icon"><?php |
| 365 |
printf( __( 'Still having questions? Contact %sSupport%s.','booking'), |
| 366 |
'<a href="https://wpbookingcalendar.com/support/" target="_blank">', |
| 367 |
'</a>' ); |
| 368 |
*/ |
| 369 |
?></span></li> |
| 370 |
</ul> |
| 371 |
</div> |
| 372 |
</div> |
| 373 |
<div class="welcome-icon welcome-widgets-menus" style="text-align:right;"><?php |
| 374 |
printf( __( 'Need even more functionality? Check %s Pro Versions %s.','booking'), |
| 375 |
'<a href="https://wpbookingcalendar.com/features/" target="_blank">', |
| 376 |
'</a>' |
| 377 |
); ?> |
| 378 |
</div> |
| 379 |
</div> |
| 380 |
<?php |
| 381 |
} |
| 382 |
|
| 383 |
// </editor-fold> |
| 384 |
|