diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-12-05 01:03:04 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-05 01:03:04 -0500 |
commit | 51f0dd5e37db0e8d2a8690655555d399249942df (patch) | |
tree | 33238b09ad63eaefdb2c6499da8bab59d91188ed /lib | |
parent | c08d7f1aa4ac235f524da3994c2f1aef3b0fd079 (diff) |
Add configuration option to toggle the indenting of the output HTML. Defaults to indent enabled.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 2 | ||||
-rw-r--r-- | lib/default.php | 1 | ||||
-rw-r--r-- | lib/error.php | 2 | ||||
-rw-r--r-- | lib/htmloutputter.php | 2 | ||||
-rw-r--r-- | lib/rssaction.php | 2 | ||||
-rw-r--r-- | lib/xmloutputter.php | 5 |
6 files changed, 9 insertions, 5 deletions
diff --git a/lib/action.php b/lib/action.php index 8ad391755..87d8a4399 100644 --- a/lib/action.php +++ b/lib/action.php @@ -68,7 +68,7 @@ class Action extends HTMLOutputter // lawsuit * @see XMLOutputter::__construct * @see HTMLOutputter::__construct */ - function __construct($output='php://output', $indent=true) + function __construct($output='php://output', $indent=null) { parent::__construct($output, $indent); } diff --git a/lib/default.php b/lib/default.php index d4ef045ea..db90aeca3 100644 --- a/lib/default.php +++ b/lib/default.php @@ -53,6 +53,7 @@ $default = 'shorturllength' => 30, 'dupelimit' => 60, # default for same person saying the same thing 'textlimit' => 140, + 'indent' => true, ), 'db' => array('database' => 'YOU HAVE TO SET THIS IN config.php', diff --git a/lib/error.php b/lib/error.php index 3162cfe65..87a4d913b 100644 --- a/lib/error.php +++ b/lib/error.php @@ -50,7 +50,7 @@ class ErrorAction extends Action var $message = null; var $default = null; - function __construct($message, $code, $output='php://output', $indent=true) + function __construct($message, $code, $output='php://output', $indent=null) { parent::__construct($output, $indent); diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index fd448ced5..2091c6e2c 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -67,7 +67,7 @@ class HTMLOutputter extends XMLOutputter * @param boolean $indent Whether to indent output, default true */ - function __construct($output='php://output', $indent=true) + function __construct($output='php://output', $indent=null) { parent::__construct($output, $indent); } diff --git a/lib/rssaction.php b/lib/rssaction.php index d591c99ed..62e3f21b6 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -52,7 +52,7 @@ class Rss10Action extends Action * @see Action::__construct */ - function __construct($output='php://output', $indent=true) + function __construct($output='php://output', $indent=null) { parent::__construct($output, $indent); } diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 5f06e491d..15b18e7d9 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -67,10 +67,13 @@ class XMLOutputter * @param boolean $indent Whether to indent output, default true */ - function __construct($output='php://output', $indent=true) + function __construct($output='php://output', $indent=null) { $this->xw = new XMLWriter(); $this->xw->openURI($output); + if(is_null($indent)) { + $indent = common_config('site', 'indent'); + } $this->xw->setIndent($indent); } |