group-compat.php
8 years ago
group-extra.php
8 years ago
group-fields.php
8 years ago
group-form.php
8 years ago
group-query.php
8 years ago
group-slideshow.php
7 years ago
group-style.php
8 years ago
option-background.php
8 years ago
option-boilerplate.php
9 years ago
option-category.php
8 years ago
option-classes.php
8 years ago
option-client-section.php
7 years ago
option-color.php
8 years ago
option-content.php
7 years ago
option-divi.php
8 years ago
option-form-ajax.php
9 years ago
option-form-category.php
8 years ago
option-id.php
8 years ago
option-layout.php
8 years ago
option-limit.php
8 years ago
option-order.php
8 years ago
option-pagination.php
8 years ago
option-read-more-page.php
8 years ago
option-select.php
8 years ago
option-slideshow-behavior.php
8 years ago
option-slideshow-breakpoints.php
7 years ago
option-slideshow-navigation.php
7 years ago
option-slideshow-num.php
7 years ago
option-slideshow-transition.php
7 years ago
option-slideshow-type.php
7 years ago
option-template-list.php
8 years ago
option-thumbnail.php
8 years ago
option-title.php
8 years ago
template-input.php
8 years ago
template-not-found.php
8 years ago
template-options.php
8 years ago
view-mode.php
8 years ago
view-name.php
9 years ago
view-shortcode.php
8 years ago
template-options.php
79 lines
| 1 | <?php /* translators: On the Views admin screen. */ ?> |
| 2 | <div class="template-description"> |
| 3 | <p> |
| 4 | <?php |
| 5 | if ( isset( $template['config']['description'] ) && $template['config']['description'] ) { |
| 6 | echo $template['config']['description']; |
| 7 | } |
| 8 | else { |
| 9 | _e( 'no description', 'strong-testimonials' ); |
| 10 | } |
| 11 | ?> |
| 12 | </p> |
| 13 | <div class="options"> |
| 14 | <div> |
| 15 | <?php if ( ! isset( $template['config']['options'] ) || ! is_array( $template['config']['options'] ) ) : ?> |
| 16 | <span><?php _e( 'No options', 'strong-testimonials' ); ?></span> |
| 17 | <?php else : ?> |
| 18 | <span><?php _e( 'Options', 'strong-testimonials' ); ?></span> |
| 19 | |
| 20 | <?php foreach ( $template['config']['options'] as $option ) : ?> |
| 21 | <span> |
| 22 | <?php |
| 23 | $name = sprintf( 'view[data][template_settings][%s][%s]', $key, $option->name ); |
| 24 | $id = $key . '-' . $option->name; |
| 25 | switch ( $option->type ) { |
| 26 | case 'select': |
| 27 | // Get default if not set |
| 28 | if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) { |
| 29 | $view['template_settings'][ $key ][ $option->name ] = $option->default; |
| 30 | } |
| 31 | |
| 32 | if ( $option->label ) { |
| 33 | printf( '<label for="%s">%s</label>', $id, $option->label ); |
| 34 | } |
| 35 | |
| 36 | printf( '<select id="%s" name="%s">', $id, $name ); |
| 37 | |
| 38 | foreach ( $option->values as $value ) { |
| 39 | $selected = selected( $value->value, $view['template_settings'][ $key ][ $option->name ], false ); |
| 40 | printf( '<option value="%s" %s>%s</option>', $value->value, $selected, $value->description ); |
| 41 | } |
| 42 | |
| 43 | echo '</select>'; |
| 44 | break; |
| 45 | |
| 46 | case 'radio': |
| 47 | if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) { |
| 48 | $view['template_settings'][ $key ][ $option->name ] = $option->default; |
| 49 | } |
| 50 | |
| 51 | foreach ( $option->values as $value ) { |
| 52 | $checked = checked( $value->value, $view['template_settings'][ $key ][ $option->name ], false ); |
| 53 | printf( '<input type="radio" id="%s" name="%s" value="%s" %s>', $id, $name, $value->value, $checked ); |
| 54 | printf( '<label for="%s">%s</label>', $id, $value->description ); |
| 55 | } |
| 56 | break; |
| 57 | |
| 58 | case 'checkbox': |
| 59 | /** This breaks checkboxes: */ |
| 60 | //if ( ! isset( $view['template_settings'][ $option->name ] ) ) { |
| 61 | // $view['template_settings'][ $option->name ] = $option->default; |
| 62 | //} |
| 63 | |
| 64 | $checked = checked( true, $view['template_settings'][ $key ][ $option->name ], false ); |
| 65 | printf( '<input type="checkbox" id="%s" name="%s" value="1" %s>', $id, $name, $checked ); |
| 66 | printf( '<label for="%s">%s</label>', $id, $option->label ); |
| 67 | break; |
| 68 | |
| 69 | default: |
| 70 | } |
| 71 | ?> |
| 72 | </span> |
| 73 | <?php endforeach; ?> |
| 74 | |
| 75 | <?php endif; ?> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 |