<?php
include_once('../global.php');
header("Content-type: text/css; charset: UTF-8");
if(file_exists(currentThemePath.'/settings/styleSetting.T2H'))
{
	$styleContent=stripslashes(file_get_contents(currentThemePath.'/settings/styleSetting.T2H'));						
	if($styleContent!="")
	{
		$styleOptionsVal=unserialize($styleContent);	
	}else $styleOptionsVal=array();
}

/*********Bul Export over write style info************/
if(isset($_GET['export']) && $_GET['export']=='BulkExported' && isset($_GET['expjob']) && $_GET['expjob'])
{
	//$jb[1] && $jb[2] are handled in global.php
	if(file_exists($base_dir.'/bulkExport/job-'.$jb[1].'/domain-'.$jb[2].'/styleSettings'.'.T2H'))
	{
		$thst=stripslashes(rawurldecode(file_get_contents($base_dir.'/bulkExport/job-'.$jb[1].'/domain-'.$jb[2].'/styleSettings'.'.T2H'))); 
		$topstl=unserialize($thst);
		foreach($styleOptionsVal as $k=>$v)
		{
			if(!is_array($v))
			{
				if($toptE[$k]!="")
				{
					$styleOptionsVal[$k]=$topstl[$k];
				}
			}else
			{
				foreach($v as $n=>$l)
				{
					if($topstl[$k][$n]!="")
					{
						$styleOptionsVal[$k][$n]=$topstl[$k][$n];
					}
				}	
			}	
		}
	}
	$queryString='?export=BulkExported&expjob=job-'.$jb[1].'-'.$jb['2'];
}else $queryString='';
/*********end Bulk Export over write style info************/
foreach($styleOptionsVal as $k=>$v)
{
	if(is_array($v) && array_key_exists('family',$v))
	{
		$Cssfont[]=$v['family'];	
	}	
}
$fontFamily= array_unique($Cssfont);
foreach($fontFamily as $font)
{
	if(!in_array($font,$defaultFont))
	{
		echo " @import 'https://fonts.googleapis.com/css?family=".str_replace(" ","+",$font).":800,700,600,400,300';\n";
	}
}
?>