| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Dashboard: Shortcode Builder. |
| 5 |
* |
| 6 |
* @link https://plugins360.com |
| 7 |
* @since 1.3.0 |
| 8 |
* |
| 9 |
* @package Automatic_YouTube_Gallery |
| 10 |
*/ |
| 11 |
|
| 12 |
$fields = ayg_get_editor_fields(); |
| 13 |
?> |
| 14 |
|
| 15 |
<div id="ayg-shortcode-builder"> |
| 16 |
<!-- Shortcode Builder --> |
| 17 |
<div class="ayg-left-col"> |
| 18 |
<div class="ayg-col-content"> |
| 19 |
<div class="ayg-editor ayg-editor-field-type-playlist ayg-editor-field-theme-classic"> |
| 20 |
<?php |
| 21 |
foreach ( $fields as $key => $value ) : |
| 22 |
?> |
| 23 |
<div class="ayg-editor-section ayg-editor-section-<?php echo esc_attr( $key ); ?> <?php if ( 'source' == $key ) echo 'ayg-active'; ?>"> |
| 24 |
<div class="ayg-editor-section-header"> |
| 25 |
<span class="dashicons-before dashicons-plus"></span> |
| 26 |
<span class="dashicons-before dashicons-minus"></span> |
| 27 |
<?php echo esc_html( $value['label'] ); ?> |
| 28 |
</div> |
| 29 |
|
| 30 |
<div class="ayg-editor-controls" <?php if ( 'source' != $key ) echo 'style="display: none;"'; ?>> |
| 31 |
<?php |
| 32 |
foreach ( $value['fields'] as $field ) : |
| 33 |
if ( ! isset( $field['placeholder'] ) ) { |
| 34 |
$field['placeholder'] = ''; |
| 35 |
} |
| 36 |
?> |
| 37 |
<div class="ayg-editor-control ayg-editor-control-<?php echo esc_attr( $field['name'] ); ?>"> |
| 38 |
<?php if ( 'text' == $field['type'] || 'url' == $field['type'] || 'number' == $field['type'] ) : ?> |
| 39 |
<label><strong><?php echo esc_html( $field['label'] ); ?></strong></label> |
| 40 |
<input type="text" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>" /> |
| 41 |
<?php elseif ( 'textarea' == $field['type'] ) : ?> |
| 42 |
<label><strong><?php echo esc_html( $field['label'] ); ?></strong></label> |
| 43 |
<textarea name="<?php echo esc_attr( $field['name'] ); ?>" rows="8" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>"><?php echo esc_textarea( $field['value'] ); ?></textarea> |
| 44 |
<?php elseif ( 'select' == $field['type'] || 'radio' == $field['type'] ) : ?> |
| 45 |
<label><strong><?php echo esc_html( $field['label'] ); ?></strong></label> |
| 46 |
<select name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" data-default="<?php echo esc_attr( $field['value'] ); ?>"> |
| 47 |
<?php |
| 48 |
foreach ( $field['options'] as $value => $label ) { |
| 49 |
printf( '<option value="%s"%s>%s</option>', esc_attr( $value ), selected( $value, $field['value'], false ), esc_html( $label ) ); |
| 50 |
} |
| 51 |
?> |
| 52 |
</select> |
| 53 |
<?php elseif ( 'checkbox' == $field['type'] ) : ?> |
| 54 |
<label> |
| 55 |
<input type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?>" value="1" data-default="<?php echo esc_attr( $field['value'] ); ?>" <?php checked( $field['value'] ); ?> /> |
| 56 |
<strong><?php echo esc_html( $field['label'] ); ?></strong> |
| 57 |
</label> |
| 58 |
<?php elseif ( 'color' == $field['type'] ) : ?> |
| 59 |
<label><strong><?php echo esc_html( $field['label'] ); ?></strong></label> |
| 60 |
<input type="text" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> ayg-color-picker widefat" value="<?php echo esc_attr( $field['value'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>" /> |
| 61 |
<?php endif; ?> |
| 62 |
|
| 63 |
<!-- Hint --> |
| 64 |
<?php if ( isset( $field['description'] ) ) : ?> |
| 65 |
<p class="description"><?php echo wp_kses_post( $field['description'] ); ?></p> |
| 66 |
<?php endif; ?> |
| 67 |
</div> |
| 68 |
<?php |
| 69 |
endforeach; |
| 70 |
?> |
| 71 |
</div> |
| 72 |
|
| 73 |
</div> |
| 74 |
|
| 75 |
<?php |
| 76 |
endforeach; |
| 77 |
?> |
| 78 |
|
| 79 |
<p> |
| 80 |
<input type="button" id="ayg-generate-shortcode" class="button-primary" value="<?php esc_attr_e( 'Generate Shortcode', 'automatic-youtube-gallery' ); ?>" /> |
| 81 |
</p> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
</div> |
| 85 |
|
| 86 |
<!-- Notes --> |
| 87 |
<div class="ayg-right-col"> |
| 88 |
<div class="ayg-col-content"> |
| 89 |
<p class="about-description"><?php esc_html_e( '"Automatic YouTube Gallery" provides several methods to build your gallery. Choose one of the following methods best suited for you,', 'automatic-youtube-gallery' ); ?></p> |
| 90 |
<p><span class="dashicons dashicons-arrow-left-alt"></span> <?php esc_html_e( 'Use the shortcode builder in this page to build your gallery shortcode, then add it in your POST/PAGE.', 'automatic-youtube-gallery' ); ?></p> |
| 91 |
<p>2. <?php printf( __( 'Use our "Automatic YouTube Gallery" <a href="%s" target="_blank">Gutenberg block</a> to build the gallery directly in your POST/PAGE.', 'automatic-youtube-gallery' ), 'https://plugins360.com/automatic-youtube-gallery/building-youtube-gallery-using-gutenberg/' ); ?></p> |
| 92 |
<p>3. <?php esc_html_e( 'Use our "Automatic YouTube Gallery" widget to add the gallery in your website sidebars. This is a PRO feature.', 'automatic-youtube-gallery' ); ?></p> |
| 93 |
</div> |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
|
| 97 |
<!-- Shortcode Modal --> |
| 98 |
<div id="ayg-shortcode-modal" class="ayg-modal" style="display: none;"> |
| 99 |
<div class="ayg-modal-bg"></div> |
| 100 |
<div class="ayg-modal-content"> |
| 101 |
<div class="ayg-modal-body"> |
| 102 |
<span class="ayg-modal-close">×</span> |
| 103 |
|
| 104 |
<p class="ayg-modal-title"><?php esc_html_e( 'Congrats! copy the shortcode below and paste it in your POST/PAGE where you need the gallery,', 'automatic-youtube-gallery' ); ?></p> |
| 105 |
<textarea id="aiovg-shortcode" class="widefat code" autofocus="autofocus" onfocus="this.select()"></textarea> |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
</div> |
| 109 |
|