index.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. defined('ABSPATH') || exit;
  3. @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
  4. $controls = new NewsletterControls();
  5. $module = NewsletterUnsubscription::instance();
  6. $current_language = $module->get_current_language();
  7. $is_all_languages = $module->is_all_languages();
  8. if (!$is_all_languages) {
  9. $controls->warnings[] = 'You are configuring the language <strong>' . $current_language . '</strong>. Switch to "all languages" to see every options.';
  10. }
  11. if (!$controls->is_action()) {
  12. $controls->data = $module->get_options('', $current_language);
  13. } else {
  14. if ($controls->is_action('save')) {
  15. //$controls->data['unsubscription_text'] = NewsletterModule::clean_url_tags($controls->data['unsubscription_text']);
  16. //$controls->data['unsubscribed_text'] = NewsletterModule::clean_url_tags($controls->data['unsubscribed_text']);
  17. //$controls->data['unsubscribed_message'] = NewsletterModule::clean_url_tags($controls->data['unsubscribed_message']);
  18. $module->save_options($controls->data, '', null, $current_language);
  19. $controls->data = $module->get_options('', $current_language);
  20. $controls->add_message_saved();
  21. }
  22. if ($controls->is_action('reset')) {
  23. // On reset we ignore the current language
  24. $controls->data = $module->reset_options();
  25. }
  26. }
  27. ?>
  28. <div class="wrap" id="tnp-wrap">
  29. <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
  30. <div id="tnp-heading">
  31. <h2><?php _e('Cancellation', 'newsletter')?></h2>
  32. <?php $controls->panel_help('https://www.thenewsletterplugin.com/documentation/cancellation')?>
  33. </div>
  34. <div id="tnp-body">
  35. <form method="post" action="">
  36. <?php $controls->init(); ?>
  37. <p>
  38. <?php $controls->button_save() ?>
  39. <?php $controls->button_reset() ?>
  40. </p>
  41. <div id="tabs">
  42. <ul>
  43. <li><a href="#tabs-cancellation"><?php _e('Cancellation', 'newsletter') ?></a></li>
  44. <li><a href="#tabs-reactivation"><?php _e('Reactivation', 'newsletter') ?></a></li>
  45. </ul>
  46. <div id="tabs-cancellation">
  47. <table class="form-table">
  48. <tr>
  49. <th><?php _e('Cancellation message', 'newsletter') ?></th>
  50. <td>
  51. <?php $controls->wp_editor('unsubscribe_text', array('editor_height'=>250)); ?>
  52. <p class="description">
  53. </p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <th><?php _e('Goodbye message', 'newsletter') ?></th>
  58. <td>
  59. <?php $controls->wp_editor('unsubscribed_text', array('editor_height'=>250)); ?>
  60. <p class="description">
  61. </p>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th><?php _e('Goodbye email', 'newsletter') ?></th>
  66. <td>
  67. <?php $controls->email('unsubscribed', 'wordpress', $is_all_languages, array('editor_height'=>250)); ?>
  68. <p class="description">
  69. </p>
  70. </td>
  71. </tr>
  72. <tr>
  73. <th><?php _e('On error', 'newsletter')?></th>
  74. <td>
  75. <?php $controls->wp_editor('error_text', array('editor_height'=>150)); ?>
  76. <p class="description">
  77. </p>
  78. </td>
  79. </tr>
  80. </table>
  81. </div>
  82. <div id="tabs-reactivation">
  83. <table class="form-table">
  84. <tr>
  85. <th><?php _e('Reactivated message', 'newsletter') ?></th>
  86. <td>
  87. <?php $controls->wp_editor('reactivated_text', array('editor_height'=>250)); ?>
  88. <p class="description">
  89. </p>
  90. </td>
  91. </tr>
  92. </table>
  93. </div>
  94. </div>
  95. <p>
  96. <?php $controls->button_save() ?>
  97. <?php $controls->button_reset() ?>
  98. </p>
  99. </form>
  100. </div>
  101. <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
  102. </div>