settings.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. if (!defined('ABSPATH')) exit;
  3. require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
  4. $module = NewsletterStatistics::instance();
  5. $controls = new NewsletterControls();
  6. if (!$controls->is_action()) {
  7. $controls->data = $module->options;
  8. }
  9. do_action('newsletter_statistics_settings_init', $controls);
  10. if ($controls->is_action('save')) {
  11. $module->save_options($controls->data);
  12. $controls->add_message_saved();
  13. }
  14. ?>
  15. <div class="wrap" id="tnp-wrap">
  16. <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
  17. <div id="tnp-heading">
  18. <h2><?php _e('Statistics Settings', 'newsletter') ?></h2>
  19. </div>
  20. <div id="tnp-body">
  21. <form method="post" action="">
  22. <?php $controls->init(); ?>
  23. <div id="tabs">
  24. <ul>
  25. <li><a href="#tab-configuration"><?php _e('Configuration', 'newsletter') ?></a></li>
  26. <li><a href="#tab-countries"><?php _e('Countries', 'newsletter') ?></a></li>
  27. </ul>
  28. <div id="tab-configuration">
  29. <table class="form-table">
  30. <tr>
  31. <th><?php _e('Secret key', 'newsletter') ?></th>
  32. <td>
  33. <?php $controls->text('key') ?>
  34. <p class="description">
  35. <?php _e('This auto-generated key is used to protect the click tracking. If you change it old tracking links to external domains won\'t be registered anymore.', 'newsletter-statistics') ?>
  36. </p>
  37. </td>
  38. </tr>
  39. </table>
  40. <p>
  41. <?php $controls->button_save() ?>
  42. </p>
  43. </div>
  44. <div id="tab-countries">
  45. <?php
  46. if (!has_action('newsletter_statistics_settings_countries')) {
  47. ?>
  48. <p>This panel contains information about country detection added by
  49. <a href="https://www.thenewsletterplugin.com/plugins/newsletter/reports-module" target="_blank">Reports Extension</a>.</p>
  50. <?php
  51. } else {
  52. do_action('newsletter_statistics_settings_countries', $controls);
  53. }
  54. ?>
  55. </div>
  56. </div>
  57. </form>
  58. </div>
  59. <?php include NEWSLETTER_DIR . '/tnp-footer.php' ?>
  60. </div>