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

class block_header150 {

	function __construct(){}		

	public static function data($a){ 
  
		$a['header150'] = array(
			"name" 	=> "Style 150",
			"image"	=> "header150.jpg",
			"cat"	=> "header",
			"desc" 	=> "", 
			"data" 	=> array( ),
			"order" 	=> 136,
			
			"widget" => "ppt-header",
			
		);		
		
		return $a;
	
	} public static function output(){ global $CORE, $CORE_UI, $userdata, $header_settings, $df;
 
  		// ALL DEFAULT FIELDS
		 $df = ppt_theme_block_default(array("header"), 0);//
		
		// DEFAULTS
		 $cc = array(
			"topmenu_show"	 	=> 0,		 
			"btn_show" 			=> 1,
		 	"btn2_show" 		=> 1,


            "header_style" 		=> 17,
			"header_bg" 		=> "bg-light",

			"submenu_show" 		=> 1,
			"submenu_style"		=> 9,


			"submenu_bg" 		=> "bg-primary",			
			
 			
			"topmenu_bg_color" 		=> "#000",
			"header_bg_color" 		=> "#fff",
			"submenu_bg_color" 		=> "#fff",
			
			"topmenu_bg" 		=> "bg-dark",
			"topmenu_social" 	=> 1,		
			"topmenu_style" 	=> 1,
		 );	
		 
		 $df = array_merge($df, $cc);
	 
		 
		 if(is_array($header_settings) && !empty($header_settings)){ 
		 
		 	foreach($header_settings as $k => $v){			 			
				if($v != ""){
					$df[$k] = $header_settings[$k];
				}			
			}
 		
		}else{		
		
			$default_settings = $CORE->LAYOUT("get_block_settings_defaults_new", array("header", "header150" ) );	
			 		 
			foreach($default_settings as $k => $v){
				if($v != ""){
					$df[$k] = $v;
				}
			}		
		}
		
		
// LOGO
ob_start();
_ppt_template( 'framework/design/header/new/logo' );
$logoCode = ob_get_contents();
ob_end_clean();

//TOP MENU
ob_start();
_ppt_template( 'framework/design/header/new/topmenu' );
$topMenuCode = ob_get_contents();
ob_end_clean();

// HEADER
ob_start();
_ppt_template( 'framework/design/header/new/header' );
$headerCode = ob_get_contents();
ob_end_clean();

// SUB MENU
ob_start();
_ppt_template( 'framework/design/header/new/submenu' );
$submenuCode = ob_get_contents();
ob_end_clean();

$output = $headerCode.$submenuCode; 

echo str_replace("%logo%",$logoCode,str_replace("%topmenu%",$topMenuCode, ppt_theme_block_output($output, $df, array("header", "header150"))));

	
		}
		
		public static function js(){ 
		return "";
		}
		
		public static function css(){	 
		ob_start();
        ?><style>
header .dropdown-menu li { border-bottom:1px solid #efefef; } header .dropdown-menu li a { margin-left:10px; font-size: 14px; }
</style>
        <?php
		$output = ob_get_contents();
		ob_end_clean();
		echo $output;
		}	
		
}

?>