ad-label-position.php
1 year ago
ad-label.php
1 year ago
content-index.php
2 months ago
inline-css.php
1 year ago
item.php
1 year ago
name.php
1 year ago
status.php
1 year ago
content-index.php
56 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render content index option for placements. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.50.0 |
| 8 | * |
| 9 | * @var object $placement Placement instance. |
| 10 | * @var string $xpath xpath option. |
| 11 | * @var string $selected_tag The currently selected tag. |
| 12 | * @var array $tags Array of tags; indexded by tag value is label. cf. Content_Injection::get_tags(). |
| 13 | * @var string $index The currently selected index. |
| 14 | * @var array $positions Available positions. |
| 15 | * @var string $selected_position The currently selected position, defaults to 'after'. |
| 16 | * @var bool $start_from_bottom Whether to start counting from bottom. |
| 17 | */ |
| 18 | |
| 19 | ?> |
| 20 | <select name="advads[placements][options][position]"> |
| 21 | <?php foreach ( $positions as $position => $position_label ) : ?> |
| 22 | <option value="<?php echo esc_attr( $position ); ?>" <?php selected( $selected_position, $position ); ?>> |
| 23 | <?php echo esc_html( $position_label ); ?> |
| 24 | </option> |
| 25 | <?php endforeach; ?> |
| 26 | </select> |
| 27 | |
| 28 | <input type="number" name="advads[placements][options][index]" value="<?php echo (int) $index; ?>" min="1"/>. |
| 29 | |
| 30 | <select class="advads-placements-content-tag" name="advads[placements][options][tag]"> |
| 31 | <?php foreach ( $tags as $tag => $tag_label ) : // phpcs:ignore ?> |
| 32 | <option value="<?php echo esc_attr( $tag ); ?>" <?php selected( $selected_tag, $tag ); ?>> |
| 33 | <?php echo esc_html( $tag_label ); ?> |
| 34 | </option> |
| 35 | <?php endforeach; ?> |
| 36 | </select> |
| 37 | |
| 38 | <div id="advads-frontend-element-<?php echo esc_attr( $placement->get_id() ); ?>" class="advads-placements-content-custom-xpath<?php echo 'custom' !== $selected_tag ? ' hidden' : ''; ?>"> |
| 39 | <input name="advads[placements][options][xpath]" class="advads-frontend-element" type="text" value="<?php echo esc_html( $xpath ); ?>" placeholder="<?php esc_html_e( 'use xpath, e.g. `p[not(parent::blockquote)]`', 'advanced-ads' ); ?>"/> |
| 40 | |
| 41 | <button style="display:none; color: red;" type="button" class="advads-deactivate-frontend-picker button "> |
| 42 | <?php echo esc_html_x( 'stop selection', 'frontend picker', 'advanced-ads' ); ?> |
| 43 | </button> |
| 44 | |
| 45 | <button type="button" class="advads-activate-frontend-picker button " data-placementid="<?php echo esc_attr( $placement->get_id() ); ?>" data-pathtype="xpath" data-boundary="true"> |
| 46 | <?php esc_html_e( 'select position', 'advanced-ads' ); ?> |
| 47 | </button> |
| 48 | </div> |
| 49 | |
| 50 | <p> |
| 51 | <label> |
| 52 | <input type="checkbox" name="advads[placements][options][start_from_bottom]" value="1" <?php checked( $start_from_bottom ); ?>> |
| 53 | <?php esc_html_e( 'start counting from bottom', 'advanced-ads' ); ?> |
| 54 | </label> |
| 55 | </p> |
| 56 |