network-activation.php
95 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * @var array $VARS |
| 9 | * @var Freemius $fs |
| 10 | */ |
| 11 | $fs = freemius( $VARS['id'] ); |
| 12 | |
| 13 | $slug = $fs->get_slug(); |
| 14 | |
| 15 | $sites = $VARS['sites']; |
| 16 | $require_license_key = $VARS['require_license_key']; |
| 17 | |
| 18 | $show_delegation_option = $fs->apply_filters( 'show_delegation_option', true ); |
| 19 | $enable_per_site_activation = $fs->apply_filters( 'enable_per_site_activation', true ); |
| 20 | ?> |
| 21 | <?php $separator = '<td>|</td>' ?> |
| 22 | <div class="fs-multisite-options-container fs-apply-on-all-sites"<?php if ( ! $enable_per_site_activation ) |
| 23 | echo ' style="display: none;"' ?>> |
| 24 | <table class="fs-all-sites-options"> |
| 25 | <tbody> |
| 26 | <tr> |
| 27 | <td width="600"> |
| 28 | <label> |
| 29 | <?php |
| 30 | if ( ! $fs->is_network_upgrade_mode() ) { |
| 31 | $apply_checkbox_label = $require_license_key ? |
| 32 | fs_text_inline( 'Activate license on all sites in the network.', 'activate-license-on-all-sites-in-the-network', $slug ) : |
| 33 | fs_text_inline( 'Apply on all sites in the network.', 'apply-on-all-sites-in-the-network', $slug ); |
| 34 | } else { |
| 35 | $apply_checkbox_label = $require_license_key ? |
| 36 | fs_text_inline( 'Activate license on all pending sites.', 'activate-license-on-pending-sites-in-the-network', $slug ) : |
| 37 | fs_text_inline( 'Apply on all pending sites.', 'apply-on-pending-sites-in-the-network', $slug ); |
| 38 | |
| 39 | } |
| 40 | ?> |
| 41 | <input class="fs-apply-on-all-sites-checkbox" type="checkbox" value="true" checked><span><?php echo esc_html( $apply_checkbox_label ) ?></span> |
| 42 | </label> |
| 43 | </td> |
| 44 | <?php if ( ! $require_license_key ) : ?> |
| 45 | <td><a class="action action-allow" data-action-type="allow" href="#"><?php fs_esc_html_echo_inline( 'allow', 'allow', $slug ) ?></a></td> |
| 46 | <?php echo $separator ?> |
| 47 | <?php if ( $show_delegation_option ) : ?> |
| 48 | <td><a class="action action-delegate" data-action-type="delegate" href="#"><?php fs_esc_html_echo_inline( 'delegate', 'delegate', $slug ) ?></a></td> |
| 49 | <?php endif ?> |
| 50 | <?php if ( $fs->is_enable_anonymous() ) : ?> |
| 51 | <?php echo $separator ?> |
| 52 | <td><a class="action action-skip" data-action-type="skip" href="#"><?php echo strtolower( fs_esc_html_inline( 'skip', 'skip', $slug ) ) ?></a></td> |
| 53 | <?php endif ?> |
| 54 | <?php endif ?> |
| 55 | </tr> |
| 56 | </tbody> |
| 57 | </table> |
| 58 | <div class="fs-sites-list-container"> |
| 59 | <table cellspacing="0"> |
| 60 | <tbody> |
| 61 | <?php $site_props = array('uid', 'url', 'title', 'language') ?> |
| 62 | <?php foreach ( $sites as $site ) : ?> |
| 63 | <tr<?php if ( ! empty( $site['license_id'] ) ) { |
| 64 | echo ' data-license-id="' . esc_attr( $site['license_id'] ) . '"'; |
| 65 | } ?>> |
| 66 | <?php if ( $require_license_key ) : ?> |
| 67 | <td><input type="checkbox" value="true" /></td> |
| 68 | <?php endif ?> |
| 69 | <td class="blog-id"><span><?php echo esc_html( $site['blog_id'] ) ?></span>.</td> |
| 70 | <td width="600"><span><?php |
| 71 | $url = str_replace( 'http://', '', str_replace( 'https://', '', $site['url'] ) ); |
| 72 | echo esc_html( $url ); |
| 73 | ?></span> |
| 74 | <?php foreach ($site_props as $prop) : ?> |
| 75 | <input class="<?php echo esc_attr( $prop ) ?>" type="hidden" value="<?php echo esc_attr($site[$prop]) ?>" /> |
| 76 | <?php endforeach ?> |
| 77 | </td> |
| 78 | <?php if ( ! $require_license_key ) : ?> |
| 79 | <td><a class="action action-allow selected" data-action-type="allow" href="#"><?php fs_esc_html_echo_inline( 'allow', 'allow', $slug ) ?></a></td> |
| 80 | <?php echo $separator ?> |
| 81 | <?php if ( $show_delegation_option ) : ?> |
| 82 | <td><a class="action action-delegate" data-action-type="delegate" href="#"><?php fs_esc_html_echo_inline( 'delegate', 'delegate', $slug ) ?></a></td> |
| 83 | <?php endif ?> |
| 84 | <?php if ( $fs->is_enable_anonymous() ) : ?> |
| 85 | <?php echo $separator ?> |
| 86 | <td><a class="action action-skip" data-action-type="skip" href="#"><?php echo strtolower( fs_esc_html_inline( 'skip', 'skip', $slug ) ) ?></a></td> |
| 87 | <?php endif ?> |
| 88 | <?php endif ?> |
| 89 | </tr> |
| 90 | <?php endforeach ?> |
| 91 | </tbody> |
| 92 | </table> |
| 93 | </div> |
| 94 | </div> |
| 95 |