bzr branch
http://darksoft.org/webbzr/adei/trunk
163
by Suren A. Chilingaryan
Handle setup-specific XSL files in javascript |
1 |
<?php
|
2 |
||
3 |
switch($_GET['target']) { |
|
4 |
case 'xslt': |
|
5 |
// header("Content-type: text/xsl");
|
|
6 |
header("Content-type: text/xml"); |
|
7 |
try { |
|
8 |
$req = new REQUEST(); |
|
9 |
$xslt = $req->GetProp("xslt"); |
|
10 |
if (!$xslt) throw new ADEIException(translate("No xslt stylesheet is specified")); |
|
11 |
$file = ADEI::GetXSLTFile($xslt); |
|
12 |
} catch (ADEIException $ex) { |
|
13 |
$ex->logInfo(NULL, $export); |
|
14 |
echo
|
|
15 |
'<?xml version="1.0" encoding="utf-8"?>
|
|
16 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
17 |
<xsl:output method="html" encoding="utf-8"/>
|
|
18 |
<xsl:template match="/">
|
|
19 |
<span class="error">' . $ex->getInfo() . '</span> |
|
20 |
</xsl:template>
|
|
21 |
</xsl:stylesheet>'; |
|
22 |
break; |
|
23 |
}
|
|
24 |
readfile($file); |
|
25 |
break; |
|
26 |
default: |
|
27 |
if (isset($_GET['target'])) $errror = translate("Unknown get target (%s) is specified", $_GET['target']); |
|
28 |
else $error = translate("The get target is not specified"); |
|
29 |
}
|
|
30 |
||
31 |
?>
|