summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2008-11-23 16:13:48 -0500
committerZach Copley <zach@controlyourself.ca>2008-11-23 16:13:48 -0500
commit8d8bc706d85ce3106c88175508b89b7abe2b9aa9 (patch)
tree70182c9c50fa50353ab96276833f530b81f90e00 /lib
parent63a1b9151acba9af41aedc66422775e5e6bc8881 (diff)
Allow the toggling of XMLWriter's indenting on and off
IE needs and unindented XML response in for ajax calls. darcs-hash:20081123211348-7b5ce-426c07ee1d1884c691b659e8a9b359bb95afc61e.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/util.php b/lib/util.php
index 18e65be8b..ec62a4652 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -114,11 +114,11 @@ function common_element($tag, $attrs=NULL, $content=NULL) {
common_element_end($tag);
}
-function common_start_xml($doc=NULL, $public=NULL, $system=NULL) {
+function common_start_xml($doc=NULL, $public=NULL, $system=NULL, $indent=true) {
global $xw;
$xw = new XMLWriter();
$xw->openURI('php://output');
- $xw->setIndent(true);
+ $xw->setIndent($indent);
$xw->startDocument('1.0', 'UTF-8');
if ($doc) {
$xw->writeDTD($doc, $public, $system);
@@ -235,7 +235,7 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall=
common_element_start('div', array('id' => 'content'));
}
-function common_start_html($type=NULL) {
+function common_start_html($type=NULL, $indent=true) {
if (!$type) {
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : NULL;
@@ -255,7 +255,7 @@ function common_start_html($type=NULL) {
common_start_xml('html',
'-//W3C//DTD XHTML 1.0 Strict//EN',
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
+ 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd', $indent);
# FIXME: correct language for interface