import
5 days ago
includes
5 days ago
metabox
5 days ago
notices
5 days ago
templates
5 days ago
mega-menu.php
5 days ago
plugin-options.php
5 days ago
popups.php
5 days ago
premade-blocks.php
5 days ago
templates-kit.php
5 days ago
theme-builder.php
5 days ago
popups.php
101 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; // Exit if accessed directly. |
| 5 | } |
| 6 | |
| 7 | use WprAddons\Admin\Includes\WPR_Templates_Loop; |
| 8 | use WprAddons\Classes\Utilities; |
| 9 | |
| 10 | // Register Menus |
| 11 | function wpr_addons_add_popups_menu() { |
| 12 | add_submenu_page( 'wpr-addons', 'Popup Builder', 'Popup Builder', 'manage_options', 'wpr-popups', 'wpr_addons_popups_page' ); |
| 13 | } |
| 14 | add_action( 'admin_menu', 'wpr_addons_add_popups_menu' ); |
| 15 | |
| 16 | function wpr_addons_popups_page() { |
| 17 | |
| 18 | ?> |
| 19 | |
| 20 | <div class="wrap wpr-settings-page-wrap"> |
| 21 | |
| 22 | <div class="wpr-settings-page-header"> |
| 23 | <h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1> |
| 24 | <p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p> |
| 25 | |
| 26 | <!-- Custom Template --> |
| 27 | <div class="wpr-preview-buttons"> |
| 28 | <div class="wpr-user-template"> |
| 29 | <span><?php esc_html_e( 'Create Template', 'wpr-addons' ); ?></span> |
| 30 | <span class="plus-icon">+</span> |
| 31 | </div> |
| 32 | |
| 33 | <a href="https://www.youtube.com/watch?v=TbKTNpuXM68" class="wpr-options-button button" target="_blank"> |
| 34 | <?php echo esc_html__( 'How to use Popups', 'wpr-addons' ); ?> |
| 35 | <span class="dashicons dashicons-video-alt3"></span> |
| 36 | </a> |
| 37 | |
| 38 | <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="wpr-options-button button" target="_blank"> |
| 39 | <?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?> |
| 40 | <span class="dashicons dashicons-star-empty"></span> |
| 41 | </a> |
| 42 | </div> |
| 43 | </div> |
| 44 | |
| 45 | <div class="wpr-settings-page"> |
| 46 | <form method="post" action="options.php"> |
| 47 | <?php |
| 48 | |
| 49 | // Active Tab |
| 50 | $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_popups'; |
| 51 | |
| 52 | ?> |
| 53 | |
| 54 | <!-- Template ID Holder --> |
| 55 | <input type="hidden" name="wpr_template" id="wpr_template" value=""> |
| 56 | |
| 57 | <!-- Conditions Popup --> |
| 58 | <?php WPR_Templates_Loop::render_conditions_popup(); ?> |
| 59 | |
| 60 | <!-- Create Templte Popup --> |
| 61 | <?php WPR_Templates_Loop::render_create_template_popup(); ?> |
| 62 | |
| 63 | <!-- Backup Plugin Popup --> |
| 64 | <?php WPR_Templates_Loop::render_backup_plugin_popup(); ?> |
| 65 | |
| 66 | <!-- Tabs --> |
| 67 | <div class="nav-tab-wrapper wpr-nav-tab-wrapper"> |
| 68 | <a href="?page=wpr-theme-builder&tab=wpr_tab_popups" data-title="popup" class="nav-tab <?php echo ($active_tab == 'wpr_tab_popups') ? 'nav-tab-active' : ''; ?>"> |
| 69 | <?php esc_html_e( 'Popups', 'wpr-addons' ); ?> |
| 70 | </a> |
| 71 | </div> |
| 72 | |
| 73 | |
| 74 | <?php |
| 75 | if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) { |
| 76 | $url = ''; |
| 77 | $url = admin_url( 'edit.php?s&post_status=all&post_type=wpr_templates&wpr_template_type=popup&filter_action=Filter' ); |
| 78 | |
| 79 | echo '<a href="' . esc_url( $url ) . '" class="button button-primary wpr-translate-templates wpr-options-button"><span class="dashicons dashicons-admin-site"></span><span>Translate WPML Templates</span></a>'; |
| 80 | echo '<a href="https://www.youtube.com/watch?v=y7yjItsMBmw" class="button button-primary wpr-translate-templates wpr-options-button tutorial">'. esc_html__("Video Tutorial") .'</a>'; |
| 81 | } |
| 82 | ?> |
| 83 | |
| 84 | <?php if ( $active_tab == 'wpr_tab_popups' ) : ?> |
| 85 | |
| 86 | <!-- Save Conditions --> |
| 87 | <input type="hidden" name="wpr_popup_conditions" id="wpr_popup_conditions" value="<?php echo esc_attr(get_option('wpr_popup_conditions', '[]')); ?>"> |
| 88 | |
| 89 | <?php WPR_Templates_Loop::render_theme_builder_templates( 'popup' ); ?> |
| 90 | |
| 91 | <?php endif; ?> |
| 92 | |
| 93 | </form> |
| 94 | </div> |
| 95 | |
| 96 | </div> |
| 97 | |
| 98 | |
| 99 | <?php |
| 100 | |
| 101 | } // End wpr_addons_popups_page() |