-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_xml.php
More file actions
46 lines (33 loc) · 937 Bytes
/
Copy pathapi_xml.php
File metadata and controls
46 lines (33 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?PHP
// document to be used as includes for generating search results KML file
// load application header
require('includes/application_top.php');
// set header type
header("Content-Type:text/xml");
// added for page cache handeling
if (ENABLE_SITE_CACHING == 1) {
define('PRINT_PAGE',cache_page_header());
} else {
define('PRINT_PAGE',0);
}
if (!class_exists('api_xml_gen')) {
require(CLASSES_DIR.'pages/api_xml.php');
$api_xml_gen = new api_xml_gen;
}
$api_xml_gen->print_kml();
// start output buffer
ob_start();
// print header
echo '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n";
echo '<Placemarks>'."\n";
echo implode("",$api_xml_gen->list_row);
echo '</Placemarks>'."\n";
$output = ob_get_contents();
ob_end_clean();
// added for page cache handeling
if (ENABLE_SITE_CACHING == 1) {
define('DONOT_PRINT_HEADER',1);
cache_page_footer($output);
}
echo $output;
?>