ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

class-kirki-panels-expanded-panel.php (1849B)


      1 <?php
      2 /**
      3  * An expanded panel.
      4  *
      5  * @package     Kirki
      6  * @subpackage  Controls
      7  * @copyright   Copyright (c) 2016, Aristeides Stathopoulos
      8  * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
      9  * @since       2.2.0
     10  */
     11 
     12 if ( ! class_exists( 'Kirki_Panels_Expanded_Panel' ) ) {
     13 
     14 	/**
     15 	 * Expanded Panel.
     16 	 */
     17 	class Kirki_Panels_Expanded_Panel extends WP_Customize_Panel {
     18 
     19 		/**
     20 		 * The panel type.
     21 		 *
     22 		 * @access public
     23 		 * @var string
     24 		 */
     25 		public $type = 'kirki-expanded';
     26 
     27 		/**
     28 		 * An Underscore (JS) template for rendering this panel's container.
     29 		 * Class variables for this panel class are available in the `data` JS object;
     30 		 * export custom variables by overriding WP_Customize_Panel::json().
     31 		 *
     32 		 * @see WP_Customize_Panel::print_template()
     33 		 * @access protected
     34 		 */
     35 		protected function render_template() {
     36 			?>
     37 			<li id="accordion-panel-{{ data.id }}" class="control-section control-panel control-panel-{{ data.type }}">
     38 				<ul class="accordion-sub-container control-panel-content"></ul>
     39 			</li>
     40 			<?php
     41 		}
     42 
     43 		/**
     44 		 * An Underscore (JS) template for this panel's content (but not its container).
     45 		 * Class variables for this panel class are available in the `data` JS object;
     46 		 * export custom variables by overriding WP_Customize_Panel::json().
     47 		 *
     48 		 * @see WP_Customize_Panel::print_template()
     49 		 * @access protected
     50 		 */
     51 		protected function content_template() {
     52 			?>
     53 			<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
     54 				<div class="accordion-section-title">
     55 					<strong class="panel-title">{{ data.title }}</strong>
     56 				</div>
     57 				<# if ( data.description ) { #>
     58 					<div class="description customize-panel-description">
     59 						{{{ data.description }}}
     60 					</div>
     61 				<# } #>
     62 			</li>
     63 			<?php
     64 		}
     65 	}
     66 }