non-necessary-settings.php
100 lines
| 1 | <?php |
| 2 | // If this file is called directly, abort. |
| 3 | if ( ! defined( 'WPINC' ) ) { |
| 4 | die; |
| 5 | } |
| 6 | ?> |
| 7 | <style> |
| 8 | .vvv_textbox { |
| 9 | height: 150px; |
| 10 | width: 100%; |
| 11 | } |
| 12 | .notice, div.updated, div.error{ |
| 13 | margin: 5px 20px 15px 0; |
| 14 | } |
| 15 | </style> |
| 16 | <script type="text/javascript"> |
| 17 | var cli_success_message = '<?php echo esc_html__( 'Settings updated.', 'cookie-law-info' ); ?>'; |
| 18 | var cli_error_message = '<?php echo esc_html__( 'Unable to update Settings.', 'cookie-law-info' ); ?>'; |
| 19 | </script> |
| 20 | <div class="wrap"> |
| 21 | <?php include_once CLI_PLUGIN_PATH . 'admin/partials/wt-cli-update-banner.php'; ?> |
| 22 | <div class="cookie-law-info-form-container"> |
| 23 | <div class="cli-plugin-toolbar top"> |
| 24 | <h3><?php echo esc_html__( 'Non-necessary Cookie Settings', 'cookie-law-info' ); ?></h3> |
| 25 | </div> |
| 26 | <?php $form_action = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; ?> |
| 27 | <form method="post" action="<?php echo esc_url( $form_action ); ?>" id="cli_non-ncessary_form" class="cookie-sensitivity-form"> |
| 28 | <?php wp_nonce_field( 'cookielawinfo-update-thirdparty' ); ?> |
| 29 | <table class="form-table cli_non_necessary_form cli-admin-table"> |
| 30 | |
| 31 | <tr> |
| 32 | <td> |
| 33 | <label for="thirdparty_on_field"><?php echo esc_html__( 'Enable Non-necessary Cookie', 'cookie-law-info' ); ?></label> |
| 34 | <input type="radio" id="thirdparty_on_field_yes" name="thirdparty_on_field" class="styled" value="true" <?php echo ( filter_var( $settings['status'], FILTER_VALIDATE_BOOLEAN ) == true ) ? ' checked="checked" ' : ' '; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?> |
| 35 | <input type="radio" id="thirdparty_on_field_no" name="thirdparty_on_field" class="styled" value="false" <?php echo ( filter_var( $settings['status'], FILTER_VALIDATE_BOOLEAN ) == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'No', 'cookie-law-info' ); ?> |
| 36 | </td> |
| 37 | </tr> |
| 38 | <tr> |
| 39 | <td> |
| 40 | <label for="third_party_default_state"><?php echo esc_html__( 'Default state', 'cookie-law-info' ); ?></label> |
| 41 | <input type="radio" id="third_party_default_state_yes" name="third_party_default_state" class="styled" value="true" <?php echo ( filter_var( $settings['default_state'], FILTER_VALIDATE_BOOLEAN ) == true ) ? ' checked="checked" ' : ' '; ?> /><?php echo esc_html__( 'Enabled', 'cookie-law-info' ); ?> |
| 42 | <input type="radio" id="third_party_default_state_no" name="third_party_default_state" class="styled" value="false" <?php echo ( filter_var( $settings['default_state'], FILTER_VALIDATE_BOOLEAN ) == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'Disabled', 'cookie-law-info' ); ?> |
| 43 | <span class="cli_form_help"> |
| 44 | <?php echo esc_html__( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?> <br /> |
| 45 | </span> |
| 46 | </td> |
| 47 | </tr> |
| 48 | <tr> |
| 49 | <td> |
| 50 | <label for="wt_cli_non_necessary_title"><?php esc_html__( 'Title', 'cookie-law-info' ); ?></label> |
| 51 | <input type="text" id="wt_cli_non_necessary_title" name="wt_cli_non_necessary_title" value="<?php echo esc_attr( sanitize_text_field( stripslashes( $settings['title'] ) ) ); ?>" class="cli-textbox" /> |
| 52 | </td> |
| 53 | </tr> |
| 54 | <tr> |
| 55 | <td> |
| 56 | <label for="thirdparty_description"><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></label> |
| 57 | <textarea name="thirdparty_description" class="vvv_textbox"> <?php echo wp_kses_post( apply_filters( 'format_to_edit', stripslashes( $settings['description'] ) ) ); ?></textarea> |
| 58 | </td> |
| 59 | </tr> |
| 60 | <tr> |
| 61 | <td> |
| 62 | <label for="thirdparty_head_section"><?php echo esc_html__( 'This script will be added to the page HEAD section if the above settings is enabled and user has give consent.', 'cookie-law-info' ); ?></label> |
| 63 | <textarea name="thirdparty_head_section" class="vvv_textbox"> |
| 64 | <?php |
| 65 | echo apply_filters( 'format_to_edit', stripslashes( $settings['head_scripts'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 66 | ?> |
| 67 | </textarea> |
| 68 | <span class="cli_form_help"> |
| 69 | <?php echo esc_html__( 'Print scripts in the head tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info' ); ?> <br /> |
| 70 | eg:- <script>console.log("header script");</script> |
| 71 | </span> |
| 72 | </td> |
| 73 | </tr> |
| 74 | <tr> |
| 75 | <td> |
| 76 | <label for="thirdparty_body_section"><?php echo esc_html__( 'This script will be added right after the BODY section if the above settings is enabled and user has given consent.', 'cookie-law-info' ); ?></label> |
| 77 | <textarea name="thirdparty_body_section" class="vvv_textbox"> |
| 78 | <?php |
| 79 | echo apply_filters( 'format_to_edit', stripslashes( $settings['body_scripts'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 80 | ?> |
| 81 | </textarea> |
| 82 | <span class="cli_form_help"> |
| 83 | <?php echo esc_html__( 'Print scripts before the closing body tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info' ); ?> <br />eg:- <script>console.log("body script");</script> |
| 84 | </span> |
| 85 | </td> |
| 86 | </tr> |
| 87 | </table> |
| 88 | <div class="cli-plugin-toolbar bottom"> |
| 89 | <div class="left"> |
| 90 | </div> |
| 91 | <div class="right"> |
| 92 | <input type="hidden" name="cli_non-necessary_ajax_update" value="1"> |
| 93 | <input type="submit" name="update_admin_settings_form" value="<?php echo esc_html__( 'Update Settings', 'cookie-law-info' ); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" /> |
| 94 | <span class="spinner" style="margin-top:9px"></span> |
| 95 | </div> |
| 96 | </div> |
| 97 | </form> |
| 98 | </div> |
| 99 | </div> |
| 100 |