| 1 |
<?php |
| 2 |
|
| 3 |
// Do not allow the file to be called directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
// Determine which sites need activation or not. |
| 9 |
$i = 0; |
| 10 |
$checkbox_list = ''; |
| 11 |
$activated = ''; |
| 12 |
$sites = get_sites(); |
| 13 |
foreach ( $sites as $site ) { |
| 14 |
if ( get_blog_option( $site->id, 'patchstack_clientid' ) == '' ) { |
| 15 |
$checkbox_list .= '<input type="checkbox" name="sites[]" id="site-' . esc_attr( $site->blog_id ) . '" value="' . esc_url( $site->siteurl ) . '"><label for="site-' . esc_attr( $site->blog_id ) . '">' . esc_url( $site->siteurl ) . '</label><br />'; |
| 16 |
$i++; |
| 17 |
} else { |
| 18 |
$activated .= esc_url( $site->siteurl ) . '<br />'; |
| 19 |
} |
| 20 |
} |
| 21 |
?> |
| 22 |
<div class="patchstack-font"> |
| 23 |
<h2 style="padding: 0;">Multisite Activation</h2> |
| 24 |
<p><?php echo wp_kses( $this->plugin->multisite->error, $this->allowed_html ); ?> |
| 25 |
Select the sites on which you would like to activate the Patchstack plugin. These sites must be accessible from the public internet.<br /><br> |
| 26 |
Note that if these sites have not been added to your Patchstack account yet, they will be added for you. Keep in mind that this might affect your upcoming bill depending on your current subscription plan.<br /> |
| 27 |
You can also manually add your sites at <a href="https://app.patchstack.com/sites?add=1" target="_blank">app.patchstack.com</a> after which you can activate them on this page.<br><br /> |
| 28 |
If you are an AppSumo user or have a limited amount of sites you can add, you must select the proper number of sites that can still be added to your account.</p> |
| 29 |
|
| 30 |
<h2 style="padding: 20px 0 0 0; display: <?php echo $i > 0 ? 'block' : 'none'; ?>;">Not Activated</h2> |
| 31 |
<form action="" method="POST" style="display: <?php echo $i > 0 ? 'block' : 'none'; ?>;"> |
| 32 |
<input type="hidden" name="patchstack_do" value="do_licenses"> |
| 33 |
<input type="hidden" value="<?php echo wp_create_nonce( 'patchstack-multisite-activation' ); ?>" name="PatchstackNonce"> |
| 34 |
<?php echo wp_kses( $checkbox_list, $this->allowed_html ); ?> |
| 35 |
<br/> |
| 36 |
<input type="submit" class="button-primary" value="Activate" /> |
| 37 |
</form> |
| 38 |
|
| 39 |
<br /> |
| 40 |
<h2 style="padding: 0;">Activated</h2> |
| 41 |
<?php echo wp_kses( $activated, $this->allowed_html ); ?> |
| 42 |
</div> |
| 43 |
|