Settings.php
86 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CleanTalk. |
| 4 | * |
| 5 | * @since 3.2.2 |
| 6 | * @package EverestForms\Addons\CleanTalk\Settings |
| 7 | */ |
| 8 | |
| 9 | namespace EverestForms\Addons\CleanTalk\Settings; |
| 10 | |
| 11 | /** |
| 12 | * CleanTalk. |
| 13 | * |
| 14 | * @since 3.2.2 |
| 15 | */ |
| 16 | class Settings extends \EVF_Integration { |
| 17 | |
| 18 | /** |
| 19 | * Account status. |
| 20 | * |
| 21 | * @var [type] The account status. |
| 22 | */ |
| 23 | |
| 24 | public $account_status; |
| 25 | /** |
| 26 | * Constructor. |
| 27 | * |
| 28 | * @since 3.2.2 |
| 29 | */ |
| 30 | public function __construct() { |
| 31 | $this->id = 'clean-talk'; |
| 32 | $this->icon = plugins_url( 'addons/CleanTalk/assets/images/CleanTalk.png', EVF_PLUGIN_FILE ); |
| 33 | $this->method_title = esc_html__( 'CleanTalk', 'everest-forms' ); |
| 34 | $this->method_description = esc_html__( 'CleanTalk Integration with Everest Forms', 'everest-forms' ); |
| 35 | $connected_lists = get_option( 'everest_forms_integrations', array() ); |
| 36 | if ( ! empty( get_option( 'everest_forms_recaptcha_cleantalk_access_key' ) ) ) { |
| 37 | $this->account_status = 'connected'; |
| 38 | } else { |
| 39 | $this->account_status = ''; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Output Integration. |
| 45 | */ |
| 46 | public function output_integration() { |
| 47 | ?> |
| 48 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=evf-settings&tab=integration' ) ); ?>" class="everest-forms-integration-back-button"> |
| 49 | <span><?php echo esc_html__( 'Back', 'everest-forms' ); ?></span> |
| 50 | </a> |
| 51 | <div class="everest-forms-integration-content"> |
| 52 | <div class="integration-addon-detail"> |
| 53 | <div class="evf-integration-info-header"> |
| 54 | <figure class="evf-integration-logo"> |
| 55 | <img src="<?php echo esc_attr( $this->icon ); ?>" alt="<?php echo esc_attr( 'CleanTalk' ); ?>"> |
| 56 | </figure> |
| 57 | <div class="integration-info"> |
| 58 | <h3><?php echo $this->method_title; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></h3> |
| 59 | </div> |
| 60 | </div> |
| 61 | <p><?php echo $this->method_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?></p> |
| 62 | </div> |
| 63 | |
| 64 | <div class="integration-connection-detail"> |
| 65 | <div class="evf-connection-list"> |
| 66 | <!-- Toggle Row --> |
| 67 | <form method="post" action="" id="everest-forms-clean-talk-settings-form"> |
| 68 | <!-- Access Key --> |
| 69 | <div class="evf-clean-talk-access-key"> |
| 70 | <div> |
| 71 | <label class="evf-clean-talk-label-1" for="everest_forms_recaptcha_cleantalk_access_key"><?php echo __( 'CleanTalk Access Key', 'everest-forms' ); ?></label> |
| 72 | </div> |
| 73 | <input style="margin: 12px 0; width: 100%" class="evf-access-key" type="password" id="everest_forms_recaptcha_cleantalk_access_key" name="everest_forms_recaptcha_cleantalk_access_key" value="<?php echo esc_attr( get_option( 'everest_forms_recaptcha_cleantalk_access_key' ) ); ?>"> |
| 74 | <p style="margin-bottom:0; margin-top:0"><?php echo __( 'Enter your CleanTalk REST API key from your ', 'everest-forms' ); ?><a href="https://cleantalk.org/my/" target="_blank" rel="noopener noreferrer"><?php echo __( 'account dashboard here', 'everest-forms' ); ?></a>.</p> |
| 75 | </div> |
| 76 | <div class="evf-clean-talk-message" style="display: none;"></div> |
| 77 | </div> |
| 78 | <button style="margin-top: 12px;" type="submit" id="everest-forms-clean-talk-save-settings" class="everest-forms-btn everest-forms-btn-primary" ><?php echo __( 'Save Settings', 'everest-forms' ); ?></button> |
| 79 | </form> |
| 80 | |
| 81 | </div> |
| 82 | </div> |
| 83 | <?php |
| 84 | } |
| 85 | } |
| 86 |