<?php
 
add_filter( 'ppt_blocks_args', 	array('block_text177',  'data') );
add_action( 'text177',  		array('block_text177', 'output' ) );
add_action( 'text177-css',  	array('block_text177', 'css' ) );
add_action( 'text177-js',  	array('block_text177', 'js' ) );

class block_text177 {

	function __construct(){}		

	public static function data($a){  global $CORE;
  
		$a['text177'] = array(
			"name" 		=> "Style 177",
			"image"		=> "text177.jpg",
			"cat"		=> array("text","icon"),
			"desc" 		=> "", 
			"order" 	=> 0, 
			"widget" => "ppt-text",	
			"data" 	=> array( ),
			"defaults" => array( ), 
 					
		);		
		
		return $a;
	
	} public static function output(){ global $CORE, $text_settings;
	 	 
		 
		 // ALL DEFAULT FIELDS
		 $df = ppt_theme_blocks_defaults("text"); 
		  
		$cc = array();		
		$df = array_merge($df, $cc);
		 
		// APPLY ELEMENTOR
		if(!empty($text_settings)){
			foreach($df as $k => $v){				
				if(isset($text_settings[$k]) && $text_settings[$k] != "" ){
					$df[$k] = $text_settings[$k];
				}
			}		
		}else{		 
		 	$settings =  $CORE->LAYOUT("get_block_settings_defaults_new", array("text", "text177" ) );
		 	foreach($df as $h => $j){
				if(isset($settings[$h]) && $settings[$h] != ""){
					$df[$h] = $settings[$h];
				}
			 } 
		 }   
		 
	ob_start();

    $default = array(

        1 => array(
            "icon"      => "fa-life-ring", 
            "title"     => "24/7 Support",
            "desc"      => "Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta.",
        ),
        2 => array(
            "icon"      => "fal fa-lock", 
            "title"     => "Secure Payments",
            "desc"      => "Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta.",
        ),
        3 => array(
            "icon"      => "fal fa-sync", 
            "title"     => "Monthly Updates",
            "desc"      => "Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta.",
        ),
        4 => array(
            "icon"      => "fal fa-envelope", 
            "title"     => "Email Us Anytime",
            "desc"      => "Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta.",
        ),

    );
	
	// BLOCK WRAP
	 
	?><section class="section-40">
<div class="container"> 
        
<div class="row">

 <div class="col-12">
        <div class="row">

        <?php $i =1; while($i < 9){ 
            
            if( !isset($default[$i]) && !isset($df['f'.$i.'a'])) { $i++; continue; }
            
            if(!isset($default[$i]) && $df['f'.$i.'a'] == "") { $i++; continue; }
            
            ?>  
        
          <div class="col-md-6 col-lg-3 mb-4">
          
            <div class="p-4 text-center" ppt-border1>
            
                <div data-ppt-f<?php echo $i; ?>image class=" mb-4"><span class="<?php if(isset($default[$i]['icon'])){ echo $default[$i]['icon']; } ?> fa-4x hide-mobile text-primary" data-ppt-f1icon>&nbsp;</span></div>
                <div class="mb-2 h5 text-600" data-ppt-f<?php echo $i; ?>a><?php if(isset($default[$i]['title'])){ echo $default[$i]['title']; } ?></div>
                <p class="mb-0" data-ppt-f<?php echo $i; ?>b><?php if(isset($default[$i]['desc'])){ echo $default[$i]['desc']; } ?></p>
             
            </div>
        
          </div>
     
        <?php $i++; } ?>

        </div>
    </div>
 
</div>
</div>

</section> 
<?php


		$output = ob_get_contents();
		ob_end_clean();
echo ppt_theme_block_output($output, $text_settings, array("text", "text177") );
	
	}
		public static function css(){

		ob_start();
		?>
<style>
[data-ppt-blockid="text177"].bg-dark { color:black; }
</style>
<?php	
		$output = ob_get_contents();
		ob_end_clean();
		echo $output;
		}	
		public static function js(){
		return "";
		ob_start();
		?>
<?php	
		$output = ob_get_contents();
		ob_end_clean();
		echo $output;
		}	
}

?>
