html-admin-page-addons.php
4 years ago
html-admin-page-builder.php
4 years ago
html-admin-page-entries-view.php
3 years ago
html-admin-page-export.php
4 years ago
html-admin-page-form-templates.php
3 years ago
html-admin-page-import.php
3 years ago
html-admin-page-tools-logs.php
4 years ago
html-admin-page-tools.php
5 years ago
html-admin-settings.php
7 years ago
html-deactivation-popup.php
3 years ago
html-notice-allow-usage.php
3 years ago
html-notice-custom.php
6 years ago
html-notice-review.php
5 years ago
html-notice-survey.php
4 years ago
html-notice-update.php
6 years ago
html-notice-updated.php
6 years ago
html-notice-updating.php
6 years ago
html-admin-page-addons.php
155 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Addons |
| 4 | * |
| 5 | * @var string $view |
| 6 | * @var object $addons |
| 7 | * |
| 8 | * @package EverestForms |
| 9 | */ |
| 10 | |
| 11 | defined( 'ABSPATH' ) || exit; |
| 12 | |
| 13 | ?> |
| 14 | <div class="wrap evf_addons_wrap"> |
| 15 | <h1 class="wp-heading-inline"><?php esc_html_e( 'Everest Forms Add-ons', 'everest-forms' ); ?></h1> |
| 16 | |
| 17 | <?php if ( apply_filters( 'everest_forms_refresh_addons', true ) ) : ?> |
| 18 | <a href="<?php echo esc_url( $refresh_url ); ?>" class="page-title-action"><?php esc_html_e( 'Refresh Add-ons', 'everest-forms' ); ?></a> |
| 19 | <?php endif; ?> |
| 20 | |
| 21 | <hr class="wp-header-end"> |
| 22 | <h2 class="screen-reader-text"><?php esc_html_e( 'Filter add-ons list', 'everest-forms' ); ?></h2> |
| 23 | |
| 24 | <?php if ( $sections ) : ?> |
| 25 | <div class="wp-filter"> |
| 26 | <ul class="filter-links"> |
| 27 | <?php foreach ( $sections as $section ) : ?> |
| 28 | <li class="<?php echo esc_attr( $section->slug ); ?>"> |
| 29 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=evf-addons§ion=' . esc_attr( $section->slug ) ) ); ?>"<?php echo $current_section === $section->slug ? ' class="current" aria-current="page"' : ''; ?>><?php echo esc_html( $section->label ); ?></a> |
| 30 | </li> |
| 31 | <?php endforeach; ?> |
| 32 | </ul> |
| 33 | <form class="search-form search-plugins hidden" method="get"> |
| 34 | <input type="hidden" name="page" value="evf-addons"> |
| 35 | <?php $page_section = ( isset( $_GET['section'] ) && '_featured' !== sanitize_text_field( wp_unslash( $_GET['section'] ) ) ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : '_all'; // phpcs:ignore WordPress.Security.NonceVerification ?> |
| 36 | <input type="hidden" name="section" value="<?php echo esc_attr( $page_section ); ?>"> |
| 37 | <label> |
| 38 | <span class="screen-reader-text"><?php esc_html_e( 'Search Add-ons', 'everest-forms' ); ?></span> |
| 39 | <input type="search" name="s" value="" class="wp-filter-search hidden" placeholder="<?php esc_attr_e( 'Search Add-ons...', 'everest-forms' ); ?>" aria-describedby="live-search-desc" /> |
| 40 | </label> |
| 41 | <input type="submit" id="search-submit" class="button hide-if-js" value="<?php esc_attr_e( 'Search Add-ons', 'everest-forms' ); ?>"> |
| 42 | </form> |
| 43 | </div> |
| 44 | |
| 45 | <br class="clear"> |
| 46 | <p class="refresh"> |
| 47 | <?php |
| 48 | /* translators: %s: Refresh URI */ |
| 49 | printf( esc_html__( 'Make your forms even more robust with our premium addons. Missing any addons? Click the %1$sRefresh Add-ons%2$s button above.', 'everest-forms' ), '<a href="' . esc_url( $refresh_url ) . '">', '</a>' ); |
| 50 | ?> |
| 51 | </p> |
| 52 | |
| 53 | <?php if ( '_featured' !== $current_section && $addons ) : ?> |
| 54 | <form id="extension-filter" method="post"> |
| 55 | <div class="wp-list-table widefat extension-install"> |
| 56 | <h2 class="screen-reader-text"><?php esc_html_e( 'Add-ons list', 'everest-forms' ); ?></h2> |
| 57 | |
| 58 | <div class="the-list"> |
| 59 | <?php foreach ( $addons as $addon ) : ?> |
| 60 | <div class="plugin-card plugin-card-<?php echo esc_attr( $addon->slug ); ?>"> |
| 61 | <a href="<?php echo esc_url( $addon->link ); ?>"> |
| 62 | <div class="plugin-card-top"> |
| 63 | <div class="name column-name"> |
| 64 | <h3 class="plugin-name"> |
| 65 | <?php echo esc_html( $addon->title ); ?> |
| 66 | <img src="<?php echo esc_url( evf()->plugin_url() . '/assets/' . $addon->image ); ?>" class="plugin-icon" alt="" /> |
| 67 | </h3> |
| 68 | </div> |
| 69 | <div class="desc column-description"> |
| 70 | <p class="plugin-desc"><?php echo esc_html( $addon->excerpt ); ?></p> |
| 71 | </div> |
| 72 | </div> |
| 73 | </a> |
| 74 | <div class="plugin-card-bottom"> |
| 75 | <?php if ( in_array( str_replace( '-lifetime', '', $license_plan ), $addon->plan, true ) ) : ?> |
| 76 | <div class="status column-status"> |
| 77 | <strong><?php esc_html_e( 'Status:', 'everest-forms' ); ?></strong> |
| 78 | <?php if ( is_plugin_active( $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 79 | <span class="status-label status-active"><?php esc_html_e( 'Activated', 'everest-forms' ); ?></span> |
| 80 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 81 | <span class="status-label status-inactive"><?php esc_html_e( 'Inactive', 'everest-forms' ); ?></span> |
| 82 | <?php else : ?> |
| 83 | <span class="status-label status-install-now"><?php esc_html_e( 'Not Installed', 'everest-forms' ); ?></span> |
| 84 | <?php endif; ?> |
| 85 | </div> |
| 86 | <div class="action-buttons"> |
| 87 | <?php if ( is_plugin_active( $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 88 | <?php |
| 89 | /* translators: %s: Add-on title */ |
| 90 | $aria_label = sprintf( esc_html__( 'Deactivate %s now', 'everest-forms' ), $addon->title ); |
| 91 | $plugin_file = plugin_basename( $addon->slug . '/' . $addon->slug . '.php' ); |
| 92 | $url = wp_nonce_url( |
| 93 | add_query_arg( |
| 94 | array( |
| 95 | 'page' => 'evf-addons', |
| 96 | 'action' => 'deactivate', |
| 97 | 'plugin' => $plugin_file, |
| 98 | ), |
| 99 | admin_url( 'admin.php' ) |
| 100 | ), |
| 101 | 'deactivate-plugin_' . $plugin_file |
| 102 | ); |
| 103 | ?> |
| 104 | <a class="button button-secondary deactivate-now" href="<?php echo esc_url( $url ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Deactivate', 'everest-forms' ); ?></a> |
| 105 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 106 | <?php |
| 107 | /* translators: %s: Add-on title */ |
| 108 | $aria_label = sprintf( esc_html__( 'Activate %s now', 'everest-forms' ), $addon->title ); |
| 109 | $plugin_file = plugin_basename( $addon->slug . '/' . $addon->slug . '.php' ); |
| 110 | $url = wp_nonce_url( |
| 111 | add_query_arg( |
| 112 | array( |
| 113 | 'page' => 'evf-addons', |
| 114 | 'action' => 'activate', |
| 115 | 'plugin' => $plugin_file, |
| 116 | ), |
| 117 | admin_url( 'admin.php' ) |
| 118 | ), |
| 119 | 'activate-plugin_' . $plugin_file |
| 120 | ); |
| 121 | ?> |
| 122 | <a class="button button-primary activate-now" href="<?php echo esc_url( $url ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Activate', 'everest-forms' ); ?></a> |
| 123 | <?php else : ?> |
| 124 | <?php |
| 125 | /* translators: %s: Add-on title */ |
| 126 | $aria_label = sprintf( esc_html__( 'Install %s now', 'everest-forms' ), $addon->title ); |
| 127 | ?> |
| 128 | <a href="#" class="button install-now" data-slug="<?php echo esc_attr( $addon->slug ); ?>" data-name="<?php echo esc_attr( $addon->name ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Install Addon', 'everest-forms' ); ?></a> |
| 129 | <?php endif; ?> |
| 130 | </div> |
| 131 | <?php else : ?> |
| 132 | <div class="action-buttons upgrade-plan"> |
| 133 | <a class="button upgrade-now" href="https://wpeverest.com/wordpress-plugins/everest-forms/pricing/?utm_source=addons-page&utm_medium=upgrade-button&utm_campaign=evf-upgrade-to-pro" target="_blank"><?php esc_html_e( 'Upgrade Plan', 'everest-forms' ); ?></a> |
| 134 | </div> |
| 135 | <?php endif; ?> |
| 136 | </div> |
| 137 | </div> |
| 138 | <?php endforeach; ?> |
| 139 | </div> |
| 140 | </div> |
| 141 | </form> |
| 142 | <?php endif; ?> |
| 143 | <?php else : ?> |
| 144 | <p> |
| 145 | <?php |
| 146 | /* translators: %s: Add-ons Link */ |
| 147 | printf( esc_html__( 'Our catalog of Everest Forms Add-ons/Extensions can be found on WPEverest.com here: <a href="%s">Everest Forms Extensions Catalog</a>', 'everest-forms' ), 'https://wpeverest.com/wordpress-plugins/everest-forms/' ); |
| 148 | ?> |
| 149 | </p> |
| 150 | <?php endif; ?> |
| 151 | </div> |
| 152 | <?php |
| 153 | wp_print_request_filesystem_credentials_modal(); |
| 154 | wp_print_admin_notice_templates(); |
| 155 |