ad-list
5 months ago
conditions
5 months ago
notices
1 year ago
upgrades
1 year ago
ad-conditions-string-operators.php
3 months ago
checks.php
3 months ago
index.php
7 years ago
modal.php
3 months ago
overview-addons-line.php
5 months ago
overview-notice-row.php
1 year ago
overview-widget.php
1 year ago
placement-form.php
1 year ago
placement-injection-top.php
1 year ago
placement-types.php
3 years ago
placements-ad-label.php
1 year ago
placements-inline-css.php
1 year ago
placements-item.php
1 year ago
post-list-filter-dropdown.php
5 months ago
setting-license.php
1 year ago
support-callout.php
1 year ago
placement-form.php
80 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render form to create new placements. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.2 |
| 8 | * |
| 9 | * @var array $placement_types types of placements. |
| 10 | */ |
| 11 | |
| 12 | ?> |
| 13 | <form method="POST" class="advads-placements-new-form advads-form" id="advads-placements-new-form"> |
| 14 | <h3>1. <?php esc_html_e( 'Choose a placement type', 'advanced-ads' ); ?></h3> |
| 15 | <p class="description"> |
| 16 | <?php |
| 17 | printf( |
| 18 | wp_kses( |
| 19 | /* translators: %s is a URL. */ |
| 20 | __( 'Placement types define where the ad is going to be displayed. Learn more about the different types from the <a href="%s">manual</a>', 'advanced-ads' ), |
| 21 | [ |
| 22 | 'a' => [ |
| 23 | 'href' => [], |
| 24 | ], |
| 25 | ] |
| 26 | ), |
| 27 | 'https://wpadvancedads.com/manual/placements/#utm_source=advanced-ads&utm_medium=link&utm_campaign=placements' |
| 28 | ); |
| 29 | ?> |
| 30 | </p> |
| 31 | <?php require_once 'placement-types.php'; ?> |
| 32 | <?php |
| 33 | |
| 34 | // show Pro placements if Pro is not activated. |
| 35 | if ( ! defined( 'AAP_VERSION' ) ) : |
| 36 | include ADVADS_ABSPATH . 'admin/views/upgrades/pro-placements.php'; |
| 37 | else : |
| 38 | ?> |
| 39 | <div class="clear"></div> |
| 40 | <?php |
| 41 | endif; |
| 42 | ?> |
| 43 | <p class="advads-notice-inline advads-error advads-form-type-error"><?php esc_html_e( 'Please select a type.', 'advanced-ads' ); ?></p> |
| 44 | <br/> |
| 45 | <h3>2. <?php esc_html_e( 'Choose a Name', 'advanced-ads' ); ?></h3> |
| 46 | <p> |
| 47 | <input name="advads[placement][name]" class="advads-form-name" type="text" value="" placeholder="<?php esc_html_e( 'Placement Name', 'advanced-ads' ); ?>" /> |
| 48 | <span class="advads-help"> |
| 49 | <span class="advads-tooltip"> |
| 50 | <?php esc_html_e( 'The name of the placement is only visible to you. Tip: choose a descriptive one, e.g. Below Post Headline.', 'advanced-ads' ); ?> |
| 51 | </span> |
| 52 | </span> |
| 53 | </p> |
| 54 | <p class="advads-notice-inline advads-error advads-form-name-error"><?php esc_html_e( 'Please enter a name.', 'advanced-ads' ); ?></p> |
| 55 | <h3> |
| 56 | <label for="advads-placement-item">3. <?php esc_html_e( 'Choose the Ad or Group', 'advanced-ads' ); ?></label> |
| 57 | </h3> |
| 58 | <p> |
| 59 | <select name="advads[placement][item]" id="advads-placement-item" disabled> |
| 60 | <option value=""><?php esc_html_e( '--not selected--', 'advanced-ads' ); ?></option> |
| 61 | </select> |
| 62 | </p> |
| 63 | <?php wp_nonce_field( 'advads-placement', 'advads_placement', true ); ?> |
| 64 | </form> |
| 65 | |
| 66 | <script type="text/html" id="tmpl-advads-placement-ad-select"> |
| 67 | <select name="advads[placement][item]" id="advads-placement-item"> |
| 68 | <option value=""><?php esc_html_e( '--not selected--', 'advanced-ads' ); ?></option> |
| 69 | <# for ( group of data.items ) { #> |
| 70 | <optgroup label="{{ group.label }}"> |
| 71 | <# for ( item_id in group.items ) { #> |
| 72 | <option value="{{ item_id }}"> |
| 73 | {{ group.items[item_id].name }} |
| 74 | </option> |
| 75 | <# } #> |
| 76 | </optgroup> |
| 77 | <# } #> |
| 78 | </select> |
| 79 | </script> |
| 80 |