<?php


if(!function_exists('educacion_mascot_get_404_parts')) {
	/**
	 * Function that Renders Coming Soon Page HTML Codes
	 * @return HTML
	 */
	function educacion_mascot_get_404_parts() {
		$params = array();
		$section_classes_array = array();
		$params['section_classes'] = '';
		$layout = educacion_mascot_get_redux_option( '404-page-settings-layout', 'simple' );
		$section_classes_array[] = 'page-404-layout-' . $layout;

		//Text Alignment
		$params['text_align'] = educacion_mascot_get_redux_option( '404-page-settings-text-align', 'text-center' );
		
		//Add Background Overlay
		if( educacion_mascot_get_redux_option( '404-page-settings-bg-layer-overlay-status' ) ) {
			$section_classes_array[] = 'layer-overlay overlay-'.educacion_mascot_get_redux_option( '404-page-settings-bg-layer-overlay-color' ) .'-'.educacion_mascot_get_redux_option( '404-page-settings-bg-layer-overlay' );
		}

		//make array into string
		if( is_array( $section_classes_array ) && count( $section_classes_array ) ) {
			$params['section_classes'] = esc_attr(implode(' ', $section_classes_array));
		}

		$params['page_title'] = educacion_mascot_get_redux_option( '404-page-settings-title', esc_html__( "404", 'educacion-wp' ) );
		$params['page_subtitle'] = educacion_mascot_get_redux_option( '404-page-settings-subtitle', esc_html__( "Oops! Page Not Found!", 'educacion-wp' ) );
		$params['page_content'] = educacion_mascot_get_redux_option( '404-page-settings-content', esc_html__( "The page you are looking for does not exist. It might have been moved or deleted.", 'educacion-wp' ) );


		//fullscreen if not show header footer
		if( educacion_mascot_get_redux_option( '404-page-settings-show-header' ) == true || educacion_mascot_get_redux_option( '404-page-settings-show-footer' ) == true ) {
			$params['fullscreen'] = 'page-404-wrapper-padding';
		} else {
			$params['fullscreen'] = 'section-fullscreen';
		}

		//Search Box
		$params['show_search_box'] = educacion_mascot_get_redux_option( '404-page-settings-show-search-box', true );
		$params['search_box_heading'] = educacion_mascot_get_redux_option( '404-page-settings-search-box-heading' );
		$params['search_box_paragraph'] = educacion_mascot_get_redux_option( '404-page-settings-search-box-paragraph' );

		//Helpful Links
		$params['show_helpful_links'] = educacion_mascot_get_redux_option( '404-page-settings-show-helpful-links', 0 );
		$params['helpful_links_heading'] = educacion_mascot_get_redux_option( '404-page-settings-helpful-links-heading' );
		$params['helpful_links_nav'] = 'page-404-helpful-links';

		//Show Social Links
		$params['show_social_links'] = educacion_mascot_get_redux_option( '404-page-settings-show-social-links', false );

		//Back Button Label
		$params['show_back_to_home_button'] = educacion_mascot_get_redux_option( '404-page-settings-show-back-to-home-button', true );
		$params['back_to_home_button_label'] = educacion_mascot_get_redux_option( '404-page-settings-back-to-home-button-label', esc_html__( "Back to Home", 'educacion-wp' ) );

		//Produce HTML version by using the parameters (filename, variation, folder name, parameters)
		$html = educacion_mascot_get_blocks_template_part( 'template', educacion_mascot_get_redux_option( '404-page-settings-layout', 'simple' ), '404/tpl', $params );
		
		return $html;
	}
}