From ff901332d2a64766472921d3d3742dc913540508 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:21:47 -0500 Subject: [PATCH 1/3] Fix the constructor for Action Also, fix the startXML() method --- lib/action.php | 15 ++++++++++++++- lib/htmloutputter.php | 2 -- lib/xmloutputter.php | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/action.php b/lib/action.php index 8694bf47c0..4aff4264d9 100644 --- a/lib/action.php +++ b/lib/action.php @@ -58,8 +58,21 @@ class Action extends HTMLOutputter // lawsuit { var $args; - function Action() + /** + * Constructor + * + * Just wraps the HTMLOutputter constructor. + * + * @param string $output URI to output to, default = stdout + * @param boolean $indent Whether to indent output, default true + * + * @see XMLOutputter::__construct + * @see HTMLOutputter::__construct + */ + + function __construct($output='php://output', $indent=true) { + parent::__construct($output, $indent); } // For initializing members of the class diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 43e4a59a98..75a995bef1 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -122,7 +122,6 @@ class HTMLOutputter extends XMLOutputter 'lang' => $language)); } - /** * Ends an HTML document * @@ -134,7 +133,6 @@ class HTMLOutputter extends XMLOutputter $this->endXML(); } - /** * Output an HTML text input element * diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 9ca0c91bd6..64935da408 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -72,7 +72,6 @@ class XMLOutputter $this->xw = new XMLWriter(); $this->xw->openURI($output); $this->xw->setIndent($indent); - $this->xw->startDocument('1.0', 'UTF-8'); } /** @@ -87,6 +86,7 @@ class XMLOutputter function startXML($doc=null, $public=null, $system=null) { + $this->xw->startDocument('1.0', 'UTF-8'); if ($doc) { $this->xw->writeDTD($doc, $public, $system); } From 8ff6dc8e32678adc1b1df5fd59fa831aec08f12a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:23:28 -0500 Subject: [PATCH 2/3] startElement() -> elementStart() in Action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/action.php b/lib/action.php index 4aff4264d9..cab51e9ea8 100644 --- a/lib/action.php +++ b/lib/action.php @@ -94,7 +94,7 @@ class Action extends HTMLOutputter // lawsuit function showHead() { // XXX: attributes (profile?) - $this->startElement('head'); + $this->elementStart('head'); $this->showTitle(); $this->showStylesheets(); $this->showScripts(); From 6a8be40a8cdce09cd994adc4ba3877cf15436128 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:24:54 -0500 Subject: [PATCH 3/3] elementElement() -> elementEnd() in Action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/action.php b/lib/action.php index cab51e9ea8..30a3c8a031 100644 --- a/lib/action.php +++ b/lib/action.php @@ -102,7 +102,7 @@ class Action extends HTMLOutputter // lawsuit $this->showFeeds(); $this->showDescription(); $this->extraHead(); - $this->elementElement('head'); + $this->elementEnd('head'); } function showTitle()