<?
class c_services_esmo_gateway_push_kt_xsd
{
	function  show()
	{   $arr_fields=unserialize($GLOBALS['LS_kt_push_fields']) ;
		$arr=array() ;
		if (_sizeof($arr_fields)) foreach($arr_fields as $id=>$enabled) if ($enabled) $arr[]='<xs:element type="xs:string" name="'.$id.'"/>' ;
		$text=
'<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="xml_doc">
<xs:complexType>
  <xs:sequence>
    <xs:element name="item">
      <xs:complexType>
        <xs:sequence>
        '.implode("\n",$arr).'
        </xs:sequence>
        <xs:attribute type="xs:string" name="id"/>
      </xs:complexType>
    </xs:element>
  </xs:sequence>
  <xs:attribute type="xs:string" name="date"/>
</xs:complexType>
</xs:element>
</xs:schema>' ;

		header("Content-type: text/xml;charset=UTF-8") ;
		if (isset($_GET['view'])) header('Content-disposition: inline; filename="esmo_push_kt.xsd"');          // для вывода в браузер
		else                      header('Content-Disposition: attachment;filename="esmo_push_kt.xsd"');
		header('Cache-Control: public, must-revalidate, max-age=0');
		header('Pragma: public');
		//header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
		header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
		echo $text ;
	}
}

?>
