| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Campaign Embed Wizard. |
| 10 |
* Embed popup HTML template. |
| 11 |
* |
| 12 |
* @package Charitable |
| 13 |
* @author David Bisset |
| 14 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 15 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 16 |
* @since 1.8.0 |
| 17 |
* @version 1.8.0 |
| 18 |
* @version 1.8.8.6 |
| 19 |
*/ |
| 20 |
|
| 21 |
if ( ! \defined( 'ABSPATH' ) ) { |
| 22 |
exit; |
| 23 |
} |
| 24 |
$charitable_pages_exists = ! empty( $args['dropdown_pages'] ) ? 1 : 0; |
| 25 |
|
| 26 |
?> |
| 27 |
|
| 28 |
<div id="charitable-admin-campaign-embed-wizard-container" class="charitable-admin-popup-container"> |
| 29 |
<div id="charitable-admin-campaign-embed-wizard" class="charitable-admin-popup" data-pages-exists="<?php echo esc_attr( $charitable_pages_exists ); ?>"> |
| 30 |
<div class="charitable-admin-popup-content"> |
| 31 |
<h3><?php esc_html_e( 'Embed in a Page', 'charitable' ); ?></h3> |
| 32 |
<div id="charitable-admin-campaign-embed-wizard-content-initial"> |
| 33 |
<p class="no-gap"><b><?php esc_html_e( 'We can help embed your campaign with just a few clicks!', 'charitable' ); ?></b></p> |
| 34 |
|
| 35 |
<?php if ( ! empty( $args['user_can_edit_pages'] ) ) : ?> |
| 36 |
<p><?php esc_html_e( 'Would you like to embed your campaign in an existing page, or create a new one?', 'charitable' ); ?></p> |
| 37 |
<?php endif; ?> |
| 38 |
</div> |
| 39 |
|
| 40 |
<?php if ( ! empty( $args['user_can_edit_pages'] ) ) : ?> |
| 41 |
<div id="charitable-admin-campaign-embed-wizard-content-select-page" style="display: none;"> |
| 42 |
<p><?php esc_html_e( 'Select the page you would like to embed your campaign in.', 'charitable' ); ?></p> |
| 43 |
</div> |
| 44 |
<div id="charitable-admin-campaign-embed-wizard-content-create-page" style="display: none;"> |
| 45 |
<p><?php esc_html_e( 'What would you like to call the new page?', 'charitable' ); ?></p> |
| 46 |
</div> |
| 47 |
<div id="charitable-admin-campaign-embed-wizard-section-btns" class="charitable-admin-popup-bottom"> |
| 48 |
<button type="button" data-action="select-page" class="charitable-admin-popup-btn"><?php esc_html_e( 'Select Existing Page', 'charitable' ); ?></button> |
| 49 |
<button type="button" data-action="create-page" class="charitable-admin-popup-btn"><?php esc_html_e( 'Create New Page', 'charitable' ); ?></button> |
| 50 |
</div> |
| 51 |
<div id="charitable-admin-campaign-embed-wizard-section-go" class="charitable-admin-popup-bottom charitable-admin-popup-flex" style="display: none;"> |
| 52 |
<?php echo $args['dropdown_pages']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 53 |
<input type="text" id="charitable-admin-campaign-embed-wizard-new-page-title" value="" placeholder="<?php esc_attr_e( 'Name Your Page', 'charitable' ); ?>"> |
| 54 |
<button type="button" data-action="go" class="charitable-admin-popup-btn"><?php esc_html_e( 'Let’s Go!', 'charitable' ); ?></button> |
| 55 |
</div> |
| 56 |
<?php endif; ?> |
| 57 |
<div id="charitable-admin-campaign-embed-wizard-section-toggles" class="charitable-admin-popup-bottom"> |
| 58 |
<p class="secondary"> |
| 59 |
<?php |
| 60 |
printf( |
| 61 |
wp_kses( /* translators: %1$s - Video tutorial toggle CSS classes, %2$s - shortcode toggle CSS classes. */ |
| 62 |
__( 'You can also <a href="#" class="%1$s">embed your campaign manually</a> or <a href="#" class="%2$s">use a shortcode</a>', 'charitable' ), |
| 63 |
[ |
| 64 |
'a' => [ |
| 65 |
'href' => [], |
| 66 |
'class' => [], |
| 67 |
], |
| 68 |
] |
| 69 |
), |
| 70 |
'tutorial-toggle charitable-admin-popup-toggle', |
| 71 |
'shortcode-toggle charitable-admin-popup-toggle' |
| 72 |
); |
| 73 |
?> |
| 74 |
</p> |
| 75 |
<iframe style="display: none;" src="about:blank" frameborder="0" id="charitable-admin-campaign-embed-wizard-tutorial" allowfullscreen width="450" height="256"></iframe> |
| 76 |
<div id="charitable-admin-campaign-embed-wizard-shortcode-wrap" style="display: none;"> |
| 77 |
<input type="text" id="charitable-admin-campaign-embed-wizard-shortcode" class="charitable-admin-popup-shortcode" disabled /> |
| 78 |
<span id="charitable-admin-campaign-embed-wizard-shortcode-copy" title="<?php esc_attr_e( 'Copy embed code to clipboard', 'charitable' ); ?>"> |
| 79 |
<i class="fa fa-files-o" aria-hidden="true"></i> |
| 80 |
</span> |
| 81 |
</div> |
| 82 |
</div> |
| 83 |
<div id="charitable-admin-campaign-embed-wizard-section-goback" class="charitable-admin-popup-bottom" style="display: none;"> |
| 84 |
<p class="secondary"> |
| 85 |
<a href="#" class="charitable-admin-popup-toggle initialstate-toggle">« <?php esc_html_e( 'Go back', 'charitable' ); ?></a> |
| 86 |
</p> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
<i class="fa fa-times charitable-admin-popup-close"></i> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
|