forked from hypercities/hypercities
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexportRawKml.php
More file actions
53 lines (43 loc) · 1.18 KB
/
exportRawKml.php
File metadata and controls
53 lines (43 loc) · 1.18 KB
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
47
48
49
50
51
52
53
<?php
// vim: ts=4:sw=4:nu:nospell
/**
* @file
* HyperCities query script for Collection Narrative View
*
* Return the KML file that contain all children of given collection Id
*
* @author HyperCities Tech Team
* @copyright Copyright 2008-2009, The Regents of the University of California
* @date 2009-07-18
* @version $Id$
*
*/
include_once('includes/dbUtil.inc');
include_once('includes/HCCollection.inc');
include_once('includes/HCKmlDocument.inc');
include_once('includes/serverSession.inc');
cServerSession::start();
$HC_GET = HC_sanitizeInput($_GET,
array('func'=>'str', 'cid'=>'int'),
array('cid'));
$cid = $HC_GET['cid'];
$userId = cServerSession::getUserId();
$isLogin = !empty($userId);
$isAdmin = cServerSession::isAdmin();
// Get Collection Metadata
$collectionInfo = HCCollection::getCollectionInfoById($cid, $isAdmin);
if ( $collectionInfo['object_type_id'] !== HC_OBJECT_TYPE_3D ) {
HC_reportError("Original KML not found");
}
try {
$sxe = simplexml_load_string($collectionInfo['kml']);
if ($sxe) {
header('Content-type: application/xml');
echo $sxe->asXML();
} // end if ($sxe)
}
catch (Exception $e) {
// Log Exception
sprint_r($e);
}
?>