<?php

/*-----------------------------------------------------------------------------------*/
/* BUILD AN ARRAY WITH OPTIONS FOR JQUERY
/*-----------------------------------------------------------------------------------*/


defined( 'ABSPATH' ) || exit;

if ( !class_exists( 'KkGetOptions' ) ) {

	class KkGetOptions {

		private static $data_ = array();

		public static function TplConditions() {
			return self::$data_;
		}
		
		public static function init() {
			
			// NO RIGHT CLICK
			self::$data_['kk_right_click'] = array(
						'kk_click_check' => get_theme_mod( 'kktfwp_protection', 0 )						
					);

			// SCROLL MONITOR
			self::$data_['scrollMonitor'] = rwmb_meta( 'kk_pauseVid' );			
			
			// ANIMATION BETWEEN PAGES
			self::$data_['kk_page_anim'] = get_theme_mod( 'kktfwp_animation', 1 );
			
			// MENU STYLE
			self::$data_['kk_menu_type'] = get_theme_mod( 'kktfwp_menu_style', 'kk-menu-default' );
			
			// CONTENT STYLE
			self::$data_['kk_content_type'] = get_theme_mod( 'kktfwp_content_width', 'kk-boxed' );
			
			// Ajax Url
			self::$data_['ajax_url'] = esc_url( admin_url( 'admin-ajax.php' ) );
			
			// Proofing nonce
			if ( rwmb_meta( 'kk_proof' ) === 'proofing' ) {
				self::$data_['proofing_nonce'] = wp_create_nonce( 'proof-nonce' );
			}
			
			// 404 page error
			$error_bg = get_theme_mod( 'kktfwp_404_image' ); 
			
			if ( !empty($error_bg) ) {	
				$error_bg = wp_get_attachment_image_url( $error_bg, 'kktfwp-xxl' );				
				self::$data_['errorImg'] = esc_url( $error_bg );			
			}
			
			return self::$data_;
		}
	}
}