<?php
/**
 * Customizer controls - Deprecated.
 *
 * @since 3.6.0
 */

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

if ( ! class_exists( 'OceanWP_Customizer_Color_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Color_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Dimensions_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Dimensions_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Dropdown_Pages' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Dropdown_Pages extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Heading_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Heading_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Icon_Select_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Icon_Select_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Icon_Select_Multi_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Icon_Select_Multi_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Info_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Info_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customize_Multiple_Select_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customize_Multiple_Select_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Slider_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Slider_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Sortable_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Sortable_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Text_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Text_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Textarea_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Textarea_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Typo_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Typo_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Typography_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Typography_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Upsell_Section_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Upsell_Section_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Range_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Range_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Buttonset_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Buttonset_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Radio_Image_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Radio_Image_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

if ( ! class_exists( 'OceanWP_Customizer_Radio_Image_Control' ) ) {
	/**
	 *  Control
	 */
	class OceanWP_Customizer_Radio_Image_Control extends WP_Customize_Control { // phpcs:ignore
		/**
		 * Render content.
		 */
		public function render_content() {}
	}
}

/**
 * It will be removed soon.
 * Added only for backward comptibility.
 */
if ( ! function_exists( 'ow_esc_attr' ) ) {
	function ow_esc_attr( $text ) {
		if ( is_array( $text ) || is_object( $text ) ) {
			$text = is_string( current( $text ) ) ? current( $text ) : '';
		} elseif ( ! is_string( $text ) ) {
			$text = (string) $text;
		}

		return esc_attr( $text );
	}
}

if ( ! function_exists('oceanwp_customizer_layout') ) {
	function oceanwp_customizer_layout() {
		$layouts = array();
		return $layouts;
	}
}

function oceanwp_customizer_helpers( $return = NULL ) {

	// Return library templates array
	if ( 'library' == $return ) {
		$templates     = array( '&mdash; '. esc_html__( 'Select', 'oceanwp' ) .' &mdash;' );
		$get_templates = get_posts( array( 'post_type' => 'oceanwp_library', 'numberposts' => -1, 'post_status' => 'publish' ) );

		if ( ! empty ( $get_templates ) ) {
			foreach ( $get_templates as $template ) {
				$templates[ $template->ID ] = $template->post_title;
			}
		}

		return $templates;
	}
}
