<?php


/**


 * WNagish Express functions


 *


 * @package WNEPRO


 */





/**


 * Get WAH addons


 *


 * @return array addons


 */


function get_wah_global_addons() {


	$global_addons = array();


	return apply_filters( 'wah_global_addons', $global_addons );


}


/**


 * WNEPRO get_exclude_pages


 *


 * @return object WP_Query object


 */


function wnexpress_get_exclude_pages() {


	global $post;


	$post_type      = 'any';


	$posts_per_page = -1;


	$args           = array(


		'post_type'      => $post_type,


		'posts_per_page' => $posts_per_page,


	);


	$items          = new WP_Query( $args );


	$options        = array();


	while ( $items->have_posts() ) :


		$items->the_post();


			$options[ $post->ID ] = get_the_title( $post->ID );


	endwhile;


	wp_reset_postdata();





	return $options;


}


/**


 * Remote_get_wah_addons_pricelist


 *


 * @return array response


 */


function remote_get_wah_addons_pricelist() {


	$response = wp_remote_get(


		esc_url_raw( 'https://accessibility-helper.co.il/?pricelist' ),


		array(


			'timeout' => 120,


			'headers' => array(


				'Content-Type' => 'application/json',


			),


		)


	);


	if ( is_wp_error( $response ) ) {


		return false;


	}





	$body = wp_remote_retrieve_body( $response );


	$data = json_decode( $body );


	return $data;


}


/**


 * Get page number


 *


 * @return int page number


 */


function wag_get_page_number() {


	if ( get_query_var( 'page' ) ) {


		$paged = get_query_var( 'page' );


	} elseif ( ! empty( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ) {


		$paged = (int) $_GET['paged'];


	} else {


		$paged = 1;


	}


	return $paged;


}


/**


 * Types limitation


 *


 * @return array allow types


 */


function wah_get_allowed_types() {


	$allow_types = array( 'attachment' );


	return $allow_types;


}


/**


 * Posts counter


 *


 * @param  string $type   string type.


 * @param  string $status status.


 *


 * @return [type]         [description]


 */


function wah_get_posts_counter( $type, $status = null ) {


	if ( in_array( $type, wah_get_allowed_types(), true ) ) {


		if ( empty( $status ) || ! is_array( $status ) ) {


			$status = array( 'publish', 'inherit' );


		}


		$post_counter = 0;


		$count_posts  = wp_count_posts( $type );


		if ( isset( $count_posts ) ) {


			foreach ( $status as $st ) {


				$post_counter = $post_counter + $count_posts->{ sanitize_text_field( $st ) };


			}


		}


		return $post_counter;


	}


}


/**


 * Pagination


 *


 * @param  string  $type           type.


 * @param  integer $posts_per_page number.


 */


function get_pagination( $type, $posts_per_page = 10 ) {


	if ( in_array( $type, wah_get_allowed_types(), true ) ) {


		$post_counter    = wah_get_posts_counter( 'attachment', array( 'inherit' ) );


		$current_page    = wag_get_page_number();


		$number_of_pages = $post_counter / $posts_per_page;


		$this_url        = "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";


		$output[]        = '<ul class="admin_page_pagination">';


		if ( 1 != $current_page && ceil( $number_of_pages ) > 1 ) {


			$prev_page = add_query_arg( 'paged', ( $current_page - 1 ), sanitize_text_field( $this_url ) );


			$output[]  = "<li class='item prev_page'><a href='$prev_page'><i>&#10094;&#10094;</i></a></li>";


		}


		for ( $i = 1; $i <= ceil( $number_of_pages ); $i++ ) {


			$new_url       = add_query_arg( 'paged', $i, sanitize_text_field( $this_url ) );


			$current_class = '';


			if ( $current_page === $i ) {


				$current_class = 'current';


			}


			$output[] = "<li class='item " . esc_html( $current_class ) . "'><a href='$new_url'>$i</a></li>";


		}


		if ( ceil( $number_of_pages ) !== $current_page ) {


			$next_page = add_query_arg( 'paged', ( $current_page + 1 ), sanitize_text_field( $this_url ) );


			$prev_page = add_query_arg( 'paged', ( $current_page + 1 ), sanitize_text_field( $this_url ) );


			$output[]  = "<li class='item next_page'><a href='$next_page'><i>&#10095;&#10095;</i></a></li>";


		}


		$output[] = '</ul>';


		echo implode( '', $output );


	}


}


/**


 * Get client IP


 *


 * @return string IP address


 */


function wah_get_client_ip() {


	$ipaddress = '';


	if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['HTTP_CLIENT_IP'] ), FILTER_VALIDATE_URL );


	} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ), FILTER_VALIDATE_URL );


	} elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['HTTP_X_FORWARDED'] ), FILTER_VALIDATE_URL );


	} elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['HTTP_FORWARDED_FOR'] ), FILTER_VALIDATE_URL );


	} elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['HTTP_FORWARDED'] ), FILTER_VALIDATE_URL );


	} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {


		$ipaddress = filter_input( INPUT_SERVER, wp_unslash( $_SERVER['REMOTE_ADDR'] ), FILTER_VALIDATE_URL );


	} else {


		$ipaddress = 'UNKNOWN';


	}


	return $ipaddress;


}


/**


 * Collect clients data


 */


function stats_collector() {


	$params['add_activation']   = true;


	$params['site_name']        = rawurlencode( get_bloginfo( 'name' ) );


	$params['site_url']         = rawurlencode( get_bloginfo( 'url' ) );


	$params['site_admin_email'] = rawurlencode( get_bloginfo( 'admin_email' ) );


	$params['site_wp_version']  = rawurlencode( get_bloginfo( 'version' ) );


	$params['site_language']    = rawurlencode( get_bloginfo( 'language' ) );


	$params['site_theme_name']  = rawurlencode( wp_get_theme() );


	$params['ip']               = rawurlencode( wah_get_client_ip() );


	//send_data_to_server( $params );


}


/**


 * Send data to server


 *


 * @param  array $params params.


 */


function send_data_to_server( $params ) {


	$api_url = 'http://volkov.co.il';


	$api_url = add_query_arg( $params, $api_url );


	$ch      = curl_init();


	curl_setopt( $ch, CURLOPT_URL, $api_url );


	curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );


	curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );


	$result = curl_exec( $ch );


	curl_close( $ch );


	echo '<h3>' . esc_html__( 'Thanks!', 'wp-nagish-express' ) . '</h3>';


	die();


}


/**


 * Get admin widgets list


 *


 * @return array widgets list array


 */


function wah_get_admin_widgets_list() {


	$wne_keyboard_navigation_setup = wah_get_param( 'wne_keyboard_navigation_setup' );


	$wne_readable_fonts_setup      = wah_get_param( 'wne_readable_fonts_setup' );


	$contrast_setup                = 1;


	$underline_links_setup         = 1;


	$wne_highlight_links_enable    = 1;


	$wne_greyscale_enable          = 1;


	$wne_invert_enable             = 1;


	$wne_remove_animations_setup   = 1;


	$remove_styles_setup           = wah_get_param( 'wne_remove_styles_setup' );


	$wne_lights_off_setup          = wah_get_param( 'wne_lights_off_setup' );


	$wah_highlight_titles_setup    = wah_get_param( 'wah_highlight_titles_setup' );


	$wne_image_alt_setup           = 1;





	$wah_enable_terms_link = wah_get_param( 'wah_enable_terms_link' );


	$wah_custom_link_title = wah_get_param( 'wah_custom_link_title' );


	$wah_custom_link_url   = wah_get_param( 'wah_custom_link_url' );


	$wah_custom_link       = false;


	if ( $wah_enable_terms_link && $wah_custom_link_title && $wah_custom_link_url ) {


		$wah_custom_link = true;


	}





	$wah_enable_large_mouse_cursor = wah_get_param( 'wah_enable_large_mouse_cursor' );


	$wne_enable_monochrome_mode    = 1;


	$wne_enable_sepia_mode         = 1;





	$wah_enable_inspector_mode = 1;





	$wah_set_layout_setup = wah_get_param( 'wah_set_layout_setup' );





	$wne_enable_letter_spacing_mode = wah_get_param( 'wne_enable_letter_spacing_mode' );





	$wah_enable_adhd        = 1;


	$wne_enable_cd_profile  = 1;


	$wne_enable_mute        = 1;


	$wah_text_alignment     = wah_get_param( 'wah_text_alignment' );


	$wne_enable_hide_images = 1;





	$wne_enable_word_spacing = 1;


	$wne_enable_line_height  = 1;





	$widgets_object = array();


	$widgets_object['widget-7']  = array(


		'active' => 1,


		'html'   => __( 'Clear cookies', 'wp-nagish-express' ),


		'class'  => 'active',


	);


	$widgets_object['widget-22'] = array(


		'active' => $wah_enable_adhd,


		'html'   => __( 'ADHD Profile', 'wp-nagish-express' ),


		'class'  => $wah_enable_adhd ? 'active' : 'notactive',


	);


	$widgets_object['widget-28'] = array(


		'active' => $wne_enable_cd_profile,


		'html'   => __( 'Cognitive Disability Profile', 'wp-nagish-express' ),


		'class'  => $wne_enable_cd_profile ? 'active' : 'notactive',


	);


	$widgets_object['widget-2']  = array(


		'active' => $wne_keyboard_navigation_setup,


		'html'   => __( 'Keyboard navigation', 'wp-nagish-express' ),


		'class'  => $wne_keyboard_navigation_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-1']  = array(


		'active' => 1,


		'html'   => __( 'Font resize', 'wp-nagish-express' ),


		'class'  => 'active',


	);


	


	$widgets_object['widget-3']  = array(


		'active' => $wne_readable_fonts_setup,


		'html'   => __( 'Readable Font', 'wp-nagish-express' ),


		'class'  => $wne_readable_fonts_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-4']  = array(


		'active' => $contrast_setup,


		'html'   => __( 'Contrast', 'wp-nagish-express' ),


		'class'  => $contrast_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-5']  = array(


		'active' => $underline_links_setup,


		'html'   => __( 'Underline links', 'wp-nagish-express' ),


		'class'  => $underline_links_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-6']  = array(


		'active' => $wne_highlight_links_enable,


		'html'   => __( 'Highlight links', 'wp-nagish-express' ),


		'class'  => $wne_highlight_links_enable ? 'active' : 'notactive',


	);


	


	$widgets_object['widget-8']  = array(


		'active' => $wne_greyscale_enable,


		'html'   => __( 'Image Greyscale', 'wp-nagish-express' ),


		'class'  => $wne_greyscale_enable ? 'active' : 'notactive',


	);


	$widgets_object['widget-9']  = array(


		'active' => $wne_invert_enable,


		'html'   => __( 'Invert colors', 'wp-nagish-express' ),


		'class'  => $wne_invert_enable ? 'active' : 'notactive',


	);


	$widgets_object['widget-10'] = array(


		'active' => $wne_remove_animations_setup,


		'html'   => __( 'Remove Animations', 'wp-nagish-express' ),


		'class'  => $wne_remove_animations_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-11'] = array(


		'active' => $remove_styles_setup,


		'html'   => __( 'Remove styles', 'wp-nagish-express' ),


		'class'  => $remove_styles_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-12'] = array(


		'active' => $wne_lights_off_setup,


		'html'   => __( 'Lights Off', 'wp-nagish-express' ),


		'class'  => $wne_lights_off_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-13'] = array(


		'active' => $wah_highlight_titles_setup,


		'html'   => __( 'Highlight titles', 'wp-nagish-express' ),


		'class'  => $wah_highlight_titles_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-14'] = array(


		'active' => $wne_image_alt_setup,


		'html'   => __( 'Image description', 'wp-nagish-express' ),


		'class'  => $wne_image_alt_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-15'] = array(


		'active' => $wah_custom_link,


		'html'   => __( 'Custom link/button', 'wp-nagish-express' ),


		'class'  => $wah_custom_link ? 'active' : 'notactive',


	);


	$widgets_object['widget-16'] = array(


		'active' => $wah_enable_large_mouse_cursor,


		'html'   => __( 'Large mouse cursor', 'wp-nagish-express' ),


		'class'  => $wah_enable_large_mouse_cursor ? 'active' : 'notactive',


	);


	$widgets_object['widget-17'] = array(


		'active' => $wne_enable_monochrome_mode,


		'html'   => __( 'Monochrome', 'wp-nagish-express' ),


		'class'  => $wne_enable_monochrome_mode ? 'active' : 'notactive',


	);


	$widgets_object['widget-18'] = array(


		'active' => $wne_enable_sepia_mode,


		'html'   => __( 'Sepia', 'wp-nagish-express' ),


		'class'  => $wne_enable_sepia_mode ? 'active' : 'notactive',


	);


	$widgets_object['widget-19'] = array(


		'active' => $wah_enable_inspector_mode,


		'html'   => __( 'Table Content', 'wp-nagish-express' ),


		'class'  => $wah_enable_inspector_mode ? 'active' : 'notactive',


	);


	$widgets_object['widget-20'] = array(


		'active' => $wah_set_layout_setup,


		'html'   => __( 'Select Theme', 'wp-nagish-express' ),


		'class'  => $wah_set_layout_setup ? 'active' : 'notactive',


	);


	$widgets_object['widget-21'] = array(


		'active' => $wne_enable_letter_spacing_mode,


		'html'   => __( 'Letter spacing', 'wp-nagish-express' ),


		'class'  => $wne_enable_letter_spacing_mode ? 'active' : 'notactive',


	);


	


	$widgets_object['widget-23'] = array(


		'active' => $wah_text_alignment,


		'html'   => __( 'Text Alignment', 'wp-nagish-express' ),


		'class'  => $wah_text_alignment ? 'active' : 'notactive',


	);


	$widgets_object['widget-24'] = array(


		'active' => $wne_enable_mute,


		'html'   => __( 'MUTE volume', 'wp-nagish-express' ),


		'class'  => $wne_enable_mute ? 'active' : 'notactive',


	);


	$widgets_object['widget-25'] = array(


		'active' => $wne_enable_hide_images,


		'html'   => __( 'Hide images', 'wp-nagish-express' ),


		'class'  => $wne_enable_hide_images ? 'active' : 'notactive',


	);


	$widgets_object['widget-26'] = array(


		'active' => $wne_enable_word_spacing,


		'html'   => __( 'Word spacing', 'wp-nagish-express' ),


		'class'  => $wne_enable_word_spacing ? 'active' : 'notactive',


	);


	$widgets_object['widget-27'] = array(


		'active' => $wne_enable_line_height,


		'html'   => __( 'Line height', 'wp-nagish-express' ),


		'class'  => $wne_enable_line_height ? 'active' : 'notactive',


	);


	





	$wah_widgets_order = wah_get_param( 'wne_sidebar_widgets_order' );





	


		if ( ! $wah_widgets_order ) {


		//return $widgets_object;


	} else {


		$wah_serialize_widgets = unserialize( $wah_widgets_order );


		$sorted_widgets_object = array();


		foreach ( $wah_serialize_widgets as $id => $array ) {


			$sorted_widgets_object[ $id ] = array(


				'active' => $array['active'],


				'html'   => $array['html'],


				'class'  => $array['class'],


			);


		}





		//return $sorted_widgets_object;


	}


	


}


/**


 * Get widgets status


 *


 * @return array widgets status list


 */


function wah_get_widgets_status() {


	$widgets_status                                  = array();


	$widgets_status['wne_keyboard_navigation_setup'] = wah_get_param( 'wne_keyboard_navigation_setup' );


	$widgets_status['wne_readable_fonts_setup']      = wah_get_param( 'wne_readable_fonts_setup' );


	$widgets_status['contrast_setup']                = 1;


	$widgets_status['underline_links_setup']         = 1;


	$widgets_status['wne_highlight_links_enable']    = 1;


	$widgets_status['wne_greyscale_enable']          = 1;


	$widgets_status['wne_invert_enable']             = 1;


	$widgets_status['wne_remove_animations_setup']   = 1;


	$widgets_status['remove_styles_setup']           = wah_get_param( 'wne_remove_styles_setup' );


	$widgets_status['wne_lights_off_setup']          = wah_get_param( 'wne_lights_off_setup' );


	$widgets_status['wah_highlight_titles_setup']    = wah_get_param( 'wah_highlight_titles_setup' );


	$widgets_status['wne_image_alt_setup']           = 1;





	$wah_enable_terms_link = wah_get_param( 'wah_enable_terms_link' );


	$wah_custom_link_title = wah_get_param( 'wah_custom_link_title' );


	$wah_custom_link_url   = wah_get_param( 'wah_custom_link_url' );


	$wah_custom_link       = false;


	if ( $wah_enable_terms_link && $wah_custom_link_title && $wah_custom_link_url ) {


		$wah_custom_link = true;


	}


	$widgets_status['wah_enable_terms_link'] = $wah_custom_link;





	$widgets_status['wah_enable_large_mouse_cursor']  = 1;


	$widgets_status['wne_enable_monochrome_mode']     = 1;


	$widgets_status['wne_enable_sepia_mode']          = 1;


	$widgets_status['wah_enable_inspector_mode']      = 1;


	$widgets_status['wah_set_layout_setup']           = wah_get_param( 'wah_set_layout_setup' );


	$widgets_status['wne_enable_letter_spacing_mode'] = 1;


	$widgets_status['wah_enable_adhd']                = wah_get_param( 'wah_enable_adhd' );


	$widgets_status['wne_enable_cd_profile']          = 1;


	$widgets_status['wne_enable_mute']                = 1;


	$widgets_status['wah_text_alignment']             = 1;


	$widgets_status['wne_enable_hide_images']         = 1;


	$widgets_status['wne_enable_word_spacing']        = 1;


	$widgets_status['wne_enable_line_height']         = 1;





	return $widgets_status;


}


/**


 * Update serialize array of ordered widgets


 */


function update_serialize_order_array() {


	$widgets_object        = array();


	$widgets_status        = wah_get_widgets_status();


	$wah_serialize_widgets = wah_get_param( 'wne_sidebar_widgets_order' );


	if ( ! $wah_serialize_widgets ) {


		$widgets_object['widget-1']  = array(


			'active' => 1,


			'html'   => __( 'Font resize', 'wp-nagish-express' ),


			'class'  => 'active',


		);


		$widgets_object['widget-2']  = array(


			'active' => $widgets_status['wne_keyboard_navigation_setup'],


			'html'   => __( 'Keyboard navigation', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_keyboard_navigation_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-3']  = array(


			'active' => $widgets_status['wne_readable_fonts_setup'],


			'html'   => __( 'Readable Font', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_readable_fonts_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-4']  = array(


			'active' => $widgets_status['contrast_setup'],


			'html'   => __( 'Contrast', 'wp-nagish-express' ),


			'class'  => $widgets_status['contrast_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-5']  = array(


			'active' => $widgets_status['underline_links_setup'],


			'html'   => __( 'Underline links', 'wp-nagish-express' ),


			'class'  => $widgets_status['underline_links_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-6']  = array(


			'active' => $widgets_status['wne_highlight_links_enable'],


			'html'   => __( 'Highlight links', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_highlight_links_enable'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-7']  = array(


			'active' => 1,


			'html'   => __( 'Clear cookies', 'wp-nagish-express' ),


			'class'  => 'active',


		);


		$widgets_object['widget-8']  = array(


			'active' => $widgets_status['wne_greyscale_enable'],


			'html'   => __( 'Image Greyscale', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_greyscale_enable'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-9']  = array(


			'active' => $widgets_status['wne_invert_enable'],


			'html'   => __( 'Invert colors', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_invert_enable'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-10'] = array(


			'active' => $widgets_status['wne_remove_animations_setup'],


			'html'   => __( 'Remove Animations', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_remove_animations_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-11'] = array(


			'active' => $widgets_status['remove_styles_setup'],


			'html'   => __( 'Remove styles', 'wp-nagish-express' ),


			'class'  => $widgets_status['remove_styles_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-12'] = array(


			'active' => $widgets_status['wne_lights_off_setup'],


			'html'   => __( 'Lights Off', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_lights_off_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-13'] = array(


			'active' => $widgets_status['wah_highlight_titles_setup'],


			'html'   => __( 'Highlight Titles', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_highlight_titles_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-14'] = array(


			'active' => $widgets_status['wne_image_alt_setup'],


			'html'   => __( 'Image description', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_image_alt_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-15'] = array(


			'active' => $widgets_status['wah_enable_terms_link'],


			'html'   => __( 'Custom link/button', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_enable_terms_link'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-16'] = array(


			'active' => $widgets_status['wah_enable_large_mouse_cursor'],


			'html'   => __( 'Large mouse cursor', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_enable_large_mouse_cursor'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-17'] = array(


			'active' => $widgets_status['wne_enable_monochrome_mode'],


			'html'   => __( 'Monochrome', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_monochrome_mode'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-18'] = array(


			'active' => $widgets_status['wne_enable_sepia_mode'],


			'html'   => __( 'Sepia', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_sepia_mode'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-19'] = array(


			'active' => $widgets_status['wah_enable_inspector_mode'],


			'html'   => __( 'Table Content', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_enable_inspector_mode'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-20'] = array(


			'active' => $widgets_status['wah_set_layout_setup'],


			'html'   => __( 'Select Theme', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_set_layout_setup'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-21'] = array(


			'active' => $widgets_status['wne_enable_letter_spacing_mode'],


			'html'   => __( 'Letter spacing', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_letter_spacing_mode'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-22'] = array(


			'active' => $widgets_status['wah_enable_adhd'],


			'html'   => __( 'ADHD Profile', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_enable_adhd'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-23'] = array(


			'active' => $widgets_status['wah_text_alignment'],


			'html'   => __( 'Text alignment', 'wp-nagish-express' ),


			'class'  => $widgets_status['wah_text_alignment'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-24'] = array(


			'active' => $widgets_status['wne_enable_mute'],


			'html'   => __( 'MUTE volume', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_mute'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-25'] = array(


			'active' => $widgets_status['wne_enable_hide_images'],


			'html'   => __( 'Hide images', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_hide_images'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-26'] = array(


			'active' => $widgets_status['wne_enable_word_spacing'],


			'html'   => __( 'Word spacing', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_word_spacing'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-27'] = array(


			'active' => $widgets_status['wne_enable_line_height'],


			'html'   => __( 'Line height', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_line_height'] ? 'active' : 'notactive',


		);


		$widgets_object['widget-28'] = array(


			'active' => $widgets_status['wne_enable_cd_profile'],


			'html'   => __( 'Cognitive Disability Profile', 'wp-nagish-express' ),


			'class'  => $widgets_status['wne_enable_cd_profile'] ? 'active' : 'notactive',


		);





	} else {


		$wah_serialize_widgets = unserialize( $wah_serialize_widgets );


		if ( $wah_serialize_widgets ) {


			foreach ( $wah_serialize_widgets as $serialize_id => $wah_serialize_data ) {


				if ( 'widget-1' === $serialize_id ) {


					$active_status = 1;


					$html          = __( 'Font resize', 'wp-nagish-express' );


				} elseif ( 'widget-2' === $serialize_id ) {


					$active_status = $widgets_status['wne_keyboard_navigation_setup'];


					$html          = __( 'Keyboard navigation', 'wp-nagish-express' );


				} elseif ( 'widget-3' === $serialize_id ) {


					$active_status = $widgets_status['wne_readable_fonts_setup'];


					$html          = __( 'Readable Font', 'wp-nagish-express' );


				} elseif ( 'widget-4' === $serialize_id ) {


					$active_status = $widgets_status['contrast_setup'];


					$html          = __( 'Contrast', 'wp-nagish-express' );


				} elseif ( 'widget-5' === $serialize_id ) {


					$active_status = $widgets_status['underline_links_setup'];


					$html          = __( 'Underline links', 'wp-nagish-express' );


				} elseif ( 'widget-6' === $serialize_id ) {


					$active_status = $widgets_status['wne_highlight_links_enable'];


					$html          = __( 'Highlight links', 'wp-nagish-express' );


				} elseif ( 'widget-7' === $serialize_id ) {


					$active_status = 1;


					$html          = __( 'Clear cookies', 'wp-nagish-express' );


				} elseif ( 'widget-8' === $serialize_id ) {


					$active_status = $widgets_status['wne_greyscale_enable'];


					$html          = __( 'Image Greyscale', 'wp-nagish-express' );


				} elseif ( 'widget-9' === $serialize_id ) {


					$active_status = $widgets_status['wne_invert_enable'];


					$html          = __( 'Invert colors', 'wp-nagish-express' );


				} elseif ( 'widget-10' === $serialize_id ) {


					$active_status = $widgets_status['wne_remove_animations_setup'];


					$html          = __( 'Remove Animations', 'wp-nagish-express' );


				} elseif ( 'widget-11' === $serialize_id ) {


					$active_status = $widgets_status['remove_styles_setup'];


					$html          = __( 'Remove styles', 'wp-nagish-express' );


				} elseif ( 'widget-12' === $serialize_id ) {


					$active_status = $widgets_status['wne_lights_off_setup'];


					$html          = __( 'Lights off', 'wp-nagish-express' );


				} elseif ( 'widget-13' === $serialize_id ) {


					$active_status = $widgets_status['wah_highlight_titles_setup'];


					$html          = __( 'Highlight titles', 'wp-nagish-express' );


				} elseif ( 'widget-14' === $serialize_id ) {


					$active_status = $widgets_status['wne_image_alt_setup'];


					$html          = __( 'Image description', 'wp-nagish-express' );


				} elseif ( 'widget-15' === $serialize_id ) {


					$active_status = $widgets_status['wah_enable_terms_link'];


					$html          = __( 'Custom link/button', 'wp-nagish-express' );


				} elseif ( 'widget-16' === $serialize_id ) {


					$active_status = $widgets_status['wah_enable_large_mouse_cursor'];


					$html          = __( 'Large mouse cursor', 'wp-nagish-express' );


				} elseif ( 'widget-17' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_monochrome_mode'];


					$html          = __( 'Monochrome', 'wp-nagish-express' );


				} elseif ( 'widget-18' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_sepia_mode'];


					$html          = __( 'Sepia', 'wp-nagish-express' );


				} elseif ( 'widget-19' === $serialize_id ) {


					$active_status = $widgets_status['wah_enable_inspector_mode'];


					$html          = __( 'Table Content', 'wp-nagish-express' );


				} elseif ( 'widget-20' === $serialize_id ) {


					$active_status = $widgets_status['wah_set_layout_setup'];


					$html          = __( 'Select Theme', 'wp-nagish-express' );


				} elseif ( 'widget-21' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_letter_spacing_mode'];


					$html          = __( 'Letter spacing', 'wp-nagish-express' );


				} elseif ( 'widget-22' === $serialize_id ) {


					$active_status = $widgets_status['wah_enable_adhd'];


					$html          = __( 'ADHD Profile', 'wp-nagish-express' );


				} elseif ( 'widget-23' === $serialize_id ) {


					$active_status = $widgets_status['wah_text_alignment'];


					$html          = __( 'Text alignment', 'wp-nagish-express' );


				} elseif ( 'widget-24' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_mute'];


					$html          = __( 'Mute volume', 'wp-nagish-express' );


				} elseif ( 'widget-25' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_hide_images'];


					$html          = __( 'Hide images', 'wp-nagish-express' );


				} elseif ( 'widget-26' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_word_spacing'];


					$html          = __( 'Word spacing', 'wp-nagish-express' );


				} elseif ( 'widget-27' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_line_height'];


					$html          = __( 'Line height', 'wp-nagish-express' );


				} elseif ( 'widget-28' === $serialize_id ) {


					$active_status = $widgets_status['wne_enable_cd_profile'];


					$html          = __( 'Cognitive Disability Profile', 'wp-nagish-express' );


				}





				$widgets_object[ $serialize_id ] = array(


					'active' => $active_status,


					'html'   => $html,


					'class'  => $active_status ? 'active' : 'notactive',


				);


			}


		}


	}


	$serialize_data = serialize( $widgets_object );


	update_option( 'wne_sidebar_widgets_order', $serialize_data );


}


/**


 * Render Select element


 *


 * @param  string  $label  label.


 * @param  string  $option option.


 * @param  string  $id     id.


 * @param  array   $custom_select_options custom select options.


 * @param  boolean $select2 true/false.


 */


function render_select_element( $label, $option, $id, $custom_select_options = array(), $select2 = false ) {


	if ( ! $custom_select_options ) {


		$options = array(


			'rem'    => __( 'REM units resize', 'wp-nagish-express' ),


			'zoom'   => __( 'Zoom in/out page', 'wp-nagish-express' ),


			'script' => __( 'Script base resize', 'wp-nagish-express' ),


		);


	} else {


		$options = $custom_select_options;


	}





	?>


	<div class="form_row">


		<div class="form30">


			<label for="<?php echo esc_html( $id ); ?>" class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form70">


			<select name="<?php echo ! $custom_select_options ? esc_html( $id ) : esc_html( $id ) . '[]'; ?>" id="<?php echo esc_html( $id ); ?>"


				<?php if ( $select2 ) : ?>


					multiple="multiple" class="nagishx-admin-select2"


				<?php endif; ?>>


				<?php foreach ( $options as $key => $value ) : ?>


					<option value="<?php echo esc_html( $key ); ?>" data-key="<?php echo esc_html( $key ); ?>"


						<?php if ( $custom_select_options ) : ?>


							<?php if ( wah_get_param( $id ) && in_array( strval( $key ), wah_get_param( $id ), true ) ) : ?>


								selected="selected"<?php endif; ?>


						<?php else : ?>


							<?php if ( $option === $key ) : ?>


								selected="selected"<?php endif; ?>


						<?php endif; ?>>


						<?php echo esc_html( $value ); ?>


					</option>


				<?php endforeach; ?>


			</select>


		</div>


	</div>


	<?php


}


/**


 * Render Switch element


 *


 * @param  string $label         label.


 * @param  string $option        option.


 * @param  string $id            id.


 * @param  string $on            on.


 * @param  string $off           off.


 * @param  string $dependency_id dependency_id.


 */


function render_switch_element( $label, $option, $id, $on = 'On', $off = 'Off', $dependency_id = '' ) {





	?>


	<div class="form_row"


	<?php if ( $dependency_id ) : ?>


		data-depid="<?php echo esc_html( $dependency_id ); ?>"<?php endif; ?>>


		<div class="form30">


			<label for="<?php echo esc_html( $id ); ?>" class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form70">


			<label class="switch">


				<input class="switch-input"  name="<?php echo esc_html( $id ); ?>" id="<?php echo esc_html( $id ); ?>" type="checkbox" value="<?php echo esc_html( $option ); ?>"


					<?php if ( 1 == $option ) : ?>


						checked


					<?php endif; ?> />


				<span class="switch-label" data-on="<?php echo esc_html( $on ); ?>" data-off="<?php echo esc_html( $off ); ?>"></span>


				<span class="switch-handle"></span>


			</label>


		</div>


		<?php 


		if($id == "wah_enable_i18n"){


			?>


			<p><strong>Internationalization.</strong> Load pretranslated plugin settings. Currently supported 4 lanauges: English, Hebrew, Russian, Arabic.</p>


						


						<p><small><strong>*HTML code is NOT allowed</strong></small></p>


			<?php


		}


		?>


		


		<?php 


		if($id == "wah_enable_web_speech"){


			?>


			<p class="wah-small-description">


				<ol>


					<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API" target="_blank">About Web Speech API</a></li>


					<li><a href="https://caniuse.com/#feat=speech-synthesis" target="_blank">Check browsers support</a></li>


					<li>* Only English language supported</li>


				</ol>


			</p>


			<?php


		}


		?>


		


		


	</div>


	<?php


}


function render_switch_element_2( $label, $option, $id, $on = 'On', $off = 'Off', $dependency_id = '' ) {





	if($option==null && $option != 0){


		$option = 1;


	}


	?>


	<div class="form_row"


	<?php if ( $dependency_id ) : ?>


		data-depid="<?php echo esc_html( $dependency_id ); ?>"<?php endif; ?>>


		<div data-depid="wah_enable_i18n">


		<div class="form30">


			<label for="<?php echo esc_html( $id ); ?>" class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form70">


			<label class="switch">


				<input class="switch-input"  name="<?php echo esc_html( $id ); ?>" id="<?php echo esc_html( $id ); ?>" type="checkbox" value="<?php echo esc_html( $option ); ?>"


					<?php if ( 1 == $option ) : ?>


						checked


					<?php endif; ?> />


				<span class="switch-label" data-on="<?php echo esc_html( $on ); ?>" data-off="<?php echo esc_html( $off ); ?>"></span>


				<span class="switch-handle"></span>


			</label>


		</div>


		<?php 


		if($id == "wah_enable_i18n"){


			?>


			<p><strong>Internationalization.</strong> Load pretranslated plugin settings. Currently supported 4 lanauges: English, Hebrew, Russian, Arabic.</p>


						


						<p><small><strong>*HTML code is NOT allowed</strong></small></p>


			<?php


		}


		?>


		


		<?php 


		if($id == "wah_enable_web_speech"){


			?>


			<p class="wah-small-description">


				<ol>


					<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API" target="_blank">About Web Speech API</a></li>


					<li><a href="https://caniuse.com/#feat=speech-synthesis" target="_blank">Check browsers support</a></li>


					<li>* Only English language supported</li>


				</ol>


			</p>


			<?php


		}


		?>


		</div>


		


	</div>


	<?php


}





/**


 * Render Form title element


 *


 * @param  string  $label             label.


 * @param  string  $option            option.


 * @param  string  $id                id.


 * @param  string  $placeholder       placeholder.


 * @param  string  $depid             depid.


 * @param  string  $field_description field_description.


 * @param  boolean $is_textarea       is_textarea.


 * @param  boolean $is_numeric        is_numeric.


 */


function render_title_element( $label, $option, $id, $placeholder = '', $depid = '', $field_description = '', $is_textarea = false, $is_numeric = false ) {


	?>


	<div class="form_row"


	<?php if ( $depid ) : ?>


		data-depid="<?php echo esc_html( $depid ); ?>"<?php endif; ?>>


		<div class="form30">


			<label for="<?php echo esc_html( $id ); ?>" class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form70">


			<?php if ( ! $is_textarea ) : ?>


				<input type="<?php echo $is_numeric ? 'number' : 'text'; ?>" name="<?php echo esc_html( $id ); ?>" id="<?php echo esc_html( $id ); ?>" value="<?php echo esc_html( $option ); ?>" placeholder="<?php echo esc_html( $placeholder ); ?>" />


			<?php else : ?>


				<textarea name="<?php echo esc_html( $id ); ?>" id="<?php echo esc_html( $id ); ?>" rows="6" cols="80" placeholder="<?php echo esc_html( $placeholder ); ?>"><?php echo esc_html( $option ); ?></textarea>


			<?php endif; ?>





			<?php if ( $field_description ) : ?>


				<div class="wah-field-description">


					<?php echo wp_kses_post( $field_description ); ?>


				</div>


			<?php endif; ?>


		</div>


		<?php 


		if($id == "wah_email"){


			?>


			<p class="wah-small-description"><?php esc_html_e( 'Enter email here to attach in footer support title', 'wp-nagish-express' ); ?></p>


			<?php


		}


		?>


	</div>


	<?php


}


/**


 * Render Form wp_edit element


 *


 * @param  string $label   label.


 * @param  string $content content.


 * @param  string $id      id.


 * @param  string $depid   depid.


 */


function render_wp_editor_element( $label, $content, $id, $depid = '' ) {


	?>


	<div class="form_row"


	<?php if ( $depid ) : ?>


		data-depid="<?php echo esc_html( $depid ); ?>"<?php endif; ?>>


		<div class="form30">


			<label for="<?php echo esc_html( $id ); ?>" class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form70">


			<?php


				$editor_id = $id;


				wp_editor( $content, $editor_id );


			?>


		</div>


	</div>


	<?php


}


/**


 * Render Form section tab title


 *


 * @param  string  $label form section title.


 * @param  string  $id form section data-id.


 * @param  boolean $is_active true or false.


 * @param  string  $desc form section title description.


 */


function render_form_section_tab_title( $label, $id, $is_active = false, $desc = '', $icon = '' ) {


	$class = '';


	if ( $is_active ) {


		$class = 'active';


	}


	?>


	<a href="#<?php echo esc_html( $id ); ?>" class="form_element_header <?php echo esc_html( $class ); ?>" data-id="<?php echo esc_html( $id ); ?>" title="<?php echo esc_html( $label ); ?>">


		<?php if ( $icon ) : ?>


			<span class="tab-icon">


				<span class="<?php echo esc_html( $icon ); ?>"></span>


			</span>


		<?php endif; ?>


		<span class="title"><?php echo esc_html( $label ); ?></span>


		<div class="desc">


			<?php echo esc_html( $desc ); ?>


		</div>


	</a>


	<?php


}


/**


 * Render Form section title


 *


 * @param  string $label form section title.


 * @param  string $id form section data-id.


 */


function render_form_section_title( $label, $id ) {


	?>


	<h3 class="form_element_header" data-id="<?php echo esc_html( $id ); ?>">


		<button type="button" title="<?php echo esc_html( $label ); ?>"><?php echo esc_html( $label ); ?></button>


		<span class="toggle-wah-section">


			<span class="dashicons dashicons-arrow-down-alt2"></span>


		</span>


	</h3>


	<?php


}





function render_logo_color_mob($shape_type_mob) {


	


	?>


	<div class="form_row wah-logo-customizer" data-depid="wah_logo_customizer">


	


	<label  class="text_label">


				<span><?php esc_html_e( 'Shape Type(Mobile):', 'wp-nagish-express' ); ?></span>


				


		</label>


		<div class="button-type">


			<div class="button-type-col">


				<input id="sqaure_mob" <?php if($shape_type_mob == "sqaure"){echo "checked='checked'";} ?> type="radio" name="shape_type_mob" value="sqaure" /> <label for="sqaure_mob">Sqaure </label>


			</div>


			<div class="button-type-col">


				<input id="sqaure_corner_mob" <?php if($shape_type_mob == "sqaure_corner"){echo "checked='checked'";} ?> type="radio" name="shape_type_mob" value="sqaure_corner" /> <label for="sqaure_corner_mob">Square( with round cornders )</label>


			</div>


			<div class="button-type-col">


				<input id="half_left_mob" <?php if($shape_type_mob == "half_left"){echo "checked='checked'";} ?> type="radio" name="shape_type_mob" value="half_left" /><label for="half_left_mob">Half Left Circle</label>


			</div>


			<div class="button-type-col">


				<input id="half_right_mob" <?php if($shape_type_mob == "half_right"){echo "checked='checked'";} ?> type="radio" name="shape_type_mob" value="half_right" /><label for="half_right_mob">Half Right Circle</label>


			</div>


			<div class="button-type-col">


				<input id="cricle_mob" <?php if($shape_type_mob == "cricle"){echo "checked='checked'";} ?> type="radio" name="shape_type_mob" value="cricle" /><label for="cricle_mob">Cricle</label>


			</div>


		</div>


		


	</div>


		


	<?php


	


}


function render_logo_color($button_type,$shape_type,$button_image,$wah_logo_color, $wah_icon_color) {


	


	//echo $wah_logo_color."<br>";





	if(empty($wah_icon_color)){


		$wah_icon_color = "#ffffff";


	}


	?>


	<script>


	function colorChanged(){


	  var toread = document.getElementById('button_color');


	  console.log("Red Value - "+parseInt("0x"+toread.value.slice(1,3)));


	}





	


	</script>


	<div class="form_row wah-logo-customizer" data-depid="wah_logo_customizer">


	


		<label class="text_label">


			<span><?php esc_html_e( 'Button BG color:', 'wp-nagish-express' ); ?></span>


		</label>


		<div class="form30">


			<div class="wah-input-color button_color">


				<span></span><input class="color_field" id="button_color"  type="color" name="wah_logo_color" value="<?php echo $wah_logo_color; ?>">


			</div>


			


		</div>


		


		<div class="form70">


			<div class="color-type">


				<select name="color_type">


					<option selected value="solid">Solid</option>


					<option disabled value="gradient">Gradient</option>


				</select>


			</div>


		</div>


	</div>


	<div class="form_row wah-logo-color-customizer" data-depid="wah_logo_customizer">


		<label class="text_label">


			<span><?php esc_html_e( 'Button Icon color:', 'wp-nagish-express' ); ?></span>


		</label>


		<div class="form30">


			<div class="wah-input-color icon_color">


				<span></span><input class="color_field" id="icon_color"  type="color" name="wah_icon_color" value="<?php echo $wah_icon_color; ?>">


			</div>


			


		</div>


	</div>


	<div class="form_row wah-logo-customizer" data-depid="wah_logo_customizer">


		<label  class="text_label">


				<span><?php esc_html_e( 'Button Type:', 'wp-nagish-express' ); ?></span>


				


		</label>


		<style>


		.button-image-icon {


			background: #1D2327;


			width: 50px;


			height: 50px;


			text-align: center;


			display: flex;


			align-items: center;


			justify-content: center;


			border-radius: 100%;


			padding: 10px;


			box-sizing: border-box;


		}


		</style>


		<?php 


			if($shape_type == "sqaure"){


				?>


					<style>


						.button-image-icon{border-radius:0px}


					</style>


				<?php


			}elseif($shape_type == "sqaure_corner"){


				?>


					<style>


						.button-image-icon{border-radius:10px}


					</style>


				<?php


			}elseif($shape_type == "half_left"){


				?>


					<style>


						.button-image-icon{border-radius:80px 0px 0px 80px}


					</style>


				<?php


			}elseif($shape_type == "half_right"){


				?>


					<style>


						.button-image-icon{border-radius:0px 80px 80px 0px}


					</style>


				<?php


			}elseif($shape_type == "cricle"){


				?>


					<style>


						.button-image-icon{border-radius:100%}


					</style>


				<?php


			}else{


				


				?>


				<style>


						.button-image-icon{border-radius:0px}


					</style>


				<?php


			}


			if($button_type == "small"){


				?>


					<style>


						.button-image-icon{width: 30px; height: 30px; padding: 0px;}


					</style>


				<?php


				


			}elseif($button_type == "medium"){


				


				?>


					<style>


						.button-image-icon{width: 50px; height: 50px ; padding: 10px;}


					</style>


				<?php


			}elseif($button_type == "large"){


				?>


					<style>


						.button-image-icon{width: 80px; height: 80px; padding: 20px;}


					</style>


				<?php


				


			}else{


				


			}


			if(!empty($wah_icon_color)){


				?>


				<style>.button-image-icon svg path:not([fill="none"]) {


					fill: <?php echo $wah_icon_color; ?>;


				}	</style>


				<?php


			}








		?>


		


		<div class="button-type">


			<div class="button-type-col">


				<input id="small" <?php if($button_type == "small"){echo "checked='checked'";} ?> type="radio" name="button_type" value="small" /> <label for="small">Small (30px)</label>


			</div>


			<div class="button-type-col">


				<input id="medium" <?php if($button_type == "medium"){echo "checked='checked'";} ?> type="radio" name="button_type" value="medium" /> <label for="medium">Medium (50px)</label>


			</div>


			<div class="button-type-col">


				<input id="large" <?php if($button_type == "large"){echo "checked='checked'";} ?> type="radio" name="button_type" value="large" /><label for="large">Large (80px)</label>


			</div>


			


		</div>


		<label  class="text_label">


				<span><?php esc_html_e( 'Shape Type:', 'wp-nagish-express' ); ?></span>


				


		</label>


		<div class="button-type">


			<div class="button-type-col">


				<input id="sqaure" <?php if($shape_type == "sqaure"){echo "checked='checked'";} ?> type="radio" name="shape_type" value="sqaure" /> <label for="sqaure">Sqaure </label>


			</div>


			<div class="button-type-col">


				<input id="sqaure_corner" <?php if($shape_type == "sqaure_corner"){echo "checked='checked'";} ?> type="radio" name="shape_type" value="sqaure_corner" /> <label for="sqaure_corner">Square( with round cornders )</label>


			</div>


			<div class="button-type-col">


				<input id="half_left" <?php if($shape_type == "half_left"){echo "checked='checked'";} ?> type="radio" name="shape_type" value="half_left" /><label for="half_left">Half Left Circle</label>


			</div>


			<div class="button-type-col">


				<input id="half_right" <?php if($shape_type == "half_right"){echo "checked='checked'";} ?> type="radio" name="shape_type" value="half_right" /><label for="half_right">Half Right Circle</label>


			</div>


			<div class="button-type-col">


				<input id="cricle" <?php if($shape_type == "cricle"){echo "checked='checked'";} ?> type="radio" name="shape_type" value="cricle" /><label for="cricle">Cricle</label>


			</div>


		</div>


		<div class="button-image-selection">


			<div class="button-image-columns default-image-columns">


				<input <?php if($button_image == "icon1"){echo "checked='checked'";} ?> type="radio" value="icon1" name="button_image" />


				<div class="button-image-icon1 button-image-icon" style="background-color:<?php echo $wah_logo_color; ?>">


				<svg id="Group_13" data-name="Group 13" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="23.576" height="27.628" viewBox="0 0 23.576 27.628">


  <defs>


    <clipPath id="clip-path">


      <rect id="Rectangle_11" data-name="Rectangle 11" width="23.576" height="27.628" fill="#fff"/>


    </clipPath>


  </defs>


  <g id="Group_12" data-name="Group 12" clip-path="url(#clip-path)">


    <path id="Path_33" data-name="Path 33" d="M19.424,22.256H16.662l-4.052-7h-8.1L3.4,4.574A1.4,1.4,0,0,1,4.505,3.1,1.4,1.4,0,0,1,5.979,4.205L6.9,12.494h7.183l4.052,7h1.289a1.259,1.259,0,0,1,1.289,1.289,1.314,1.314,0,0,1-1.289,1.474" transform="translate(2.862 2.61)" fill="#fff"/>


    <path id="Path_34" data-name="Path 34" d="M9.946,23.2A9.9,9.9,0,0,1,0,13.253,9.518,9.518,0,0,1,3.684,5.517,1.417,1.417,0,0,1,5.526,5.7a1.417,1.417,0,0,1-.184,1.842,6.667,6.667,0,0,0-2.763,5.71,7.389,7.389,0,0,0,7.368,7.368,7.074,7.074,0,0,0,4.6-1.658,1.309,1.309,0,0,1,1.658,2.026A10,10,0,0,1,9.946,23.2" transform="translate(0 4.429)" fill="#fff"/>


    <path id="Path_35" data-name="Path 35" d="M5.31,0A2.21,2.21,0,1,1,3.1,2.21,2.21,2.21,0,0,1,5.31,0" transform="translate(2.61)" fill="#fff"/>


    <path id="Path_36" data-name="Path 36" d="M11.168,6.971H5.089A1.259,1.259,0,0,1,3.8,5.681,1.259,1.259,0,0,1,5.089,4.392h6.078a1.259,1.259,0,0,1,1.289,1.289,1.259,1.259,0,0,1-1.289,1.289" transform="translate(3.199 3.698)" fill="#fff"/>


    <path id="Path_37" data-name="Path 37" d="M11.772,8.374H6.856a.969.969,0,0,1,0-1.938h4.916a.969.969,0,0,1,0,1.938" transform="translate(4.956 5.418)" fill="#fff"/>


    <path id="Path_38" data-name="Path 38" d="M12.712,5.59,10.38,9.817A.969.969,0,1,1,8.7,8.856L11.03,4.629a.969.969,0,1,1,1.682.961" transform="translate(7.208 3.479)" fill="#fff"/>


  </g>


</svg>





				</div>


			</div>


			<div class="button-image-columns default-image-columns">


				<input <?php if($button_image == "icon2"){echo "checked='checked'";} ?> type="radio" value="icon2" name="button_image" />


				<div class="button-image-icon2 button-image-icon" style="background-color:<?php echo $wah_logo_color; ?>">


					<svg id="accessibility" xmlns="http://www.w3.org/2000/svg" width="34.614" height="34.614" viewBox="0 0 34.614 34.614">


  <path id="Path_50" data-name="Path 50" d="M0,0H34.614V34.614H0Z" fill="none"/>


  <path id="Path_51" data-name="Path 51" d="M28.5,9.2a1.5,1.5,0,0,0-1.788-1.082,51.118,51.118,0,0,1-10.831,1.1,51.118,51.118,0,0,1-10.831-1.1,1.492,1.492,0,0,0-.707,2.9A55.045,55.045,0,0,0,11.557,12.1V29.4a1.442,1.442,0,0,0,2.884,0V22.191h2.884V29.4a1.442,1.442,0,1,0,2.884,0V12.1a54.468,54.468,0,0,0,7.2-1.082A1.489,1.489,0,0,0,28.5,9.2ZM15.884,7.769A2.884,2.884,0,1,0,13,4.884,2.893,2.893,0,0,0,15.884,7.769Z" transform="translate(1.423 0.884)" fill="#fff"/>


</svg>





				</div>


			</div>


			<div class="button-image-columns default-image-columns" >


				<input <?php if($button_image == "icon3"){echo "checked='checked'";} ?> type="radio" value="icon3" name="button_image" />


				<div class="button-image-icon3 button-image-icon" style="background-color:<?php echo $wah_logo_color; ?>">


					<svg xmlns="http://www.w3.org/2000/svg" width="24.274" height="24.274" viewBox="0 0 24.274 24.274">


  <path id="eye-low-vision" d="M24.951,23.391,2.883,1.323a1.1,1.1,0,1,0-1.56,1.56L6.437,8A18.757,18.757,0,0,0,2.1,13.137c4.3,7.263,10.478,9.394,15.885,6.412l5.4,5.4a1.1,1.1,0,1,0,1.56-1.56ZM13.137,16.447a3.29,3.29,0,0,1-2.979-4.729l4.4,4.4a3.279,3.279,0,0,1-1.419.331Zm1.7-6.291,3.327-3.327A12.878,12.878,0,0,1,19.7,7.861l-3.577,3.577Zm2.453,2.453,3.653-3.654a17.554,17.554,0,0,1,1.228,1.335l-3.6,3.6ZM11.214,6.533l-.728-.728a9.64,9.64,0,0,1,1.8-.342Zm2.453,2.452L12.385,7.7,14.547,5.54a9.892,9.892,0,0,1,2.03.534Zm6.074,6.074,3.441-3.441c.338.482.67.982.989,1.519a20.866,20.866,0,0,1-2.707,3.647Z" transform="translate(-1 -1)" fill="#fff"/>


</svg>





				</div>


			</div>


			


			<div class="button-image-columns custom-image-columns  <?php if($button_image == "custom_icon"){echo "active";} ?>">


				<div class="custom-icon-column-inner">


					<input <?php if($button_image == "custom_icon"){echo "checked='checked'";} ?> type="radio" value="custom_icon" name="button_image" />


					<input type="hidden" name='wne_image_url' id="image_url"


						class="regular-text" value='<?php echo wah_get_param( 'wne_image_url' ) ? wah_get_param( 'wne_image_url' ) : ''; ?>'>


						


					<input type="button" name="upload-btn" id="upload-btn" class="button-secondary" value="<?php esc_html_e( 'Upload Your Icon', 'wp-nagish-express' ); ?>">


					<input type="button" name="clear-btn" id="clear-btn" class="button-secondary" value="<?php esc_html_e( 'Delete Icon', 'wp-nagish-express' ); ?>">


				</div>


				<div class="custom-icon-column-inner  custom-icon-column-inner-right">


					<img src="<?php echo wah_get_param( 'wne_image_url' ) ? wah_get_param( 'wne_image_url' ) : ''; ?>" alt="" />


				</div>


				


			</div>


		</div>


	</div>


	<?php


	


	


}








/**


 * Render Logo position


 *


 * @param  int 	   $label           label.


 * @param  int 	   $wah_logo_top    wah_logo_top.


 * @param  int     $wah_logo_right  wah_logo_right.


 * @param  int 	   $wah_logo_bottom wah_logo_bottom.


 * @param  int 	   $wah_logo_left   wah_logo_left.


 * @param  boolean $mob   true/false.


 */


function render_logo_position( $label, $nagish_hopxl, $nagish_hopos, $nagish_vepxl, $nagish_vepos, $mob = false ) {


	


	$nagish_logo_pos =  wah_get_param( 'nagish_logo_pos');


	


	


	


	


	 


	


	?>


	


	<div class="form_row" data-depid="wah_custom_logo_position">


		<div class="form30">


			<label class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form50">


			<div class="wah-logo-controller">


				<div class="wah-logo-controller-inner">


				<div class="row top_row">


					<div class="col-full-width">


						


						<div class="logo-input logo-input-topleft">


								


							<input  <?php if($nagish_logo_pos == "topleft"){echo "checked='checked'"; } ?> type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topleft"  />


							


						</div>


						<div class="logo-input logo-input-topcenter">


								<input <?php if($nagish_logo_pos == "topcenter"){echo "checked='checked'"; } ?>  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topcenter"  />


						</div>


						<div class="logo-input logo-input-topright">


								<input <?php if($nagish_logo_pos == "topright"){echo "checked='checked'"; } ?>  type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topright"  />


						</div>


					</div>


				</div>


				<div class="row middle_row">


				<div class="col-full-width">


						<div class="logo-input logo-input-leftcenter">


								<input <?php if($nagish_logo_pos == "leftcenter"){echo "checked='checked'"; } ?> type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="leftcenter"  />


						</div>


						<div class="logo-input logo-input-rightcenter">


								<input <?php if($nagish_logo_pos == "rightcenter"){echo "checked='checked'"; } ?>  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="rightcenter"  />


						</div>


					</div>


				</div>


				<div class="row bottom_row">


					<div class="col-full-width">


						


						<div class="logo-input logo-input-bottomleft">


								<input <?php if($nagish_logo_pos == "bottomleft"){echo "checked='checked'"; } ?> type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="bottomleft"  />


						</div>


						<div class="logo-input logo-input-bottomcenter">


								<input  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" <?php if($nagish_logo_pos == "bottomcenter"){echo "checked='checked'"; } ?> value="bottomcenter"   />


						</div>


						<div class="logo-input logo-input-bottomright">


								<input <?php if($nagish_logo_pos == "bottomright"){echo "checked='checked'"; } ?>  type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="bottomright"  />


						</div>


					</div>


				</div>


			</div>


			</div>


		</div>


		


		<div class="form20">


			<div class="logo_pixcel_customizer">


				<label  class="text_label"><?php echo __( 'Exact positioning:', 'wp-nagish-express' ); ?></label>


				<div class="row pixcel_customizer">


					<div class="horizontal-position position_row">


						<div class="position_input">


							<input  name="nagish_hopxl<?php echo $mob ? '_mob' : ''; ?>"  type="number" placeholder="0" value="<?php echo esc_html( $nagish_hopxl ); ?>" min="-1000" max="1000" />


						</div>


						<div class="position_select">


							<select  name="nagish_hopos<?php echo $mob ? '_mob' : ''; ?>">


								<option value="">Select</option>


								<option  <?php if($nagish_hopos == "left"){ echo "selected"; } ?> value="left">From the left</option>


								<option <?php if($nagish_hopos == "right"){ echo "selected"; } ?> value="right">From the right</option>


							</select>


						</div>


					</div>


					<div class="verticle-position position_row">


						<div class="position_input">


							<input  name="nagish_vepxl<?php echo $mob ? '_mob' : ''; ?>" min="-1000" max="1000"  value="<?php echo esc_html( $nagish_vepxl ); ?>" type="number" placeholder="0" />


						</div>


						<div class="position_select">


							<select  name="nagish_vepos<?php echo $mob ? '_mob' : ''; ?>">


								<option value="">Select</option>


								<option  <?php if($nagish_vepos == "top"){ echo "selected"; } ?> value="top">From the top</option>


								<option  <?php if($nagish_vepos == "bottom"){ echo "selected"; } ?> value="bottom">From the bottom</option>


							</select>


						</div>


					</div>


				</div>


			</div>


		</div>


	</div>


	<?php


}


function render_logo_position_mob( $label, $nagish_hopxl_mob, $nagish_hopos_mob, $nagish_vepxl_mob, $nagish_vepos_mob, $mob = true ) {


	


	$nagish_logo_pos_mob =  wah_get_param( 'nagish_logo_pos_mob');


	


	














	


	 


	


	?>


	


	<div class="form_row" data-depid="wah_custom_logo_position_mob">


		<div class="form30">


			<label class="text_label"><?php echo esc_html( $label ); ?></label>


		</div>


		<div class="form50">


			<div class="wah-logo-controller">


				<div class="wah-logo-controller-inner">


				<div class="row top_row">


					<div class="col-full-width">


						


						<div class="logo-input logo-input-topleft">


								


							<input  <?php if($nagish_logo_pos_mob == "topleft"){echo "checked='checked'"; } ?> type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topleft"  />


							


						</div>


						<div class="logo-input logo-input-topcenter">


								<input <?php if($nagish_logo_pos_mob == "topcenter"){echo "checked='checked'"; } ?>  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topcenter"  />


						</div>


						<div class="logo-input logo-input-topright">


								<input <?php if($nagish_logo_pos_mob == "topright"){echo "checked='checked'"; } ?>  type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="topright"  />


						</div>


					</div>


				</div>


				<div class="row middle_row">


				<div class="col-full-width">


						<div class="logo-input logo-input-leftcenter">


								<input <?php if($nagish_logo_pos_mob == "leftcenter"){echo "checked='checked'"; } ?> type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="leftcenter"  />


						</div>


						<div class="logo-input logo-input-rightcenter">


								<input <?php if($nagish_logo_pos_mob == "rightcenter"){echo "checked='checked'"; } ?>  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="rightcenter"  />


						</div>


					</div>


				</div>


				<div class="row bottom_row">


					<div class="col-full-width">


						


						<div class="logo-input logo-input-bottomleft">


								<input <?php if($nagish_logo_pos_mob == "bottomleft"){echo "checked='checked'"; } ?> type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="bottomleft"  />


						</div>


						<div class="logo-input logo-input-bottomcenter">


								<input  type="radio"  name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" <?php if($nagish_logo_pos_mob == "bottomcenter"){echo "checked='checked'"; } ?> value="bottomcenter"   />


						</div>


						<div class="logo-input logo-input-bottomright">


								<input <?php if($nagish_logo_pos_mob == "bottomright"){echo "checked='checked'"; } ?>  type="radio" name="nagish_logo_pos<?php echo $mob ? '_mob' : ''; ?>" value="bottomright"  />


						</div>


					</div>


				</div>


			</div>


			</div>


		</div>


		


		<div class="form20">


			<div class="logo_pixcel_customizer">


				<label  class="text_label"><?php echo __( 'Exact positioning:', 'wp-nagish-express' ); ?></label>


				<div class="row pixcel_customizer">


					<div class="horizontal-position position_row">


						<div class="position_input">


							<input  name="nagish_hopxl<?php echo $mob ? '_mob' : ''; ?>"  type="number" placeholder="0" value="<?php echo esc_html( $nagish_hopxl_mob ); ?>" min="-1000" max="1000" />


						</div>


						<div class="position_select">


							<select  name="nagish_hopos<?php echo $mob ? '_mob' : ''; ?>">


								<option value="">Select</option>


								<option  <?php if($nagish_hopos_mob == "left"){ echo "selected"; } ?> value="left">From the left</option>


								<option <?php if($nagish_hopos_mob == "right"){ echo "selected"; } ?> value="right">From the right</option>


							</select>


						</div>


					</div>


					<div class="verticle-position position_row">


						<div class="position_input">


							<input  name="nagish_vepxl<?php echo $mob ? '_mob' : ''; ?>" min="-1000" max="1000"  value="<?php echo esc_html( $nagish_vepxl_mob ); ?>" type="number" placeholder="0" />


						</div>


						<div class="position_select">


							<select  name="nagish_vepos<?php echo $mob ? '_mob' : ''; ?>">


								<option value="">Select</option>


								<option  <?php if($nagish_vepos_mob == "top"){ echo "selected"; } ?> value="top">From the top</option>


								<option  <?php if($nagish_vepos_mob == "bottom"){ echo "selected"; } ?> value="bottom">From the bottom</option>


							</select>


						</div>


					</div>


				</div>


			</div>


		</div>


	</div>


	<?php


}


/**


 * Admin header links


 *


 * @return array links array


 */


function get_wne_admin_header_links() {


	


}


/**


 * Admin header share


 *


 * @return array array


 */


function get_wne_admin_header_share() {


	$array = array(


		array(


			'url'   => 'https://www.facebook.com/sharer/sharer.php?u=https%3A//wordpress.org/plugins/wp-nagish-express/',


			'class' => 'wah-facebook-share',


			'title' => 'Share on Facebook',


		),


		array(


			'url'   => 'https://www.linkedin.com/shareArticle?mini=true&url=https%3A//wordpress.org/plugins/wp-nagish-express/&title=WP%20Accessibility%20Helper&summary=&source=',


			'class' => 'wah-linkedin-share',


			'title' => 'Share on LinkedIn',


		),


		array(


			'url'   => 'https://twitter.com/home?status=WP%20Accessibility%20Helper%20-%20https%3A//wordpress.org/plugins/wp-nagish-express/',


			'class' => 'wah-twitter-share',


			'title' => 'Share on Twitter',


		),


	);


	return $array;


}


/**


 * WAH Header notice


 */


function render_wah_header_notice() {


	$wah_share_links        = get_wne_admin_header_share();


	$wne_admin_header_links = get_wne_admin_header_links();


	?>


	


	<?php


}


/**


 * Render license form


 */


function render_license_form() {


	$screen = get_current_screen();


	if ( 'toplevel_page_wp_accessibility' === $screen->id ) :


		$active_license_class = '';


		if ( get_wah_pro_license_key() && get_wah_pro_license_email() ) {


			$active_license_class = 'activated';


		}


		$license_form_link = array(


			


		);


		?>


		<div class="wne_admin_header_license_key">





			<div class="check-subscription-status">


				<button type="button" class="check-subscription-btn"


					title="Check subscription status on WAH server"


					data-email="<?php echo esc_html( get_wah_pro_license_email() ); ?>"


					data-license="<?php echo esc_html( get_wah_pro_license_key() ); ?>">


					<span class="dashicons dashicons-info-outline"></span> Check subscription status


				</button>


			</div>





			<form class="wah_pro_license-validate">


				<div class="license_key_trigger">


					<button type="button" title="Enter your license key here." class="<?php echo esc_html( $active_license_class ); ?>">


						<span class="dashicons dashicons-admin-network"></span>


						<?php esc_html_e( 'License Key', 'wp-nagish-express' ); ?>


					</button>


					<span class="license_ajax_response"></span>


				</div>


				<div class="license_key_wrapper clearfix">


					<h3 style="color:white;">


						<?php esc_html_e( 'Please, do NOT activate your license on the development website. Live sites only.', 'wp-nagish-express' ); ?>


					</h3>


					<div class="license-form-fields">


						<input type="text" name="wah_license_email" class="wah_license_email"


							value="<?php echo esc_html( get_wah_pro_license_email() ); ?>"


							placeholder="<?php esc_html_e( 'License email', 'wp-nagish-express' ); ?>*">


						<input type="text" name="wah_license_key" class="wah_license_key"


							value="<?php echo esc_html( get_wah_pro_license_key() ); ?>"


							placeholder="<?php esc_html_e( 'License key', 'wp-nagish-express' ); ?>*">


						<button type="submit" class="button button-primary button-large submit-wah-license">


							<?php esc_html_e( 'Activate license key', 'wp-nagish-express' ); ?>


							<span class="ajax-loader"></span>


						</button>


						<input type="hidden" name="wah-nonce" value="<?php echo esc_html( wp_create_nonce( 'wah-pro-nonce-key' ) ); ?>">


					</div>


					<div class="license-description">


						<ul>


							<?php foreach ( $license_form_link as $link => $title ) : ?>


								<li>


									<a href="<?php echo esc_url( $link ); ?>" target="_blank"><?php echo esc_html( $title ); ?></a>


								</li>


							<?php endforeach; ?>


						</ul>


					</div>


				</div>


				<div class="scan_my_homepage">


					<a href="<?php echo esc_url( add_query_arg( 'scan_my_homepage', 1, admin_url( 'admin.php?page=wp_accessibility_dom_scanner' ) ) ); ?>">


						<?php esc_html_e( 'Scan my homepage', 'wp-nagish-express' ); ?>


					</a>


				</div>


			</form>


		</div>





	<?php endif; ?>


	<?php


}


/**


 * WNEPRO MCE button


 */


function wah_pro_mce_button() {


	if ( ! current_user_can( 'edit_posts' ) ) {


		return;


	}


	if ( 'true' == get_user_option( 'rich_editing' ) ) {


		//add_filter( 'mce_external_plugins', 'custom_tinymce_plugin' );


		//add_filter( 'mce_buttons', 'register_mce_button' );


	}


}


add_action( 'admin_head', 'wah_pro_mce_button' );


/**


 * Function for new button


 *


 * @param  array $plugin_array array.


 * @return array               array


 */


function custom_tinymce_plugin( $plugin_array ) {


	$plugin_array['wah_pro_mce_button'] = plugins_url() . '/nagish-accessibility/admin/js/editor_plugin.js';


	return $plugin_array;


}


/**


 * Register new button in the editor


 *


 * @param  array $buttons array.


 * @return array          array


 */


function register_mce_button( $buttons ) {


	array_push( $buttons, 'wah_pro_mce_button', 'wah_pro_popup' );


	return $buttons;


}





//add_action( 'media_buttons', 'add_wah_accordion_button' );


/**


 * Accordion button


 */


// function add_wah_accordion_button() {


	// echo '<a href="#" id="insert-wah-accodrion" class="button"><i class="mce-ico mce-i-icon dashicons-universal-access-alt wah-accodrion-admin-button"></i> Accodrion</a>';


// }


/**


 * Get sidebar layouts to display on admin page


 *


 * @return array sidebar layouts


 */


function wah_get_sidebar_layouts() {


	$sidebar_layouts = array(


		'wah-modern'           => __( 'Modern', 'wp-nagish-express' ),


		'wide-sidebar'         => __( 'Wide', 'wp-nagish-express' ),


		'wah-bottom-fullwidth' => __( 'Bottom Fullwidth', 'wp-nagish-express' ),


		'standart-sidebar'     => __( 'Standard', 'wp-nagish-express' ),


		'magic-sidebar'        => __( 'Magic', 'wp-nagish-express' ),


		'mini-sidebar'         => __( 'Mini', 'wp-nagish-express' ),


	);


	return $sidebar_layouts;


}


/**


 * Get GDPR popup positions


 *


 * @return array gdpr_position


 */


function get_wah_gdpr_position() {


	$array = array(


		'top-fullwidth'    => __( 'Top fullwidth', 'wp-nagish-express' ),


		'top-left'         => __( 'Top left corner', 'wp-nagish-express' ),


		'top-right'        => __( 'Top right corner', 'wp-nagish-express' ),


		'bottom-fullwidth' => __( 'Bottom fullwidth', 'wp-nagish-express' ),


		'bottom-right'     => __( 'Bottom right corner', 'wp-nagish-express' ),


		'bottom-left'      => __( 'Bottom left corner', 'wp-nagish-express' ),


	);


	return $array;


}


/**


 * WNEPRO get_wah_settings


 *


 * @return array settings


 */


function get_wah_settings() {


	$wah_settings = array(


		'wne_image_url'                       => wah_get_param( 'wne_image_url' ),


		'nagish_enable_english'              => wah_get_param( 'nagish_enable_english' ),


		'wah_custom_icon'                     => wah_get_param( 'wah_custom_icon' ),


		'wne_font_setup_type'                 => "script",


		'wne_reset_font_size'                 => wah_get_param( 'wne_reset_font_size' ),


		'wna_contrast_setup'                  => 1,


		'wah_enable_custom_contrast'          => wah_get_param( 'wah_enable_custom_contrast' ),


		'wne_remove_styles_setup'             => wah_get_param( 'wne_remove_styles_setup' ),


		'wne_remove_styles_setup_title'       => wah_get_param( 'wne_remove_styles_setup_title' ),


		'wne_choose_color_title'              => wah_get_param( 'wne_choose_color_title' ),


		'wne_underline_links_setup'           => 1,


		'wne_underline_links_setup_title'     => wah_get_param( 'wne_underline_links_setup_title' ),


		'wne_role_links_setup'                => wah_get_param( 'wne_role_links_setup' ),


		'wne_remove_link_titles'              => wah_get_param( 'wne_remove_link_titles' ),


		'wne_clear_cookies_title'             => wah_get_param( 'wne_clear_cookies_title' ),


		'wah_custom_title_selector_on'        => wah_get_param( 'wah_custom_title_selector_on' ),


		'wah_custom_title_selector'           => wah_get_param( 'wah_custom_title_selector' ),


		'wne_close_button_title'              => wah_get_param( 'wne_close_button_title' ),


		'wne_close_btn_bg'                    => wah_get_param( 'wne_close_btn_bg' ),


		'wne_close_btn_color'                 => wah_get_param( 'wne_close_btn_color' ),


		'wne_customize_close_button'          => 0,


		'wne_hide_on_mobile'                  => wah_get_param( 'wne_hide_on_mobile' ),


		'wne_left_side'                       => 0,


		'wne_greyscale_title'                 =>  wah_get_param( 'wne_greyscale_title' ) ? wah_get_param( 'wne_greyscale_title' ) : __( 'תמונות בגוון אפור', 'wp-nagish-express' ),


		'wah_greyscale_image_selectors'       => wah_get_param( 'wah_greyscale_image_selectors' ),


		'wne_greyscale_enable'                => 1,


		'wne_darktheme_enable'                => 0,


		'wne_highlight_links_enable'          => 1,


		'wne_highlight_links_title'           => wah_get_param( 'wne_highlight_links_title' ),


		'wne_invert_enable'                   => 1,


		'wne_invert_title'                    => wah_get_param( 'wne_invert_title' ),


		'wne_remove_animations_setup'         => 1,


		'wne_remove_animations_title'         => wah_get_param( 'wne_remove_animations_title' ),


		'wne_readable_fonts_setup'            => wah_get_param( 'wne_readable_fonts_setup' ),


		'wne_readable_fonts_title'            => wah_get_param( 'wne_readable_fonts_title' ),


		'wne_custom_font'                     => wah_get_param( 'wne_custom_font' ),


		'wah_skiplinks_setup'                 => wah_get_param( 'wah_skiplinks_setup' ),


		'wne_keyboard_navigation_setup'       => wah_get_param( 'wne_keyboard_navigation_setup' ),


		'wne_keyboard_navigation_title'       => wah_get_param( 'wne_keyboard_navigation_title' ),


		'wne_lights_off_setup'                => wah_get_param( 'wne_lights_off_setup' ),


		'wne_lights_off_title'                => wah_get_param( 'wne_lights_off_title' ),


		'wne_lights_selector'                 => wah_get_param( 'wne_lights_selector' ),


		'wah_highlight_titles_setup'          => wah_get_param( 'wah_highlight_titles_setup' ),


		'wah_highlight_titles_title'          => wah_get_param( 'wah_highlight_titles_title' ),


		'wne_image_alt_setup'                 => 1,


		'wah_image_alt_title'                 => wah_get_param( 'wah_image_alt_title' ),


		'wah_custom_logo_position'            => wah_get_param( 'wah_custom_logo_position' ),


		'wah_logo_top'                        => wah_get_param( 'wah_logo_top' ),


		'wah_logo_right'                      => wah_get_param( 'wah_logo_right' ),


		'wah_logo_left'                       => wah_get_param( 'wah_logo_left' ),


		'wah_logo_bottom'                     => wah_get_param( 'wah_logo_bottom' ),


		'wah_enable_icons'                    => wah_get_param( 'wah_enable_icons' ),


		'wah_enable_wpml_support'             => wah_get_param( 'wah_enable_wpml_support' ),


		'wah_sidebar_layout'                  => wah_get_param( 'wah_sidebar_layout' ),


		'wah_logo_customizer'                 => wah_get_param( 'wah_logo_customizer' ),


		'wah_logo_bg'                         => wah_get_param( 'wah_logo_bg' ),


		'wah_logo_color'                      => wah_get_param( 'wah_logo_color' ),


		'wah_icon_color'                      => wah_get_param( 'wah_icon_color' ),


		'wah_enable_log'                      => wah_get_param( 'wah_enable_log' ),


		'wah_enable_terms_link'               => wah_get_param( 'wah_enable_terms_link' ),


		'wah_custom_link_title'               => wah_get_param( 'wah_custom_link_title' ),


		'wah_custom_link_url'                 => wah_get_param( 'wah_custom_link_url' ),


		'wah_cookies'                         => wah_get_param( 'wah_cookies' ),


		'wah_enable_large_mouse_cursor'       => 1,


		'wah_large_mouse_cursor_title'        => wah_get_param( 'wah_large_mouse_cursor_title' ),


		'wne_enable_monochrome_mode'          => 1,


		'wah_monochrome_mode_title'           => wah_get_param( 'wah_monochrome_mode_title' ),


		'wne_enable_sepia_mode'               => 1,


		'wah_sepia_mode_title'                => wah_get_param( 'wah_sepia_mode_title' ),


		'wah_enable_inspector_mode'           => 1,


		'wah_inspector_mode_title'            => wah_get_param( 'wah_inspector_mode_title' ),


		'wah_set_layout_title'                => wah_get_param( 'wah_set_layout_title' ),


		'wah_set_layout_popup_title'          => wah_get_param( 'wah_set_layout_popup_title' ),


		'wah_set_layout_setup'                => wah_get_param( 'wah_set_layout_setup' ),


		'wne_enable_letter_spacing_mode'      => 1,


		'wne_letter_spacing_title'            => wah_get_param( 'wne_letter_spacing_title' ),


		'wah_enable_wah_credits'              => wah_get_param( 'wah_enable_wah_credits' ),


		'wah_email'              => wah_get_param( 'wah_email' ),


		'wah_report_problem_enable'           => wah_get_param( 'wah_report_problem_enable' ),


		'wah_report_problem_title'            => wah_get_param( 'wah_report_problem_title' ),


		'wah_report_popup_title'              => wah_get_param( 'wah_report_popup_title' ),


		'wah_report_mailto'                   => wah_get_param( 'wah_report_mailto' ),


		'wah_enable_web_speech'               => wah_get_param( 'wah_enable_web_speech' ),


		'wah_enable_adhd'                     => wah_get_param( 'wah_enable_adhd' ),


		'wah_adhd_button_title'               => wah_get_param( 'wah_adhd_button_title' ),


		'wne_enable_cd_profile'               => 1,


		'wah_cd_profile_button_title'         => wah_get_param( 'wah_cd_profile_button_title' ),


		'wah_cd_profile_description'          => wah_get_param( 'wah_cd_profile_description' ),


		'wne_enable_mute'                     => 1,


		'wah_mute_button_title'               => wah_get_param( 'wah_mute_button_title' ),


		'wah_text_alignment'                  => 1,


		'wne_text_alignment_center'           => wah_get_param( 'wne_text_alignment_center' ),


		'wne_text_alignment_left'             => wah_get_param( 'wne_text_alignment_left' ),


		'wne_text_alignment_right'            => wah_get_param( 'wne_text_alignment_right' ),


		// GDPR.


		'wah_gdpr_enable'                     => wah_get_param( 'wah_gdpr_enable' ),


		'wah_gdpr_position'                   => wah_get_param( 'wah_gdpr_position' ),


		'wah_gdpr_custom_bg'                  => wah_get_param( 'wah_gdpr_custom_bg' ),


		'wah_gdpr_custom_text_color'          => wah_get_param( 'wah_gdpr_custom_text_color' ),


		'wah_gdpr_custom_link_color'          => wah_get_param( 'wah_gdpr_custom_link_color' ),


		'wah_gdpr_custom_accept_button_color' => wah_get_param( 'wah_gdpr_custom_accept_button_color' ),


		'wah_gdpr_custom_accept_button_bg'    => wah_get_param( 'wah_gdpr_custom_accept_button_bg' ),


		'wah_gdpr_custom_cancel_button_color' => wah_get_param( 'wah_gdpr_custom_cancel_button_color' ),


		'wah_gdpr_custom_cancel_button_bg'    => wah_get_param( 'wah_gdpr_custom_cancel_button_bg' ),


		'wah_gdpr_content'                    => wah_get_param( 'wah_gdpr_content' ),


		'wah_gdpr_accept_button_title'        => wah_get_param( 'wah_gdpr_accept_button_title' ),


		'wah_gdpr_cancel_button_title'        => wah_get_param( 'wah_gdpr_cancel_button_title' ),


		'wah_gdpr_cookies'                    => wah_get_param( 'wah_gdpr_cookies' ),


		// Landmark.


		'wne_header_element_selector'         => wah_get_param( 'wne_header_element_selector' ),


		'wne_sidebar_element_selector'        => wah_get_param( 'wne_sidebar_element_selector' ),


		'wne_footer_element_selector'         => wah_get_param( 'wne_footer_element_selector' ),


		'wne_main_element_selector'           => wah_get_param( 'wne_main_element_selector' ),


		'wne_nav_element_selector'            => wah_get_param( 'wne_nav_element_selector' ),


		// Accessibility statement.


		'wne_statement_enable'                => 1,


		'wne_statement_button_title'          => wah_get_param( 'wne_statement_button_title' ),


		'wne_statement_popup_content'         => wah_get_param( 'wne_statement_popup_content' ),


		// Hide images.


		'wne_enable_hide_images'              => 1,


		'wah_hide_image_button_title'         => wah_get_param( 'wah_hide_image_button_title' ),


		// Modern layout.


		'wah_adjust_background_colors_title'  => wah_get_param( 'wah_adjust_background_colors_title' ),


		'wah_adjust_title_colors_title '      => wah_get_param( 'wah_adjust_title_colors_title' ),


		'wah_adjust_text_colors_title'        => wah_get_param( 'wah_adjust_text_colors_title' ),


		'wah_adjust_link_colors_title '       => wah_get_param( 'wah_adjust_link_colors_title' ),


		'wne_underline_links_description'     => wah_get_param( 'wne_underline_links_description' ),


		'wne_highlight_links_description'     => wah_get_param( 'wne_highlight_links_description' ),


		'wah_images_greyscale_description'    => wah_get_param( 'wah_images_greyscale_description' ),


		'wne_invert_colors_description'       => wah_get_param( 'wne_invert_colors_description' ),


		'wne_remove_animations_description'   => wah_get_param( 'wne_remove_animations_description' ),


		'wah_remove_styles_description'       => wah_get_param( 'wah_remove_styles_description' ),


		'wah_highlight_titles_description'    => wah_get_param( 'wah_highlight_titles_description' ),


		'wah_images_description_description'  => wah_get_param( 'wah_images_description_description' ),


		'wne_large_cursor_description'        => wah_get_param( 'wne_large_cursor_description' ),


		'wah_monochrome_description'          => wah_get_param( 'wah_monochrome_description' ),


		'wah_sepia_description'               => wah_get_param( 'wah_sepia_description' ),


		'wah_inspector_description'           => wah_get_param( 'wah_inspector_description' ),


		'wne_letter_spacing_description'      => wah_get_param( 'wne_letter_spacing_description' ),


		'wne_adhd_profile_description'        => wah_get_param( 'wne_adhd_profile_description' ),


		'wah_mute_volume_description'         => wah_get_param( 'wah_mute_volume_description' ),


		'wah_hide_images_description'         => wah_get_param( 'wah_hide_images_description' ),


	);





	return $wah_settings;


}


/**


 * WNEPRO import_settings_from_json


 *


 * @param  file $json_file file.


 * @return array            response


 */


function wnexpress_import_settings_from_json( $json_file ) {


	$response = array(


		'error'   => false,


		'message' => '',


	);





	if ( ! $json_file['error'] ) {


		if ( 'application/json' === $json_file['type'] ) {


			$data = json_decode( file_get_contents( $json_file['tmp_name'] ), true );


			if ( $data ) {


				$setup_plugin_settings = wnexpress_setup_plugin_settings( $data );


				if ( 'ok' === $setup_plugin_settings['widgets'] ) {


					$response['message'] = 'Widgets order imported successfuly! ';


				}


				if ( 'ok' === $setup_plugin_settings['settings'] ) {


					$response['message'] .= 'Global settings imported successfuly!';


				}


			}


		} else {


			$response['error']   = true;


			$response['message'] = 'File type error! Only .JSON file please.';


		}


	} else {


		$response['error']   = $json_file['error'];


		$response['message'] = 'Error: ' . $json_file['error'];


	}





	return $response;


}


/**


 * Setup plugin settings


 *


 * @param  array $data data.


 * @return array       new data


 */


function wnexpress_setup_plugin_settings( $data ) {


	$setup_response = array(


		'widgets'  => '',


		'settings' => '',


	);


	/* Step #1 - import global plugin settings */


	if ( isset( $data['settings'] ) && $data['settings'] ) {


		foreach ( $data['settings'] as $key => $value ) {


			wah_set_param( $key, $value );


		}


		$setup_response['settings'] = 'ok';


	}


	/* Step #2 - import widgets order */


	if ( isset( $data['widgets'] ) && $data['widgets'] ) {


		$update_widgets = wah_update_widgets_order( $data['widgets'] );


		if ( 'ok' === $update_widgets ) {


			$setup_response['widgets'] = $update_widgets;


		}


	}





	return $setup_response;


}


