<?php
/**
 * Healthcoach Framework: return lists
 *
 * @package healthcoach
 * @since healthcoach 1.0
 */

// Disable direct call
if ( ! defined( 'ABSPATH' ) ) { exit; }



// Return styles list
if ( !function_exists( 'healthcoach_get_list_styles' ) ) {
	function healthcoach_get_list_styles($from=1, $to=2, $prepend_inherit=false) {
		$list = array();
		for ($i=$from; $i<=$to; $i++)
			$list[$i] = sprintf(esc_html__('Style %d', 'healthcoach'), $i);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the shortcodes margins
if ( !function_exists( 'healthcoach_get_list_margins' ) ) {
	function healthcoach_get_list_margins($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_margins'))=='') {
			$list = array(
				'null'		=> esc_html__('0 (No margin)',	'healthcoach'),
				'tiny'		=> esc_html__('Tiny',		'healthcoach'),
				'small'		=> esc_html__('Small',		'healthcoach'),
				'medium'	=> esc_html__('Medium',		'healthcoach'),
				'large'		=> esc_html__('Large',		'healthcoach'),
				'huge'		=> esc_html__('Huge',		'healthcoach'),
				'tiny-'		=> esc_html__('Tiny (negative)',	'healthcoach'),
				'small-'	=> esc_html__('Small (negative)',	'healthcoach'),
				'medium-'	=> esc_html__('Medium (negative)',	'healthcoach'),
				'large-'	=> esc_html__('Large (negative)',	'healthcoach'),
				'huge-'		=> esc_html__('Huge (negative)',	'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_margins', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_margins', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the line styles
if ( !function_exists( 'healthcoach_get_list_line_styles' ) ) {
	function healthcoach_get_list_line_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_line_styles'))=='') {
			$list = array(
				'solid'	=> esc_html__('Solid', 'healthcoach'),
				'dashed'=> esc_html__('Dashed', 'healthcoach'),
				'dotted'=> esc_html__('Dotted', 'healthcoach'),
				'double'=> esc_html__('Double', 'healthcoach'),
				'image'	=> esc_html__('Image', 'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_line_styles', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_line_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the animations
if ( !function_exists( 'healthcoach_get_list_animations' ) ) {
	function healthcoach_get_list_animations($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_animations'))=='') {
			$list = array(
				'none'			=> esc_html__('- None -',	'healthcoach'),
				'bounce'		=> esc_html__('Bounce',		'healthcoach'),
				'elastic'		=> esc_html__('Elastic',	'healthcoach'),
				'flash'			=> esc_html__('Flash',		'healthcoach'),
				'flip'			=> esc_html__('Flip',		'healthcoach'),
				'pulse'			=> esc_html__('Pulse',		'healthcoach'),
				'rubberBand'	=> esc_html__('Rubber Band','healthcoach'),
				'shake'			=> esc_html__('Shake',		'healthcoach'),
				'swing'			=> esc_html__('Swing',		'healthcoach'),
				'tada'			=> esc_html__('Tada',		'healthcoach'),
				'wobble'		=> esc_html__('Wobble',		'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_animations', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_animations', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the enter animations
if ( !function_exists( 'healthcoach_get_list_animations_in' ) ) {
	function healthcoach_get_list_animations_in($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_animations_in'))=='') {
			$list = array(
				'none'				=> esc_html__('- None -',			'healthcoach'),
				'bounceIn'			=> esc_html__('Bounce In',			'healthcoach'),
				'bounceInUp'		=> esc_html__('Bounce In Up',		'healthcoach'),
				'bounceInDown'		=> esc_html__('Bounce In Down',		'healthcoach'),
				'bounceInLeft'		=> esc_html__('Bounce In Left',		'healthcoach'),
				'bounceInRight'		=> esc_html__('Bounce In Right',	'healthcoach'),
				'elastic'			=> esc_html__('Elastic In',			'healthcoach'),
				'fadeIn'			=> esc_html__('Fade In',			'healthcoach'),
				'fadeInUp'			=> esc_html__('Fade In Up',			'healthcoach'),
				'fadeInUpSmall'		=> esc_html__('Fade In Up Small',	'healthcoach'),
				'fadeInUpBig'		=> esc_html__('Fade In Up Big',		'healthcoach'),
				'fadeInDown'		=> esc_html__('Fade In Down',		'healthcoach'),
				'fadeInDownBig'		=> esc_html__('Fade In Down Big',	'healthcoach'),
				'fadeInLeft'		=> esc_html__('Fade In Left',		'healthcoach'),
				'fadeInLeftBig'		=> esc_html__('Fade In Left Big',	'healthcoach'),
				'fadeInRight'		=> esc_html__('Fade In Right',		'healthcoach'),
				'fadeInRightBig'	=> esc_html__('Fade In Right Big',	'healthcoach'),
				'flipInX'			=> esc_html__('Flip In X',			'healthcoach'),
				'flipInY'			=> esc_html__('Flip In Y',			'healthcoach'),
				'lightSpeedIn'		=> esc_html__('Light Speed In',		'healthcoach'),
				'rotateIn'			=> esc_html__('Rotate In',			'healthcoach'),
				'rotateInUpLeft'	=> esc_html__('Rotate In Down Left','healthcoach'),
				'rotateInUpRight'	=> esc_html__('Rotate In Up Right',	'healthcoach'),
				'rotateInDownLeft'	=> esc_html__('Rotate In Up Left',	'healthcoach'),
				'rotateInDownRight'	=> esc_html__('Rotate In Down Right','healthcoach'),
				'rollIn'			=> esc_html__('Roll In',			'healthcoach'),
				'slideInUp'			=> esc_html__('Slide In Up',		'healthcoach'),
				'slideInDown'		=> esc_html__('Slide In Down',		'healthcoach'),
				'slideInLeft'		=> esc_html__('Slide In Left',		'healthcoach'),
				'slideInRight'		=> esc_html__('Slide In Right',		'healthcoach'),
				'wipeInLeftTop'		=> esc_html__('Wipe In Left Top',	'healthcoach'),
				'zoomIn'			=> esc_html__('Zoom In',			'healthcoach'),
				'zoomInUp'			=> esc_html__('Zoom In Up',			'healthcoach'),
				'zoomInDown'		=> esc_html__('Zoom In Down',		'healthcoach'),
				'zoomInLeft'		=> esc_html__('Zoom In Left',		'healthcoach'),
				'zoomInRight'		=> esc_html__('Zoom In Right',		'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_animations_in', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_animations_in', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the out animations
if ( !function_exists( 'healthcoach_get_list_animations_out' ) ) {
	function healthcoach_get_list_animations_out($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_animations_out'))=='') {
			$list = array(
				'none'				=> esc_html__('- None -',			'healthcoach'),
				'bounceOut'			=> esc_html__('Bounce Out',			'healthcoach'),
				'bounceOutUp'		=> esc_html__('Bounce Out Up',		'healthcoach'),
				'bounceOutDown'		=> esc_html__('Bounce Out Down',	'healthcoach'),
				'bounceOutLeft'		=> esc_html__('Bounce Out Left',	'healthcoach'),
				'bounceOutRight'	=> esc_html__('Bounce Out Right',	'healthcoach'),
				'fadeOut'			=> esc_html__('Fade Out',			'healthcoach'),
				'fadeOutUp'			=> esc_html__('Fade Out Up',		'healthcoach'),
				'fadeOutUpBig'		=> esc_html__('Fade Out Up Big',	'healthcoach'),
				'fadeOutDown'		=> esc_html__('Fade Out Down',		'healthcoach'),
				'fadeOutDownSmall'	=> esc_html__('Fade Out Down Small','healthcoach'),
				'fadeOutDownBig'	=> esc_html__('Fade Out Down Big',	'healthcoach'),
				'fadeOutLeft'		=> esc_html__('Fade Out Left',		'healthcoach'),
				'fadeOutLeftBig'	=> esc_html__('Fade Out Left Big',	'healthcoach'),
				'fadeOutRight'		=> esc_html__('Fade Out Right',		'healthcoach'),
				'fadeOutRightBig'	=> esc_html__('Fade Out Right Big',	'healthcoach'),
				'flipOutX'			=> esc_html__('Flip Out X',			'healthcoach'),
				'flipOutY'			=> esc_html__('Flip Out Y',			'healthcoach'),
				'hinge'				=> esc_html__('Hinge Out',			'healthcoach'),
				'lightSpeedOut'		=> esc_html__('Light Speed Out',	'healthcoach'),
				'rotateOut'			=> esc_html__('Rotate Out',			'healthcoach'),
				'rotateOutUpLeft'	=> esc_html__('Rotate Out Down Left','healthcoach'),
				'rotateOutUpRight'	=> esc_html__('Rotate Out Up Right','healthcoach'),
				'rotateOutDownLeft'	=> esc_html__('Rotate Out Up Left',	'healthcoach'),
				'rotateOutDownRight'=> esc_html__('Rotate Out Down Right','healthcoach'),
				'rollOut'			=> esc_html__('Roll Out',			'healthcoach'),
				'slideOutUp'		=> esc_html__('Slide Out Up',		'healthcoach'),
				'slideOutDown'		=> esc_html__('Slide Out Down',		'healthcoach'),
				'slideOutLeft'		=> esc_html__('Slide Out Left',		'healthcoach'),
				'slideOutRight'		=> esc_html__('Slide Out Right',	'healthcoach'),
				'zoomOut'			=> esc_html__('Zoom Out',			'healthcoach'),
				'zoomOutUp'			=> esc_html__('Zoom Out Up',		'healthcoach'),
				'zoomOutDown'		=> esc_html__('Zoom Out Down',		'healthcoach'),
				'zoomOutLeft'		=> esc_html__('Zoom Out Left',		'healthcoach'),
				'zoomOutRight'		=> esc_html__('Zoom Out Right',		'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_animations_out', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_animations_out', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return classes list for the specified animation
if (!function_exists('healthcoach_get_animation_classes')) {
	function healthcoach_get_animation_classes($animation, $speed='normal', $loop='none') {
		// speed:	fast=0.5s | normal=1s | slow=2s
		// loop:	none | infinite
		return healthcoach_param_is_off($animation) ? '' : 'animated '.esc_attr($animation).' '.esc_attr($speed).(!healthcoach_param_is_off($loop) ? ' '.esc_attr($loop) : '');
	}
}


// Return list of the main menu hover effects
if ( !function_exists( 'healthcoach_get_list_menu_hovers' ) ) {
	function healthcoach_get_list_menu_hovers($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_menu_hovers'))=='') {
			$list = array(
				'fade'			=> esc_html__('Fade',		'healthcoach'),
				'slide_line'	=> esc_html__('Slide Line',	'healthcoach'),
				'slide_box'		=> esc_html__('Slide Box',	'healthcoach'),
				'zoom_line'		=> esc_html__('Zoom Line',	'healthcoach'),
				'path_line'		=> esc_html__('Path Line',	'healthcoach'),
				'roll_down'		=> esc_html__('Roll Down',	'healthcoach'),
				'color_line'	=> esc_html__('Color Line',	'healthcoach'),
				);
			$list = apply_filters('healthcoach_filter_list_menu_hovers', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_menu_hovers', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the button's hover effects
if ( !function_exists( 'healthcoach_get_list_button_hovers' ) ) {
	function healthcoach_get_list_button_hovers($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_button_hovers'))=='') {
			$list = array(
				'default'		=> esc_html__('Default',			'healthcoach'),
				'fade'			=> esc_html__('Fade',				'healthcoach'),
				'slide_left'	=> esc_html__('Slide from Left',	'healthcoach'),
				'slide_top'		=> esc_html__('Slide from Top',		'healthcoach'),
				'arrow'			=> esc_html__('Arrow',				'healthcoach'),
				);
			$list = apply_filters('healthcoach_filter_list_button_hovers', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_button_hovers', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the input field's hover effects
if ( !function_exists( 'healthcoach_get_list_input_hovers' ) ) {
	function healthcoach_get_list_input_hovers($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_input_hovers'))=='') {
			$list = array(
				'default'	=> esc_html__('Default',	'healthcoach'),
				'accent'	=> esc_html__('Accented',	'healthcoach'),
				'path'		=> esc_html__('Path',		'healthcoach'),
				'jump'		=> esc_html__('Jump',		'healthcoach'),
				'underline'	=> esc_html__('Underline',	'healthcoach'),
				'iconed'	=> esc_html__('Iconed',		'healthcoach'),
				);
			$list = apply_filters('healthcoach_filter_list_input_hovers', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_input_hovers', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the search field's styles
if ( !function_exists( 'healthcoach_get_list_search_styles' ) ) {
	function healthcoach_get_list_search_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_search_styles'))=='') {
			$list = array(
				'default'	=> esc_html__('Default',	'healthcoach'),
				'fullscreen'=> esc_html__('Fullscreen',	'healthcoach'),
				'slide'		=> esc_html__('Slide',		'healthcoach'),
				'expand'	=> esc_html__('Expand',		'healthcoach'),
				);
			$list = apply_filters('healthcoach_filter_list_search_styles', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_search_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of categories
if ( !function_exists( 'healthcoach_get_list_categories' ) ) {
	function healthcoach_get_list_categories($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_categories'))=='') {
			$list = array();
			$args = array(
				'type'                     => 'post',
				'child_of'                 => 0,
				'parent'                   => '',
				'orderby'                  => 'name',
				'order'                    => 'ASC',
				'hide_empty'               => 0,
				'hierarchical'             => 1,
				'exclude'                  => '',
				'include'                  => '',
				'number'                   => '',
				'taxonomy'                 => 'category',
				'pad_counts'               => false );
			$taxonomies = get_categories( $args );
			if (is_array($taxonomies) && count($taxonomies) > 0) {
				foreach ($taxonomies as $cat) {
					$list[$cat->term_id] = $cat->name;
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_categories', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of taxonomies
if ( !function_exists( 'healthcoach_get_list_terms' ) ) {
	function healthcoach_get_list_terms($prepend_inherit=false, $taxonomy='category') {
		if (($list = healthcoach_storage_get('list_taxonomies_'.($taxonomy)))=='') {
			$list = array();
			if ( is_array($taxonomy) || taxonomy_exists($taxonomy) ) {
				$terms = get_terms( $taxonomy, array(
					'child_of'                 => 0,
					'parent'                   => '',
					'orderby'                  => 'name',
					'order'                    => 'ASC',
					'hide_empty'               => 0,
					'hierarchical'             => 1,
					'exclude'                  => '',
					'include'                  => '',
					'number'                   => '',
					'taxonomy'                 => $taxonomy,
					'pad_counts'               => false
					)
				);
			} else {
				$terms = healthcoach_get_terms_by_taxonomy_from_db($taxonomy);
			}
			if (!is_wp_error( $terms ) && is_array($terms) && count($terms) > 0) {
				foreach ($terms as $cat) {
					$list[$cat->term_id] = $cat->name;	
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_taxonomies_'.($taxonomy), $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list of post's types
if ( !function_exists( 'healthcoach_get_list_posts_types' ) ) {
	function healthcoach_get_list_posts_types($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_posts_types'))=='') {
			// Return only theme inheritance supported post types
			$list = apply_filters('healthcoach_filter_list_post_types', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_posts_types', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list post items from any post type and taxonomy
if ( !function_exists( 'healthcoach_get_list_posts' ) ) {
	function healthcoach_get_list_posts($prepend_inherit=false, $opt=array()) {
		$opt = array_merge(array(
			'post_type'			=> 'post',
			'post_status'		=> 'publish',
			'taxonomy'			=> 'category',
			'taxonomy_value'	=> '',
			'posts_per_page'	=> -1,
			'orderby'			=> 'post_date',
			'order'				=> 'desc',
			'return'			=> 'id'
			), is_array($opt) ? $opt : array('post_type'=>$opt));

		$hash = 'list_posts_'.($opt['post_type']).'_'.($opt['taxonomy']).'_'.($opt['taxonomy_value']).'_'.($opt['orderby']).'_'.($opt['order']).'_'.($opt['return']).'_'.($opt['posts_per_page']);
		if (($list = healthcoach_storage_get($hash))=='') {
			$list = array();
			$list['none'] = esc_html__("- Not selected -", 'healthcoach');
			$args = array(
				'post_type' => $opt['post_type'],
				'post_status' => $opt['post_status'],
				'posts_per_page' => $opt['posts_per_page'],
				'ignore_sticky_posts' => true,
				'orderby'	=> $opt['orderby'],
				'order'		=> $opt['order']
			);
			if (!empty($opt['taxonomy_value'])) {
				$args['tax_query'] = array(
					array(
						'taxonomy' => $opt['taxonomy'],
						'field' => (int) $opt['taxonomy_value'] > 0 ? 'id' : 'slug',
						'terms' => $opt['taxonomy_value']
					)
				);
			}
			$posts = get_posts( $args );
			if (is_array($posts) && count($posts) > 0) {
				foreach ($posts as $post) {
					$list[$opt['return']=='id' ? $post->ID : $post->post_title] = $post->post_title;
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set($hash, $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list pages
if ( !function_exists( 'healthcoach_get_list_pages' ) ) {
	function healthcoach_get_list_pages($prepend_inherit=false, $opt=array()) {
		$opt = array_merge(array(
			'post_type'			=> 'page',
			'post_status'		=> 'publish',
			'posts_per_page'	=> -1,
			'orderby'			=> 'title',
			'order'				=> 'asc',
			'return'			=> 'id'
			), is_array($opt) ? $opt : array('post_type'=>$opt));
		return healthcoach_get_list_posts($prepend_inherit, $opt);
	}
}


// Return list of registered users
if ( !function_exists( 'healthcoach_get_list_users' ) ) {
	function healthcoach_get_list_users($prepend_inherit=false, $roles=array('administrator', 'editor', 'author', 'contributor', 'shop_manager')) {
		if (($list = healthcoach_storage_get('list_users'))=='') {
			$list = array();
			$list['none'] = esc_html__("- Not selected -", 'healthcoach');
			$args = array(
				'orderby'	=> 'display_name',
				'order'		=> 'ASC' );
			$users = get_users( $args );
			if (is_array($users) && count($users) > 0) {
				foreach ($users as $user) {
					$accept = true;
					if (is_array($user->roles)) {
						if (is_array($user->roles) && count($user->roles) > 0) {
							$accept = false;
							foreach ($user->roles as $role) {
								if (in_array($role, $roles)) {
									$accept = true;
									break;
								}
							}
						}
					}
					if ($accept) $list[$user->user_login] = $user->display_name;
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_users', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return slider engines list, prepended inherit (if need)
if ( !function_exists( 'healthcoach_get_list_sliders' ) ) {
	function healthcoach_get_list_sliders($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_sliders'))=='') {
			$list = array(
				'swiper' => esc_html__("Posts slider (Swiper)", 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_list_sliders', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_sliders', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return slider controls list, prepended inherit (if need)
if ( !function_exists( 'healthcoach_get_list_slider_controls' ) ) {
	function healthcoach_get_list_slider_controls($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_slider_controls'))=='') {
			$list = array(
				'no'		=> esc_html__('None', 'healthcoach'),
				'side'		=> esc_html__('Side', 'healthcoach'),
				'bottom'	=> esc_html__('Bottom', 'healthcoach'),
				'pagination'=> esc_html__('Pagination', 'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_slider_controls', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_slider_controls', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return slider controls classes
if ( !function_exists( 'healthcoach_get_slider_controls_classes' ) ) {
	function healthcoach_get_slider_controls_classes($controls) {
		if (healthcoach_param_is_off($controls))	$classes = 'sc_slider_nopagination sc_slider_nocontrols';
		else if ($controls=='bottom')			$classes = 'sc_slider_nopagination sc_slider_controls sc_slider_controls_bottom';
		else if ($controls=='pagination')		$classes = 'sc_slider_pagination sc_slider_pagination_bottom sc_slider_nocontrols';
		else									$classes = 'sc_slider_nopagination sc_slider_controls sc_slider_controls_side';
		return $classes;
	}
}

// Return list with popup engines
if ( !function_exists( 'healthcoach_get_list_popup_engines' ) ) {
	function healthcoach_get_list_popup_engines($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_popup_engines'))=='') {
			$list = array(
				"pretty"	=> esc_html__("Pretty photo", 'healthcoach'),
				"magnific"	=> esc_html__("Magnific popup", 'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_popup_engines', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_popup_engines', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return menus list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_menus' ) ) {
	function healthcoach_get_list_menus($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_menus'))=='') {
			$list = array();
			$list['default'] = esc_html__("Default", 'healthcoach');
			$menus = wp_get_nav_menus();
			if (is_array($menus) && count($menus) > 0) {
				foreach ($menus as $menu) {
					$list[$menu->slug] = $menu->name;
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_menus', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return custom sidebars list, prepended inherit and main sidebars item (if need)
if ( !function_exists( 'healthcoach_get_list_sidebars' ) ) {
	function healthcoach_get_list_sidebars($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_sidebars'))=='') {
			if (($list = healthcoach_storage_get('registered_sidebars'))=='') $list = array();
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_sidebars', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return sidebars positions
if ( !function_exists( 'healthcoach_get_list_sidebars_positions' ) ) {
	function healthcoach_get_list_sidebars_positions($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_sidebars_positions'))=='') {
			$list = array(
				'none'  => esc_html__('Hide',  'healthcoach'),
				'left'  => esc_html__('Left',  'healthcoach'),
				'right' => esc_html__('Right', 'healthcoach')
				);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_sidebars_positions', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return sidebars class
if ( !function_exists( 'healthcoach_get_sidebar_class' ) ) {
	function healthcoach_get_sidebar_class() {
		$sb_main = healthcoach_get_custom_option('show_sidebar_main');
		$sb_outer = healthcoach_get_custom_option('show_sidebar_outer');
		return (healthcoach_param_is_off($sb_main) ? 'sidebar_hide' : 'sidebar_show sidebar_'.($sb_main))
				. ' ' . (healthcoach_param_is_off($sb_outer) ? 'sidebar_outer_hide' : 'sidebar_outer_show sidebar_outer_'.($sb_outer));
	}
}

// Return body styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_body_styles' ) ) {
	function healthcoach_get_list_body_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_body_styles'))=='') {
			$list = array(
				'boxed'	=> esc_html__('Boxed',		'healthcoach'),
				'wide'	=> esc_html__('Wide',		'healthcoach')
				);
			if (healthcoach_get_theme_setting('allow_fullscreen')) {
				$list['fullwide']	= esc_html__('Fullwide',	'healthcoach');
				$list['fullscreen']	= esc_html__('Fullscreen',	'healthcoach');
			}
			$list = apply_filters('healthcoach_filter_list_body_styles', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_body_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return templates list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates' ) ) {
	function healthcoach_get_list_templates($mode='') {
		if (($list = healthcoach_storage_get('list_templates_'.($mode)))=='') {
			$list = array();
			$tpl = healthcoach_storage_get('registered_templates');
			if (is_array($tpl) && count($tpl) > 0) {
				foreach ($tpl as $k=>$v) {
					if ($mode=='' || in_array($mode, explode(',', $v['mode'])))
						$list[$k] = !empty($v['icon']) 
									? $v['icon'] 
									: (!empty($v['title']) 
										? $v['title'] 
										: healthcoach_strtoproper($v['layout'])
										);
				}
			}
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_'.($mode), $list);
		}
		return $list;
	}
}

// Return blog styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates_blog' ) ) {
	function healthcoach_get_list_templates_blog($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_templates_blog'))=='') {
			$list = healthcoach_get_list_templates('blog');
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_blog', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return blogger styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates_blogger' ) ) {
	function healthcoach_get_list_templates_blogger($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_templates_blogger'))=='') {
			$list = healthcoach_array_merge(healthcoach_get_list_templates('blogger'), healthcoach_get_list_templates('blog'));
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_blogger', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return single page styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates_single' ) ) {
	function healthcoach_get_list_templates_single($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_templates_single'))=='') {
			$list = healthcoach_get_list_templates('single');
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_single', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return header styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates_header' ) ) {
	function healthcoach_get_list_templates_header($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_templates_header'))=='') {
			$list = healthcoach_get_list_templates('header');
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_header', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return form styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_templates_forms' ) ) {
	function healthcoach_get_list_templates_forms($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_templates_forms'))=='') {
			$list = healthcoach_get_list_templates('forms');
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_templates_forms', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return article styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_article_styles' ) ) {
	function healthcoach_get_list_article_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_article_styles'))=='') {
			$list = array(
				"boxed"   => esc_html__('Boxed', 'healthcoach'),
				"stretch" => esc_html__('Stretch', 'healthcoach')
				);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_article_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return post-formats filters list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_post_formats_filters' ) ) {
	function healthcoach_get_list_post_formats_filters($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_post_formats_filters'))=='') {
			$list = array(
				"no"      => esc_html__('All posts', 'healthcoach'),
				"thumbs"  => esc_html__('With thumbs', 'healthcoach'),
				"reviews" => esc_html__('With reviews', 'healthcoach'),
				"video"   => esc_html__('With videos', 'healthcoach'),
				"audio"   => esc_html__('With audios', 'healthcoach'),
				"gallery" => esc_html__('With galleries', 'healthcoach')
				);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_post_formats_filters', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return portfolio filters list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_portfolio_filters' ) ) {
	function healthcoach_get_list_portfolio_filters($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_portfolio_filters'))=='') {
			$list = array(
				"hide"		=> esc_html__('Hide', 'healthcoach'),
				"tags"		=> esc_html__('Tags', 'healthcoach'),
				"categories"=> esc_html__('Categories', 'healthcoach')
				);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_portfolio_filters', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return hover styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_hovers' ) ) {
	function healthcoach_get_list_hovers($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_hovers'))=='') {
			$list = array();
			$list['circle effect1']  = esc_html__('Circle Effect 1',  'healthcoach');
			$list['circle effect2']  = esc_html__('Circle Effect 2',  'healthcoach');
			$list['circle effect3']  = esc_html__('Circle Effect 3',  'healthcoach');
			$list['circle effect4']  = esc_html__('Circle Effect 4',  'healthcoach');
			$list['circle effect5']  = esc_html__('Circle Effect 5',  'healthcoach');
			$list['circle effect6']  = esc_html__('Circle Effect 6',  'healthcoach');
			$list['circle effect7']  = esc_html__('Circle Effect 7',  'healthcoach');
			$list['circle effect8']  = esc_html__('Circle Effect 8',  'healthcoach');
			$list['circle effect9']  = esc_html__('Circle Effect 9',  'healthcoach');
			$list['circle effect10'] = esc_html__('Circle Effect 10',  'healthcoach');
			$list['circle effect11'] = esc_html__('Circle Effect 11',  'healthcoach');
			$list['circle effect12'] = esc_html__('Circle Effect 12',  'healthcoach');
			$list['circle effect13'] = esc_html__('Circle Effect 13',  'healthcoach');
			$list['circle effect14'] = esc_html__('Circle Effect 14',  'healthcoach');
			$list['circle effect15'] = esc_html__('Circle Effect 15',  'healthcoach');
			$list['circle effect16'] = esc_html__('Circle Effect 16',  'healthcoach');
			$list['circle effect17'] = esc_html__('Circle Effect 17',  'healthcoach');
			$list['circle effect18'] = esc_html__('Circle Effect 18',  'healthcoach');
			$list['circle effect19'] = esc_html__('Circle Effect 19',  'healthcoach');
			$list['circle effect20'] = esc_html__('Circle Effect 20',  'healthcoach');
			$list['square effect1']  = esc_html__('Square Effect 1',  'healthcoach');
			$list['square effect2']  = esc_html__('Square Effect 2',  'healthcoach');
			$list['square effect3']  = esc_html__('Square Effect 3',  'healthcoach');
			$list['square effect5']  = esc_html__('Square Effect 5',  'healthcoach');
			$list['square effect6']  = esc_html__('Square Effect 6',  'healthcoach');
			$list['square effect7']  = esc_html__('Square Effect 7',  'healthcoach');
			$list['square effect8']  = esc_html__('Square Effect 8',  'healthcoach');
			$list['square effect9']  = esc_html__('Square Effect 9',  'healthcoach');
			$list['square effect10'] = esc_html__('Square Effect 10',  'healthcoach');
			$list['square effect11'] = esc_html__('Square Effect 11',  'healthcoach');
			$list['square effect12'] = esc_html__('Square Effect 12',  'healthcoach');
			$list['square effect13'] = esc_html__('Square Effect 13',  'healthcoach');
			$list['square effect14'] = esc_html__('Square Effect 14',  'healthcoach');
			$list['square effect15'] = esc_html__('Square Effect 15',  'healthcoach');
			$list['square effect_dir']   = esc_html__('Square Effect Dir',   'healthcoach');
			$list['square effect_shift'] = esc_html__('Square Effect Shift', 'healthcoach');
			$list['square effect_book']  = esc_html__('Square Effect Book',  'healthcoach');
			$list['square effect_more']  = esc_html__('Square Effect More',  'healthcoach');
			$list['square effect_fade']  = esc_html__('Square Effect Fade',  'healthcoach');
			$list['square effect_pull']  = esc_html__('Square Effect Pull',  'healthcoach');
			$list['square effect_slide'] = esc_html__('Square Effect Slide', 'healthcoach');
			$list['square effect_border'] = esc_html__('Square Effect Border', 'healthcoach');
			$list = apply_filters('healthcoach_filter_portfolio_hovers', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_hovers', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the blog counters
if ( !function_exists( 'healthcoach_get_list_blog_counters' ) ) {
	function healthcoach_get_list_blog_counters($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_blog_counters'))=='') {
			$list = array(
				'views'		=> esc_html__('Views', 'healthcoach'),
				'likes'		=> esc_html__('Likes', 'healthcoach'),
				'rating'	=> esc_html__('Rating', 'healthcoach'),
				'comments'	=> esc_html__('Comments', 'healthcoach')
				);
			$list = apply_filters('healthcoach_filter_list_blog_counters', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_blog_counters', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list of the item sizes for the portfolio alter style, prepended inherit
if ( !function_exists( 'healthcoach_get_list_alter_sizes' ) ) {
	function healthcoach_get_list_alter_sizes($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_alter_sizes'))=='') {
			$list = array(
					'1_1' => esc_html__('1x1', 'healthcoach'),
					'1_2' => esc_html__('1x2', 'healthcoach'),
					'2_1' => esc_html__('2x1', 'healthcoach'),
					'2_2' => esc_html__('2x2', 'healthcoach'),
					'1_3' => esc_html__('1x3', 'healthcoach'),
					'2_3' => esc_html__('2x3', 'healthcoach'),
					'3_1' => esc_html__('3x1', 'healthcoach'),
					'3_2' => esc_html__('3x2', 'healthcoach'),
					'3_3' => esc_html__('3x3', 'healthcoach')
					);
			$list = apply_filters('healthcoach_filter_portfolio_alter_sizes', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_alter_sizes', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return extended hover directions list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_hovers_directions' ) ) {
	function healthcoach_get_list_hovers_directions($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_hovers_directions'))=='') {
			$list = array(
				'left_to_right' => esc_html__('Left to Right',  'healthcoach'),
				'right_to_left' => esc_html__('Right to Left',  'healthcoach'),
				'top_to_bottom' => esc_html__('Top to Bottom',  'healthcoach'),
				'bottom_to_top' => esc_html__('Bottom to Top',  'healthcoach'),
				'scale_up'      => esc_html__('Scale Up',  'healthcoach'),
				'scale_down'    => esc_html__('Scale Down',  'healthcoach'),
				'scale_down_up' => esc_html__('Scale Down-Up',  'healthcoach'),
				'from_left_and_right' => esc_html__('From Left and Right',  'healthcoach'),
				'from_top_and_bottom' => esc_html__('From Top and Bottom',  'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_portfolio_hovers_directions', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_hovers_directions', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the label positions in the custom forms
if ( !function_exists( 'healthcoach_get_list_label_positions' ) ) {
	function healthcoach_get_list_label_positions($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_label_positions'))=='') {
			$list = array(
				'top'		=> esc_html__('Top',		'healthcoach'),
				'bottom'	=> esc_html__('Bottom',		'healthcoach'),
				'left'		=> esc_html__('Left',		'healthcoach'),
				'over'		=> esc_html__('Over',		'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_label_positions', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_label_positions', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the bg image positions
if ( !function_exists( 'healthcoach_get_list_bg_image_positions' ) ) {
	function healthcoach_get_list_bg_image_positions($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_bg_image_positions'))=='') {
			$list = array(
				'left top'	   => esc_html__('Left Top', 'healthcoach'),
				'center top'   => esc_html__("Center Top", 'healthcoach'),
				'right top'    => esc_html__("Right Top", 'healthcoach'),
				'left center'  => esc_html__("Left Center", 'healthcoach'),
				'center center'=> esc_html__("Center Center", 'healthcoach'),
				'right center' => esc_html__("Right Center", 'healthcoach'),
				'left bottom'  => esc_html__("Left Bottom", 'healthcoach'),
				'center bottom'=> esc_html__("Center Bottom", 'healthcoach'),
				'right bottom' => esc_html__("Right Bottom", 'healthcoach')
			);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_bg_image_positions', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the bg image repeat
if ( !function_exists( 'healthcoach_get_list_bg_image_repeats' ) ) {
	function healthcoach_get_list_bg_image_repeats($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_bg_image_repeats'))=='') {
			$list = array(
				'repeat'	=> esc_html__('Repeat', 'healthcoach'),
				'repeat-x'	=> esc_html__('Repeat X', 'healthcoach'),
				'repeat-y'	=> esc_html__('Repeat Y', 'healthcoach'),
				'no-repeat'	=> esc_html__('No Repeat', 'healthcoach')
			);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_bg_image_repeats', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the bg image attachment
if ( !function_exists( 'healthcoach_get_list_bg_image_attachments' ) ) {
	function healthcoach_get_list_bg_image_attachments($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_bg_image_attachments'))=='') {
			$list = array(
				'scroll'	=> esc_html__('Scroll', 'healthcoach'),
				'fixed'		=> esc_html__('Fixed', 'healthcoach'),
				'local'		=> esc_html__('Local', 'healthcoach')
			);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_bg_image_attachments', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}


// Return list of the bg tints
if ( !function_exists( 'healthcoach_get_list_bg_tints' ) ) {
	function healthcoach_get_list_bg_tints($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_bg_tints'))=='') {
			$list = array(
				'white'	=> esc_html__('White', 'healthcoach'),
				'light'	=> esc_html__('Light', 'healthcoach'),
				'dark'	=> esc_html__('Dark', 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_bg_tints', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_bg_tints', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return custom fields types list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_field_types' ) ) {
	function healthcoach_get_list_field_types($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_field_types'))=='') {
			$list = array(
				'text'     => esc_html__('Text',  'healthcoach'),
				'textarea' => esc_html__('Text Area','healthcoach'),
				'password' => esc_html__('Password',  'healthcoach'),
				'radio'    => esc_html__('Radio',  'healthcoach'),
				'checkbox' => esc_html__('Checkbox',  'healthcoach'),
				'select'   => esc_html__('Select',  'healthcoach'),
				'date'     => esc_html__('Date','healthcoach'),
				'time'     => esc_html__('Time','healthcoach'),
				'button'   => esc_html__('Button','healthcoach')
			);
			$list = apply_filters('healthcoach_filter_field_types', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_field_types', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return Google map styles
if ( !function_exists( 'healthcoach_get_list_googlemap_styles' ) ) {
	function healthcoach_get_list_googlemap_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_googlemap_styles'))=='') {
			$list = array(
				'default' => esc_html__('Default', 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_googlemap_styles', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_googlemap_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return images list
if (!function_exists('healthcoach_get_list_images')) {
	function healthcoach_get_list_images($folder, $ext='', $only_names=false) {
		return function_exists('trx_utils_get_folder_list') ? trx_utils_get_folder_list($folder, $ext, $only_names) : array();
	}
}

// Return iconed classes list
if ( !function_exists( 'healthcoach_get_list_icons' ) ) {
	function healthcoach_get_list_icons($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_icons'))=='') {
			$list = healthcoach_parse_icons_classes(healthcoach_get_file_dir("css/fontello/css/fontello-codes.css"));
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_icons', $list);
		}
		return $prepend_inherit ? array_merge(array('inherit'), $list) : $list;
	}
}

// Return socials list
if ( !function_exists( 'healthcoach_get_list_socials' ) ) {
	function healthcoach_get_list_socials($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_socials'))=='') {
			$list = healthcoach_get_list_images("images/socials", "png");
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_socials', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with 'Yes' and 'No' items
if ( !function_exists( 'healthcoach_get_list_yesno' ) ) {
	function healthcoach_get_list_yesno($prepend_inherit=false) {
		$list = array(
			'yes' => esc_html__("Yes", 'healthcoach'),
			'no'  => esc_html__("No", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with 'On' and 'Of' items
if ( !function_exists( 'healthcoach_get_list_onoff' ) ) {
	function healthcoach_get_list_onoff($prepend_inherit=false) {
		$list = array(
			"on" => esc_html__("On", 'healthcoach'),
			"off" => esc_html__("Off", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with 'Show' and 'Hide' items
if ( !function_exists( 'healthcoach_get_list_showhide' ) ) {
	function healthcoach_get_list_showhide($prepend_inherit=false) {
		$list = array(
			"show" => esc_html__("Show", 'healthcoach'),
			"hide" => esc_html__("Hide", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with 'Ascending' and 'Descending' items
if ( !function_exists( 'healthcoach_get_list_orderings' ) ) {
	function healthcoach_get_list_orderings($prepend_inherit=false) {
		$list = array(
			"asc" => esc_html__("Ascending", 'healthcoach'),
			"desc" => esc_html__("Descending", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with 'Horizontal' and 'Vertical' items
if ( !function_exists( 'healthcoach_get_list_directions' ) ) {
	function healthcoach_get_list_directions($prepend_inherit=false) {
		$list = array(
			"horizontal" => esc_html__("Horizontal", 'healthcoach'),
			"vertical" => esc_html__("Vertical", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with item's shapes
if ( !function_exists( 'healthcoach_get_list_shapes' ) ) {
	function healthcoach_get_list_shapes($prepend_inherit=false) {
		$list = array(
			"round"  => esc_html__("Round", 'healthcoach'),
			"square" => esc_html__("Square", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with item's sizes
if ( !function_exists( 'healthcoach_get_list_sizes' ) ) {
	function healthcoach_get_list_sizes($prepend_inherit=false) {
		$list = array(
			"tiny"   => esc_html__("Tiny", 'healthcoach'),
			"small"  => esc_html__("Small", 'healthcoach'),
			"medium" => esc_html__("Medium", 'healthcoach'),
			"large"  => esc_html__("Large", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with slider (scroll) controls positions
if ( !function_exists( 'healthcoach_get_list_controls' ) ) {
	function healthcoach_get_list_controls($prepend_inherit=false) {
		$list = array(
			"hide" => esc_html__("Hide", 'healthcoach'),
			"side" => esc_html__("Side", 'healthcoach'),
			"bottom" => esc_html__("Bottom", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with float items
if ( !function_exists( 'healthcoach_get_list_floats' ) ) {
	function healthcoach_get_list_floats($prepend_inherit=false) {
		$list = array(
			"none" => esc_html__("None", 'healthcoach'),
			"left" => esc_html__("Float Left", 'healthcoach'),
			"right" => esc_html__("Float Right", 'healthcoach')
		);
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with alignment items
if ( !function_exists( 'healthcoach_get_list_alignments' ) ) {
	function healthcoach_get_list_alignments($justify=false, $prepend_inherit=false) {
		$list = array(
			"none" => esc_html__("None", 'healthcoach'),
			"left" => esc_html__("Left", 'healthcoach'),
			"center" => esc_html__("Center", 'healthcoach'),
			"right" => esc_html__("Right", 'healthcoach')
		);
		if ($justify) $list["justify"] = esc_html__("Justify", 'healthcoach');
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with horizontal positions
if ( !function_exists( 'healthcoach_get_list_hpos' ) ) {
	function healthcoach_get_list_hpos($prepend_inherit=false, $center=false) {
		$list = array();
		$list['left'] = esc_html__("Left", 'healthcoach');
		if ($center) $list['center'] = esc_html__("Center", 'healthcoach');
		$list['right'] = esc_html__("Right", 'healthcoach');
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with vertical positions
if ( !function_exists( 'healthcoach_get_list_vpos' ) ) {
	function healthcoach_get_list_vpos($prepend_inherit=false, $center=false) {
		$list = array();
		$list['top'] = esc_html__("Top", 'healthcoach');
		if ($center) $list['center'] = esc_html__("Center", 'healthcoach');
		$list['bottom'] = esc_html__("Bottom", 'healthcoach');
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return sorting list items
if ( !function_exists( 'healthcoach_get_list_sortings' ) ) {
	function healthcoach_get_list_sortings($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_sortings'))=='') {
			$list = array(
				"date" => esc_html__("Date", 'healthcoach'),
				"title" => esc_html__("Alphabetically", 'healthcoach'),
				"views" => esc_html__("Popular (views count)", 'healthcoach'),
				"comments" => esc_html__("Most commented (comments count)", 'healthcoach'),
				"author_rating" => esc_html__("Author rating", 'healthcoach'),
				"users_rating" => esc_html__("Visitors (users) rating", 'healthcoach'),
				"random" => esc_html__("Random", 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_list_sortings', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_sortings', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list with columns widths
if ( !function_exists( 'healthcoach_get_list_columns' ) ) {
	function healthcoach_get_list_columns($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_columns'))=='') {
			$list = array(
				"none" => esc_html__("None", 'healthcoach'),
				"1_1" => esc_html__("100%", 'healthcoach'),
				"1_2" => esc_html__("1/2", 'healthcoach'),
				"1_3" => esc_html__("1/3", 'healthcoach'),
				"2_3" => esc_html__("2/3", 'healthcoach'),
				"1_4" => esc_html__("1/4", 'healthcoach'),
				"3_4" => esc_html__("3/4", 'healthcoach'),
				"1_5" => esc_html__("1/5", 'healthcoach'),
				"2_5" => esc_html__("2/5", 'healthcoach'),
				"3_5" => esc_html__("3/5", 'healthcoach'),
				"4_5" => esc_html__("4/5", 'healthcoach'),
				"1_6" => esc_html__("1/6", 'healthcoach'),
				"5_6" => esc_html__("5/6", 'healthcoach'),
				"1_7" => esc_html__("1/7", 'healthcoach'),
				"2_7" => esc_html__("2/7", 'healthcoach'),
				"3_7" => esc_html__("3/7", 'healthcoach'),
				"4_7" => esc_html__("4/7", 'healthcoach'),
				"5_7" => esc_html__("5/7", 'healthcoach'),
				"6_7" => esc_html__("6/7", 'healthcoach'),
				"1_8" => esc_html__("1/8", 'healthcoach'),
				"3_8" => esc_html__("3/8", 'healthcoach'),
				"5_8" => esc_html__("5/8", 'healthcoach'),
				"7_8" => esc_html__("7/8", 'healthcoach'),
				"1_9" => esc_html__("1/9", 'healthcoach'),
				"2_9" => esc_html__("2/9", 'healthcoach'),
				"4_9" => esc_html__("4/9", 'healthcoach'),
				"5_9" => esc_html__("5/9", 'healthcoach'),
				"7_9" => esc_html__("7/9", 'healthcoach'),
				"8_9" => esc_html__("8/9", 'healthcoach'),
				"1_10"=> esc_html__("1/10", 'healthcoach'),
				"3_10"=> esc_html__("3/10", 'healthcoach'),
				"7_10"=> esc_html__("7/10", 'healthcoach'),
				"9_10"=> esc_html__("9/10", 'healthcoach'),
				"1_11"=> esc_html__("1/11", 'healthcoach'),
				"2_11"=> esc_html__("2/11", 'healthcoach'),
				"3_11"=> esc_html__("3/11", 'healthcoach'),
				"4_11"=> esc_html__("4/11", 'healthcoach'),
				"5_11"=> esc_html__("5/11", 'healthcoach'),
				"6_11"=> esc_html__("6/11", 'healthcoach'),
				"7_11"=> esc_html__("7/11", 'healthcoach'),
				"8_11"=> esc_html__("8/11", 'healthcoach'),
				"9_11"=> esc_html__("9/11", 'healthcoach'),
				"10_11"=> esc_html__("10/11", 'healthcoach'),
				"1_12"=> esc_html__("1/12", 'healthcoach'),
				"5_12"=> esc_html__("5/12", 'healthcoach'),
				"7_12"=> esc_html__("7/12", 'healthcoach'),
				"10_12"=> esc_html__("10/12", 'healthcoach'),
				"11_12"=> esc_html__("11/12", 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_list_columns', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_columns', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return list of locations for the dedicated content
if ( !function_exists( 'healthcoach_get_list_dedicated_locations' ) ) {
	function healthcoach_get_list_dedicated_locations($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_dedicated_locations'))=='') {
			$list = array(
				"default" => esc_html__('As in the post defined', 'healthcoach'),
				"center"  => esc_html__('Above the text of the post', 'healthcoach'),
				"left"    => esc_html__('To the left the text of the post', 'healthcoach'),
				"right"   => esc_html__('To the right the text of the post', 'healthcoach'),
				"alter"   => esc_html__('Alternates for each post', 'healthcoach')
			);
			$list = apply_filters('healthcoach_filter_list_dedicated_locations', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_dedicated_locations', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return post-format name
if ( !function_exists( 'healthcoach_get_post_format_name' ) ) {
	function healthcoach_get_post_format_name($format, $single=true) {
		$name = '';
		if ($format=='gallery')		$name = $single ? esc_html__('gallery', 'healthcoach') : esc_html__('galleries', 'healthcoach');
		else if ($format=='video')	$name = $single ? esc_html__('video', 'healthcoach') : esc_html__('videos', 'healthcoach');
		else if ($format=='audio')	$name = $single ? esc_html__('audio', 'healthcoach') : esc_html__('audios', 'healthcoach');
		else if ($format=='image')	$name = $single ? esc_html__('image', 'healthcoach') : esc_html__('images', 'healthcoach');
		else if ($format=='quote')	$name = $single ? esc_html__('quote', 'healthcoach') : esc_html__('quotes', 'healthcoach');
		else if ($format=='link')	$name = $single ? esc_html__('link', 'healthcoach') : esc_html__('links', 'healthcoach');
		else if ($format=='status')	$name = $single ? esc_html__('status', 'healthcoach') : esc_html__('statuses', 'healthcoach');
		else if ($format=='aside')	$name = $single ? esc_html__('aside', 'healthcoach') : esc_html__('asides', 'healthcoach');
		else if ($format=='chat')	$name = $single ? esc_html__('chat', 'healthcoach') : esc_html__('chats', 'healthcoach');
		else						$name = $single ? esc_html__('standard', 'healthcoach') : esc_html__('standards', 'healthcoach');
		return apply_filters('healthcoach_filter_list_post_format_name', $name, $format);
	}
}

// Return post-format icon name (from Fontello library)
if ( !function_exists( 'healthcoach_get_post_format_icon' ) ) {
	function healthcoach_get_post_format_icon($format) {
		$icon = 'icon-';
		if ($format=='gallery')		$icon .= 'pictures';
		else if ($format=='video')	$icon .= 'video';
		else if ($format=='audio')	$icon .= 'note';
		else if ($format=='image')	$icon .= 'picture';
		else if ($format=='quote')	$icon .= 'quote';
		else if ($format=='link')	$icon .= 'link';
		else if ($format=='status')	$icon .= 'comment';
		else if ($format=='aside')	$icon .= 'doc-text';
		else if ($format=='chat')	$icon .= 'chat';
		else						$icon .= 'book-open';
		return apply_filters('healthcoach_filter_list_post_format_icon', $icon, $format);
	}
}

// Return fonts styles list, prepended inherit
if ( !function_exists( 'healthcoach_get_list_fonts_styles' ) ) {
	function healthcoach_get_list_fonts_styles($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_fonts_styles'))=='') {
			$list = array(
				'i' => esc_html__('I','healthcoach'),
				'u' => esc_html__('U', 'healthcoach')
			);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_fonts_styles', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return Google fonts list
if ( !function_exists( 'healthcoach_get_list_fonts' ) ) {
	function healthcoach_get_list_fonts($prepend_inherit=false) {
		if (($list = healthcoach_storage_get('list_fonts'))=='') {
			$list = array();
			$list = healthcoach_array_merge($list, healthcoach_get_list_font_faces());
			$list = healthcoach_array_merge($list, array(
				'Advent Pro' => array('family'=>'sans-serif'),
				'Alegreya Sans' => array('family'=>'sans-serif'),
				'Arimo' => array('family'=>'sans-serif'),
				'Asap' => array('family'=>'sans-serif'),
				'Averia Sans Libre' => array('family'=>'cursive'),
				'Averia Serif Libre' => array('family'=>'cursive'),
				'Bree Serif' => array('family'=>'serif',),
				'Cabin' => array('family'=>'sans-serif'),
				'Cabin Condensed' => array('family'=>'sans-serif'),
				'Caudex' => array('family'=>'serif'),
				'Comfortaa' => array('family'=>'cursive'),
				'Cousine' => array('family'=>'sans-serif'),
				'Crimson Text' => array('family'=>'serif'),
				'Cuprum' => array('family'=>'sans-serif'),
				'Dosis' => array('family'=>'sans-serif'),
				'Economica' => array('family'=>'sans-serif'),
				'Exo' => array('family'=>'sans-serif'),
				'Expletus Sans' => array('family'=>'cursive'),
				'Karla' => array('family'=>'sans-serif'),
				'Lato' => array('family'=>'sans-serif'),
				'Lekton' => array('family'=>'sans-serif'),
				'Lobster Two' => array('family'=>'cursive'),
				'Maven Pro' => array('family'=>'sans-serif'),
				'Merriweather' => array('family'=>'serif'),
				'Montserrat' => array('family'=>'sans-serif'),
				'Neuton' => array('family'=>'serif'),
				'Noticia Text' => array('family'=>'serif'),
				'Old Standard TT' => array('family'=>'serif'),
				'Open Sans' => array('family'=>'sans-serif'),
				'Orbitron' => array('family'=>'sans-serif'),
				'Oswald' => array('family'=>'sans-serif'),
				'Overlock' => array('family'=>'cursive'),
				'Oxygen' => array('family'=>'sans-serif'),
				'Philosopher' => array('family'=>'serif'),
				'PT Serif' => array('family'=>'serif'),
				'Puritan' => array('family'=>'sans-serif'),
				'Raleway' => array('family'=>'sans-serif'),
				'Roboto' => array('family'=>'sans-serif'),
				'Roboto Slab' => array('family'=>'sans-serif'),
				'Roboto Condensed' => array('family'=>'sans-serif'),
				'Rosario' => array('family'=>'sans-serif'),
				'Share' => array('family'=>'cursive'),
				'Signika' => array('family'=>'sans-serif'),
				'Signika Negative' => array('family'=>'sans-serif'),
				'Source Sans Pro' => array('family'=>'sans-serif'),
				'Tinos' => array('family'=>'serif'),
				'Ubuntu' => array('family'=>'sans-serif'),
				'Vollkorn' => array('family'=>'serif')
				)
			);
			$list = apply_filters('healthcoach_filter_list_fonts', $list);
			if (healthcoach_get_theme_setting('use_list_cache')) healthcoach_storage_set('list_fonts', $list);
		}
		return $prepend_inherit ? healthcoach_array_merge(array('inherit' => esc_html__("Inherit", 'healthcoach')), $list) : $list;
	}
}

// Return Custom font-face list
if ( !function_exists( 'healthcoach_get_list_font_faces' ) ) {
	function healthcoach_get_list_font_faces($prepend_inherit=false) {
		static $list = false;
		if (is_array($list)) return $list;
		$fonts = healthcoach_storage_get('required_custom_fonts');
		$list = array();
		if (is_array($fonts)) {
			foreach ($fonts as $font) {
				if (($url = healthcoach_get_file_url('css/font-face/'.trim($font).'/stylesheet.css'))!='') {
					$list[sprintf(esc_html__('%s (uploaded font)', 'healthcoach'), $font)] = array('css' => $url);
				}
			}
		}
		return $list;
	}
}
?>