multiple-configuration
3 years ago
prior-consent
2 years ago
dashboard-page.php
2 years ago
debug-page.php
3 years ago
gcm-page.php
2 years ago
gtm-page.php
2 years ago
iab-page.php
2 years ago
legislations-page.php
3 years ago
network-settings-page.php
2 years ago
settings-page.php
2 years ago
support-page.php
2 years ago
iab-page.php
267 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @var bool $cookiebot_iab |
| 4 | * @var string $cookiebot_tcf_version |
| 5 | * @var object $purposes |
| 6 | * @var object $special_purposes |
| 7 | * @var object $features |
| 8 | * @var object $special_features |
| 9 | * @var object $vendors |
| 10 | * @var array $vendor_data |
| 11 | * @var array $custom_tcf_purposes |
| 12 | * @var array $custom_tcf_special_purposes |
| 13 | * @var array $custom_tcf_features |
| 14 | * @var array $custom_tcf_special_features |
| 15 | * @var array $custom_tcf_vendors |
| 16 | * @var array $custom_tcf_restrictions |
| 17 | * @var array $custom_tcf_ac_vendors |
| 18 | * @var array $extra_providers |
| 19 | */ |
| 20 | |
| 21 | use cybot\cookiebot\settings\pages\Iab_Page; |
| 22 | |
| 23 | $iab_page = new Iab_Page(); |
| 24 | ?> |
| 25 | <div class="cb-settings__config__item"> |
| 26 | <div class="cb-settings__config__content"> |
| 27 | <h3 class="cb-settings__config__subtitle"><?php esc_html_e( 'IAB Integration:', 'cookiebot' ); ?></h3> |
| 28 | <p class="cb-general__info__text"> |
| 29 | <?php esc_html_e( 'If you want to use the IAB Framework TCF within your Consent Management Platform (CMP) you can enable it on the right. Be aware that activating this could override some of the configurations you made with the default setup defined by the IAB.', 'cookiebot' ); ?> |
| 30 | </p> |
| 31 | <a href="https://support.cookiebot.com/hc/en-us/articles/360007652694-Cookiebot-and-the-IAB-Consent-Framework" |
| 32 | target="_blank" class="cb-btn cb-link-btn" rel="noopener"> |
| 33 | <?php esc_html_e( 'Read more on IAB with Cookiebot CMP here', 'cookiebot' ); ?> |
| 34 | </a> |
| 35 | </div> |
| 36 | <div class="cb-settings__config__data"> |
| 37 | <div class="cb-settings__config__data__inner"> |
| 38 | <label class="switch-checkbox" for="cookiebot-iab"> |
| 39 | <input type="checkbox" name="cookiebot-iab" id="cookiebot-iab" value="1" |
| 40 | <?php checked( 1, $cookiebot_iab ); ?>> |
| 41 | <div class="switcher"></div> |
| 42 | <?php esc_html_e( 'IAB TCF V2.2 integration', 'cookiebot' ); ?> |
| 43 | </label> |
| 44 | </div> |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <?php if ( $vendor_data ) : ?> |
| 49 | <?php foreach ( $vendor_data as $name => $data ) : ?> |
| 50 | <?php if ( $name !== 'vendors' ) : ?> |
| 51 | <?php $item_attribute = Iab_Page::get_option_attribute_name( $name ); ?> |
| 52 | <div class="cb-settings__vendor__config__item"> |
| 53 | <div class="cb-settings__config__content"> |
| 54 | <h3 class="cb-settings__config__subtitle"> |
| 55 | <?php echo esc_html( $data['title'] ); ?> |
| 56 | </h3> |
| 57 | <p class="cb-general__info__text"><?php echo esc_html( $data['description'] ); ?></p> |
| 58 | </div> |
| 59 | <div class="cb-settings__config__data"> |
| 60 | <div class="cb-settings__config__data__inner"> |
| 61 | <div class="vendor-selected-items search-list"> |
| 62 | <?php foreach ( $data['items'] as $item ) : ?> |
| 63 | <label class="switch-checkbox" for="cookiebot-<?php echo esc_attr( $item_attribute ); ?>-<?php echo esc_attr( $item['id'] ); ?>"> |
| 64 | <input |
| 65 | type="checkbox" |
| 66 | name="cookiebot-tcf-<?php echo esc_attr( $item_attribute ); ?>[]" |
| 67 | id="cookiebot-<?php echo esc_attr( $item_attribute ); ?>-<?php echo esc_attr( $item['id'] ); ?>" |
| 68 | value="<?php echo esc_attr( $item['id'] ); ?>" |
| 69 | <?php echo $iab_page->vendor_checked( $item['id'], $data['selected'] ) ? 'checked' : ''; ?>> |
| 70 | <div class="switcher"></div> |
| 71 | <?php echo esc_html( $iab_page->return_translation_value( $name, $item ) ); ?> |
| 72 | </label> |
| 73 | <?php endforeach; ?> |
| 74 | </div> |
| 75 | </div> |
| 76 | </div> |
| 77 | </div> |
| 78 | <?php endif; ?> |
| 79 | <?php endforeach; ?> |
| 80 | <?php else : ?> |
| 81 | <div class="cb-settings__vendor__config__item vendor-list-offline"> |
| 82 | <div class="cb-settings__config__content"> |
| 83 | <h3 class="cb-settings__config__subtitle"> |
| 84 | <?php echo esc_html_e( 'IAB vendor list is temporarily offline. Please try refreshing the page after a couple of minutes.', 'cookiebot' ); ?> |
| 85 | </h3> |
| 86 | <p class="cb-general__info__text"><?php echo esc_html_e( 'If you had previously saved configurations, don’t worry, they will continue to work.', 'cookiebot' ); ?></p> |
| 87 | </div> |
| 88 | </div> |
| 89 | <?php |
| 90 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 91 | echo Iab_Page::get_backup_custom_option( 'cookiebot-tcf-purposes', $custom_tcf_purposes ); |
| 92 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 93 | echo Iab_Page::get_backup_custom_option( 'cookiebot-tcf-special-purposes', $custom_tcf_special_purposes ); |
| 94 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 95 | echo Iab_Page::get_backup_custom_option( 'cookiebot-tcf-features', $custom_tcf_features ); |
| 96 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 97 | echo Iab_Page::get_backup_custom_option( 'cookiebot-tcf-special-features', $custom_tcf_special_features ); |
| 98 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 99 | echo Iab_Page::get_backup_custom_option( 'cookiebot-tcf-vendors', $custom_tcf_vendors ); |
| 100 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 101 | echo Iab_Page::get_backup_custom_restrictions( $custom_tcf_restrictions ); |
| 102 | ?> |
| 103 | <?php endif; ?> |
| 104 | |
| 105 | <?php if ( ( $vendor_data && $vendor_data['vendors'] ) || $extra_providers ) : ?> |
| 106 | <div class="cb-settings__vendor__config__item"> |
| 107 | <div class="cb-settings__config__content"> |
| 108 | <h3 class="cb-settings__config__subtitle"> |
| 109 | <?php esc_html_e( 'Sharing data with third-party vendors', 'cookiebot' ); ?> |
| 110 | </h3> |
| 111 | <p class="cb-general__info__text"> |
| 112 | <?php |
| 113 | esc_html_e( 'Select vendors with whom you’ll share users’ data. We’ll include this information on the second layer of your consent banner, where users interested in more granular detail about who will access their data can view it.', 'cookiebot' ); |
| 114 | ?> |
| 115 | </p> |
| 116 | </div> |
| 117 | </div> |
| 118 | <?php endif; ?> |
| 119 | |
| 120 | |
| 121 | <?php if ( $vendor_data && $vendor_data['vendors'] ) : ?> |
| 122 | <?php $item_attribute = Iab_Page::get_option_attribute_name( 'vendors' ); ?> |
| 123 | <div class="cb-settings__vendor__config__item"> |
| 124 | <div class="cb-settings__config__content"> |
| 125 | <h3 class="cb-settings__config__subtitle only-title"> |
| 126 | <?php echo esc_html( $vendor_data['vendors']['title'] ); ?> |
| 127 | </h3> |
| 128 | </div> |
| 129 | <div class="cb-settings__config__data"> |
| 130 | <div class="cb-settings__config__data__inner"> |
| 131 | <input type="text" class="cb-settings__selector-search checkbox-vendor-search" placeholder="<?php esc_html_e( 'Search', 'cookiebot' ); ?>..."> |
| 132 | |
| 133 | <div class="vendor-selected-items search-list"> |
| 134 | <?php foreach ( $vendor_data['vendors']['items'] as $item ) : ?> |
| 135 | <label class="switch-checkbox" for="cookiebot-<?php echo esc_attr( $item_attribute ); ?>-<?php echo esc_attr( $item['id'] ); ?>"> |
| 136 | <input |
| 137 | type="checkbox" |
| 138 | name="cookiebot-tcf-<?php echo esc_attr( $item_attribute ); ?>[]" |
| 139 | id="cookiebot-<?php echo esc_attr( $item_attribute ); ?>-<?php echo esc_attr( $item['id'] ); ?>" |
| 140 | value="<?php echo esc_attr( $item['id'] ); ?>" |
| 141 | <?php echo $iab_page->vendor_checked( $item['id'], $vendor_data['vendors']['selected'] ) ? 'checked' : ''; ?>> |
| 142 | <div class="switcher"></div> |
| 143 | <?php echo esc_html( $iab_page->return_translation_value( 'vendors', $item ) ); ?> |
| 144 | </label> |
| 145 | <?php endforeach; ?> |
| 146 | </div> |
| 147 | </div> |
| 148 | </div> |
| 149 | </div> |
| 150 | <?php endif; ?> |
| 151 | |
| 152 | <?php if ( $extra_providers ) : ?> |
| 153 | <div class="cb-settings__vendor__config__item"> |
| 154 | <div class="cb-settings__config__content"> |
| 155 | <h3 class="cb-settings__config__subtitle only-title"> |
| 156 | <?php esc_html_e( 'Google Ads certified external vendors', 'cookiebot' ); ?> |
| 157 | </h3> |
| 158 | </div> |
| 159 | <div class="cb-settings__config__data"> |
| 160 | <div class="cb-settings__config__data__inner"> |
| 161 | <input type="text" class="cb-settings__selector-search checkbox-vendor-search" placeholder="<?php esc_html_e( 'Search', 'cookiebot' ); ?>..."> |
| 162 | <div class="vendor-selected-items search-list"> |
| 163 | <?php foreach ( $extra_providers as $item ) : ?> |
| 164 | <label class="switch-checkbox" for="cookiebot-ac-vendor<?php echo esc_attr( $item['id'] ); ?>"> |
| 165 | <input |
| 166 | type="checkbox" |
| 167 | name="cookiebot-tcf-ac-vendors[]" |
| 168 | id="cookiebot-ac-vendor<?php echo esc_attr( $item['id'] ); ?>" |
| 169 | value="<?php echo esc_attr( $item['id'] ); ?>" |
| 170 | <?php echo $iab_page->vendor_checked( $item['id'], $custom_tcf_ac_vendors ) ? 'checked' : ''; ?>> |
| 171 | <div class="switcher"></div> |
| 172 | <?php echo esc_html( $item['name'] ); ?> |
| 173 | </label> |
| 174 | <?php endforeach; ?> |
| 175 | </div> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | <?php endif; ?> |
| 180 | <?php if ( $vendor_data ) : ?> |
| 181 | |
| 182 | <div class="cb-settings__vendor__config__item"> |
| 183 | <div class="cb-settings__config__content"> |
| 184 | <h3 class="cb-settings__config__subtitle"> |
| 185 | <?php esc_html_e( 'Restrictions of data use purposes for vendors', 'cookiebot' ); ?> |
| 186 | </h3> |
| 187 | <p class="cb-general__info__text"> |
| 188 | <?php |
| 189 | esc_html_e( |
| 190 | 'Set restrictions on data use purposes for specific vendors. Add vendors and the data use purposes that each vendor is allowed. We’ll share this information with users within your consent banner.', |
| 191 | 'cookiebot' |
| 192 | ); |
| 193 | ?> |
| 194 | </p> |
| 195 | <div class="cb-btn cb-main-btn restriction-vendor-add"><?php esc_html_e( 'Add Vendor', 'cookiebot' ); ?></div> |
| 196 | </div> |
| 197 | <?php |
| 198 | foreach ( $custom_tcf_restrictions as $vendor => $settings ) : |
| 199 | $select_name_attr = $vendor !== 0 ? 'cookiebot-tcf-disallowed[' . $vendor . ']' : ''; |
| 200 | $vendors_list = $vendor_data['vendors']; |
| 201 | $selector_placeholder = __( 'Select Vendor', 'cookiebot' ); |
| 202 | foreach ( $vendors_list['items'] as $item ) { |
| 203 | if ( $item['id'] === $vendor ) { |
| 204 | $selector_placeholder = $item['name']; |
| 205 | } |
| 206 | } |
| 207 | ?> |
| 208 | <div class="cb-settings__config__data cb-settings__vendor__restrictions"> |
| 209 | <div class="cb-settings__config__data__inner"> |
| 210 | <div class="cb-settings__selector__container"> |
| 211 | <input type="hidden" name="<?php echo esc_html( $select_name_attr ); ?>" class="cb-settings__selector__container-input"> |
| 212 | <div class="cb-settings__selector-selector" data-placeholder="<?php esc_attr_e( 'Select Vendor', 'cookiebot' ); ?>"><?php echo esc_html( $selector_placeholder ); ?></div> |
| 213 | <div class="cb-settings__selector-list-container hidden"> |
| 214 | <div class="cb-settings__selector-veil"></div> |
| 215 | <input type="text" class="cb-settings__selector-search" placeholder="<?php esc_html_e( 'Search', 'cookiebot' ); ?>..."> |
| 216 | <div class="cb-settings__selector-list search-list"> |
| 217 | <?php foreach ( $vendors_list['items'] as $item ) : ?> |
| 218 | <div |
| 219 | data-value="<?php echo esc_attr( $item['id'] ); ?>" |
| 220 | class="cb-settings__selector-list-item <?php echo $item['id'] === $vendor ? 'selected' : ''; ?>"><?php echo esc_html( $item['name'] ); ?></div> |
| 221 | <?php endforeach; ?> |
| 222 | </div> |
| 223 | </div> |
| 224 | </div> |
| 225 | <div class="cb-btn cb-main-btn vendor-purposes-show"><?php esc_html_e( 'Set Purposes', 'cookiebot' ); ?></div> |
| 226 | <div class="remove__restriction dashicons dashicons-dismiss"></div> |
| 227 | </div> |
| 228 | <div class="vendor-purposes-restrictions hidden"> |
| 229 | <?php |
| 230 | foreach ( $vendor_data as $name => $data ) : |
| 231 | if ( $name === 'purposes' ) : |
| 232 | ?> |
| 233 | <div class="cb-settings__config__data__inner"> |
| 234 | <div class="vendor-selected-items"> |
| 235 | <?php foreach ( $data['items'] as $item ) : ?> |
| 236 | |
| 237 | <?php |
| 238 | $item_attribute = str_replace( '_', '-', $name ); |
| 239 | $item_name = $vendor !== 0 ? 'cookiebot-tcf-disallowed[' . $vendor . '][purposes][]' : ''; |
| 240 | $item_id = 'cookiebot-vendor' . $vendor . '-' . $item_attribute . $item['id']; |
| 241 | ?> |
| 242 | |
| 243 | <label class="switch-checkbox" for="<?php echo esc_html( $item_id ); ?>"> |
| 244 | <input |
| 245 | type="checkbox" |
| 246 | name="<?php echo esc_attr( $item_name ); ?>" |
| 247 | id="<?php echo esc_html( $item_id ); ?>" |
| 248 | class="purpose-item" |
| 249 | value="<?php echo esc_attr( $item['id'] ); ?>" |
| 250 | <?php echo $iab_page->vendor_checked( $item['id'], $settings['purposes'] ) ? 'checked' : ''; ?>> |
| 251 | |
| 252 | <div class="switcher"></div> |
| 253 | <?php echo esc_html( $iab_page->return_translation_value( $name, $item ) ); ?> |
| 254 | </label> |
| 255 | <?php endforeach; ?> |
| 256 | </div> |
| 257 | </div> |
| 258 | <?php |
| 259 | endif; |
| 260 | endforeach; |
| 261 | ?> |
| 262 | </div> |
| 263 | </div> |
| 264 | <?php endforeach; ?> |
| 265 | </div> |
| 266 | <?php endif; ?> |
| 267 |