<?php


if(!function_exists('educacion_mascot_get_projects')) {
	/**
	 * Function that Renders Service list HTML Codes
	 * @return HTML
	 */
	function educacion_mascot_get_projects( $container_type = 'container' ) {
		$params = array();

		$params['container_type'] = $container_type;

		//Produce HTML version by using the parameters (filename, variation, folder name, parameters)
		$html = educacion_mascot_get_cpt_template_part( 'projects-parts', null, 'projects/projects/tpl', $params, false );
		
		return $html;
	}
}

if ( ! function_exists( 'educacion_mascot_get_service_layout' ) ) {
	/**
	 * Returns Service Layout Type
	 *
	 */
	function educacion_mascot_get_service_layout() {
		$params = array();

		$params['holder_id'] = educacion_mascot_get_isotope_holder_ID('projects');

		$params['layout_mode'] = educacion_mascot_get_redux_option( 'cpt-settings-service-archive-layout-mode' );
		$params['items_per_row'] = educacion_mascot_get_redux_option( 'cpt-settings-service-archive-items-per-row' );

		
		//Produce HTML version by using the parameters (filename, variation, folder name, parameters)
		$html = educacion_mascot_get_cpt_template_part( 'projects-content', null, 'projects/projects/tpl/content', $params, false );
		
		return $html;
	}
}


if ( ! function_exists( 'educacion_mascot_get_service_info' ) ) {
	/**
	 * Returns Service Info
	 *
	 */
	function educacion_mascot_get_service_info() {
		$params = array();

		
		//Produce HTML version by using the parameters (filename, variation, folder name, parameters)
		$html = educacion_mascot_get_cpt_template_part( 'service-info', null, 'projects/projects/tpl/parts', $params, false );
		
		return $html;
	}
}


if(!function_exists('educacion_mascot_get_service_thumb')) {
	/**
	 * Returns Service Thumb
	 * @return HTML
	 */
	function educacion_mascot_get_service_thumb() {
		$params = array();

		$params['thumbnail_orientation'] = educacion_mascot_get_redux_option( 'cpt-settings-service-archive-thumbnail-orientation' );
		$params['thumbnail_ratio'] = educacion_mascot_get_redux_option( 'cpt-settings-service-archive-thumbnail-ratio' );

		//image dimension
		$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
		$full_image_url = $full_image_url[0];

		$image_dimension = educacion_mascot_get_image_dimensions( $params['thumbnail_orientation'], $params['thumbnail_ratio'] );

		//create resized image
		$resized_image = educacion_mascot_matthewruddy_image_resize( $full_image_url, $image_dimension['width'], $image_dimension['height'], true );

		// if has no post thubnail or gallery images then add placeholder image
		if( !is_array( $resized_image ) || !$resized_image['url'] || $resized_image['url'] == '' ) {
			$resized_image = array();
			$full_image_url = $resized_image['url'] = "//placehold.it/".$image_dimension['width']."x".$image_dimension['height']."?text=Image Not Found!";
		}
		$params['resized_image'] = $resized_image;
		$params['image_dimension'] = $image_dimension;

		//Produce HTML version by using the parameters (filename, variation, folder name, parameters)
		$html = educacion_mascot_get_cpt_template_part( 'thumb', null, 'projects/projects/tpl/parts', $params, false );
		
		return $html;
	}
}