network-settings.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php extract( $data ); ?>
  2. <?php if ( isset( $_GET['updated'] ) && 'true' == $_GET['updated'] ) : ?>
  3. <div class="updated"><?php esc_html_e( 'Jetpack Network Settings Updated!', 'jetpack' ); ?></div>
  4. <?php endif; ?>
  5. <?php if ( isset( $_GET['error'] ) && 'jetpack_protect_whitelist' == $_GET['error'] ) : ?>
  6. <div class="error"><?php esc_html_e( 'One of your IP addresses was not valid.', 'jetpack' ); ?></div>
  7. <?php endif; ?>
  8. <div class="wrap">
  9. <h2><?php _e( 'Network Settings', 'jetpack' ); ?></h2>
  10. <form action="edit.php?action=jetpack-network-settings" method="POST">
  11. <h3><?php _ex( 'Global', 'Affects all sites in a Multisite network.', 'jetpack' ); ?></h3>
  12. <p><?php _e( 'These settings affect all sites on the network.', 'jetpack' ); ?></p>
  13. <?php wp_nonce_field( 'jetpack-network-settings' ); ?>
  14. <table class="form-table">
  15. <?php /*
  16. <tr valign="top">
  17. <th scope="row"><label for="auto-connect">Auto-Connect New Sites</label></th>
  18. <td>
  19. <input type="checkbox" name="auto-connect" id="auto-connect" value="1" <?php checked($options['auto-connect']); ?> />
  20. <label for="auto-connect">Automagically connect all new sites in the network.</label>
  21. </td>
  22. </tr>
  23. /**/ ?>
  24. <tr valign="top">
  25. <th scope="row"><label for="sub-site-override"><?php _e( 'Sub-site override', 'jetpack' ); ?></label></th>
  26. <td>
  27. <input type="checkbox" name="sub-site-connection-override" id="sub-site-override" value="1" <?php checked($options['sub-site-connection-override']); ?> />
  28. <label for="sub-site-override"><?php _e( 'Allow individual site administrators to manage their own connections (connect and disconnect) to <a href="//wordpress.com">WordPress.com</a>', 'jetpack' ); ?></label>
  29. </td>
  30. </tr>
  31. <tr valign="top">
  32. <th scope="row"><label for="sub-site-override"><?php _e( 'Protect whitelist', 'jetpack' ); ?></label></th>
  33. <td>
  34. <p><strong><?php printf( __( 'Your current IP: %s', 'jetpack' ), jetpack_protect_get_ip() ); ?></strong></p>
  35. <textarea name="global-whitelist" style="width: 100%;" rows="8"><?php echo implode( PHP_EOL, $jetpack_protect_whitelist['global'] ); ?></textarea> <br />
  36. <label for="global-whitelist"><?php _e('IPv4 and IPv6 are acceptable. Enter multiple IPs on separate lines. <br />To specify a range, enter the low value and high value separated by a dash. Example: 12.12.12.1-12.12.12.100', 'jetpack' ); ?></label>
  37. </td>
  38. </tr>
  39. <?php /* Remove the toggles for 2.9, re-evaluate how they're done and added for a 3.0 release. They don't feel quite right yet.
  40. <tr>
  41. <th scope="row"><label for="manage_auto_activated_modules">Manage modules</label></th>
  42. <td>
  43. <input type="checkbox" name="manage_auto_activated_modules" id="manage_auto_activated_modules" onclick="jQuery('#jpms_settings_modules').toggle();" value="1" <?php checked( $options['manage_auto_activated_modules'] ); ?>/>
  44. <label for="manage_auto_activated_modules">Control which modules are auto-activated</label>
  45. </td>
  46. </tr>
  47. /**/ ?>
  48. </table>
  49. <?php /* Remove the toggles for 2.9, re-evaluate how they're done and added for a 3.0 release. They don't feel quite right yet.
  50. <?php
  51. $display_modules = ( 1 == $this->get_option( 'manage_auto_activated_modules' ) )? 'block': 'none';
  52. ?>
  53. <div id="jpms_settings_modules" style="display: <?php echo $display_modules; ?>">
  54. <h3><?php _e( 'Modules', 'jetpack' ); ?></h3>
  55. <p><?php _e( 'Modules to be automatically activated when new sites are created.', 'jetpack' ); ?></p>
  56. <table>
  57. <thead>
  58. <!--
  59. <tr>
  60. <td><input type="checkbox"></td>
  61. <td>Only show checked modules on subsites?</td>
  62. </tr>
  63. -->
  64. </thead>
  65. <tbody>
  66. <?php foreach( $modules AS $module ) { ?>
  67. <tr>
  68. <td><input type="checkbox" name="modules[]" value="<?php echo $module['module']; ?>" id="<?php echo $module['module']; ?>" <?php checked( in_array( $module['module'], $options['modules'] ) ); ?>/></td>
  69. <td><label for="<?php echo $module['module']; ?>"><?php echo $module['name']; ?></label></td>
  70. </tr>
  71. <?php } ?>
  72. </tbody>
  73. </table>
  74. </div>
  75. /**/ ?>
  76. <?php submit_button(); ?>
  77. </form>
  78. </div>