Add configuration option to toggle the indenting of the output HTML. Defaults to indent enabled.
This commit is contained in:
parent
c08d7f1aa4
commit
51f0dd5e37
@ -71,7 +71,7 @@ class TwitapisearchatomAction extends ApiAction
|
||||
* @see Action::__construct
|
||||
*/
|
||||
|
||||
function __construct($output='php://output', $indent=true)
|
||||
function __construct($output='php://output', $indent=null)
|
||||
{
|
||||
parent::__construct($output, $indent);
|
||||
}
|
||||
|
@ -236,6 +236,11 @@ $config['sphinx']['port'] = 3312;
|
||||
// Use a different hostname for SSL-encrypted pages
|
||||
// $config['site']['sslserver'] = 'secure.example.org';
|
||||
|
||||
// Indent HTML and XML
|
||||
// Enable (default) for easier to read markup for developers,
|
||||
// disable to save some bandwidth.
|
||||
// $config['site']['indent'] = true;
|
||||
|
||||
// If you have a lot of status networks on the same server, you can
|
||||
// store the site data in a database and switch as follows
|
||||
// Status_network::setupDB('localhost', 'statusnet', 'statuspass', 'statusnet');
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ class FacebookAction extends Action
|
||||
var $app_uri = null;
|
||||
var $app_name = null;
|
||||
|
||||
function __construct($output='php://output', $indent=true, $facebook=null, $flink=null)
|
||||
function __construct($output='php://output', $indent=null, $facebook=null, $flink=null)
|
||||
{
|
||||
parent::__construct($output, $indent);
|
||||
|
||||
|
@ -168,7 +168,7 @@ function facebookBroadcastNotice($notice)
|
||||
|
||||
function updateProfileBox($facebook, $flink, $notice) {
|
||||
$fbaction = new FacebookAction($output = 'php://output',
|
||||
$indent = true, $facebook, $flink);
|
||||
$indent = null, $facebook, $flink);
|
||||
$fbaction->updateProfileBox($notice);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user