condition-author.php
1 year ago
condition-device.php
1 year ago
condition-is-or-not.php
1 year ago
condition-number.php
3 years ago
condition-operator.php
1 year ago
condition-string.php
2 years ago
conditions-form.php
5 months ago
display-conditions-list.php
1 year ago
no-option.php
1 year ago
not-selected.php
4 years ago
visitor-conditions-list.php
1 year ago
condition-device.php
36 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for the Device visitor condition |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * |
| 7 | * @var string $name Form name attribute. |
| 8 | * @var string $operator The operator, should be one of `is` or `is_not`. |
| 9 | * @var array $type_options Array with additional information. |
| 10 | * @var array $options The options for the current condition. |
| 11 | * @var int $index The zero-based index for the current condition. |
| 12 | */ |
| 13 | |
| 14 | ?> |
| 15 | <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $options['type'] ); ?>"/> |
| 16 | |
| 17 | <div class="advads-conditions-single advads-buttonset"> |
| 18 | <?php |
| 19 | $rand = uniqid(); |
| 20 | foreach ( $type_options[ $options['type'] ]['device_types'] as $device_type ) : |
| 21 | $input_id = 'advads-visitor-conditions-device-' . $index . '-' . $device_type['id'] . '-' . $rand; |
| 22 | ?> |
| 23 | <label for="<?php echo esc_attr( $input_id ); ?>" class="button advads-button"> |
| 24 | <?php echo esc_html( $device_type['label'] ); ?> |
| 25 | </label> |
| 26 | <input type="checkbox" id="<?php echo esc_attr( $input_id ); ?>" name="<?php echo esc_attr( $name ); ?>[value][]" value="<?php echo esc_attr( $device_type['id'] ); ?>" <?php checked( $device_type['checked'] ); ?>> |
| 27 | <?php endforeach; ?> |
| 28 | <?php include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php'; // phpcs:ignore ?> |
| 29 | </div> |
| 30 | <?php |
| 31 | printf( |
| 32 | '<p class="description"><a href="%1$s" class="advads-manual-link" target="_blank">%2$s</a></p>', |
| 33 | esc_url( $type_options[ $options['type'] ]['helplink'] ), |
| 34 | esc_html__( 'Manual', 'advanced-ads' ) |
| 35 | ); |
| 36 |