<?php
/**
 *
 * WARNING: DO NOT edit this file under any circumstances.
 *
 * Renders custom section seperator control type for WP Customizer.
 *
 * @package CR_Login_Page_UI_Customizer
 * @author Aniket Ashtikar
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class CRLPUIC_Section_Separator_Control renders custom seperator control type.
 *
 * @since 1.0.0
 */
class CRLPUIC_Section_Separator_Control extends WP_Customize_Control {

	/**
	 * The type of customize control being rendered.
	 *
	 * @access public
	 * @since  1.0.0
	 * @var    string
	 */
	public $type = 'crlpuic_section_separator_control';

	/**
	 * Add our JavaScript and CSS to the Customizer.
	 *
	 * @access public
	 * @since  1.0.0
	 * @return void
	 */
	public function enqueue() {

		parent::enqueue();

		wp_enqueue_script( 'crlpuic-login-customizer-controls' );

	}

	/**
	 * Don't render the content via PHP.  This control is handled with a JS template.
	 *
	 * @since  1.0.0
	 */
	protected function render_content() {}

	/**
	 * An Underscore (JS) template for this control's content.
	 *
	 * Class variables for this control class are available in the `data` JS object;
	 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
	 *
	 * @see    WP_Customize_Control::print_template()
	 *
	 * @access protected
	 * @since  1.0.0
	 * @return void
	 */
	protected function content_template() {
		?>
		<# if ( data.label ) { #>
			<div class="crlpuic-section-separator">
				<span class="crlpuic-section-title customize-control-title">{{{ data.label }}}</span>

				<# if ( data.description ) { #>
					<span class="description customize-control-description">{{{ data.description }}}</span>
				<# } #>
			</div>
		<# } #>	
		<?php
	}
}
