everest-forms
/
addons
/
StyleCustomizer
/
includes
/
customize
/
class-evf-customize-templates-section.php
class-evf-customize-background-image-control.php
1 year ago
class-evf-customize-color-control.php
1 year ago
class-evf-customize-color-palette-control.php
1 year ago
class-evf-customize-dimension-control.php
1 year ago
class-evf-customize-image-checkbox-control.php
1 year ago
class-evf-customize-image-radio-control.php
1 year ago
class-evf-customize-select2-control.php
1 year ago
class-evf-customize-slider-control.php
1 year ago
class-evf-customize-templates-section.php
1 year ago
class-evf-customize-toggle-control.php
1 year ago
class-evf-customize-templates-section.php
73 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Customize API: EVF_Customize_Templates_Section class |
| 4 | * |
| 5 | * @package EverestForms_Style_Customizer\Customize |
| 6 | * @since 1.0.0 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | /** |
| 12 | * Customize Templates Section class. |
| 13 | * |
| 14 | * A UI container for form templates controls, which are displayed within sections. |
| 15 | * |
| 16 | * @see WP_Customize_Section |
| 17 | */ |
| 18 | class EVF_Customize_Templates_Section extends WP_Customize_Section { |
| 19 | |
| 20 | /** |
| 21 | * Section Type. |
| 22 | * |
| 23 | * @var string |
| 24 | */ |
| 25 | public $type = 'evf-templates'; |
| 26 | |
| 27 | /** |
| 28 | * An Underscore (JS) template for rendering this panel's container. |
| 29 | * |
| 30 | * The templates panel renders a custom section heading with the current template and a switch template button. |
| 31 | * |
| 32 | * @see WP_Customize_Panel::print_template() |
| 33 | * |
| 34 | * @since 4.9.0 |
| 35 | */ |
| 36 | protected function render_template() { |
| 37 | ?> |
| 38 | <li id="accordion-section-{{ data.id }}" class="accordion-section control-section-evf-templates"> |
| 39 | <h3 class="accordion-section-title"> |
| 40 | <span class="customize-action"><?php esc_html_e( 'Active template', 'everest-forms' ); ?></span> <span class="customize-template-name">{{ data.title }}</span> |
| 41 | |
| 42 | <?php if ( current_user_can( 'manage_everest_forms' ) ) : ?> |
| 43 | <button type="button" class="button change-template" aria-label="<?php esc_attr_e( 'Change template', 'everest-forms' ); ?>"><?php echo esc_html_x( 'Change', 'template', 'everest-forms' ); ?></button> |
| 44 | <?php endif; ?> |
| 45 | </h3> |
| 46 | <ul class="accordion-section-content"> |
| 47 | <li class="customize-section-description-container section-meta <# if ( data.description ) { #>customize-info<# } #>"> |
| 48 | <div class="customize-section-title"> |
| 49 | <button class="customize-section-back" tabindex="-1"> |
| 50 | <span class="screen-reader-text"><?php echo esc_html_e( 'Back', 'everest-forms' ); ?></span> |
| 51 | </button> |
| 52 | <h3> |
| 53 | <span class="customize-action"> |
| 54 | <?php esc_html_e( 'You are browsing', 'everest-forms' ); ?> |
| 55 | </span> |
| 56 | <?php esc_html_e( 'Templates', 'everest-forms' ); ?> |
| 57 | </h3> |
| 58 | <# if ( data.description ) { #> |
| 59 | <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Help', 'everest-forms' ); ?></span></button> |
| 60 | <div class="description customize-section-description"> |
| 61 | {{{ data.description }}} |
| 62 | </div> |
| 63 | <# } #> |
| 64 | |
| 65 | <div class="customize-control-notifications-container"></div> |
| 66 | </div> |
| 67 | </li> |
| 68 | </ul> |
| 69 | </li> |
| 70 | <?php |
| 71 | } |
| 72 | } |
| 73 |