diff options
author | Federico Marani <federico.marani@ymail.com> | 2009-03-07 13:54:54 +0000 |
---|---|---|
committer | Federico Marani <federico.marani@ymail.com> | 2009-03-07 13:54:54 +0000 |
commit | bab3e1b8586f42bc1f0a5f96b6990d67c6b74446 (patch) | |
tree | 559729d3330991c0c68da96350b71434ca4f6f87 /lib/htmloutputter.php | |
parent | a389f157baddafa91347c27194805580b1373e30 (diff) | |
parent | 13c183e2f4e0738233658ca79103bbe4a6d57992 (diff) |
Merge branch '0.8.x' of git://gitorious.org/laconica/dev into 0.8.x
Conflicts:
lib/util.php
Diffstat (limited to 'lib/htmloutputter.php')
-rw-r--r-- | lib/htmloutputter.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 7780b1c19..06603ac05 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -101,29 +101,32 @@ class HTMLOutputter extends XMLOutputter $type = common_negotiate_type($cp, $sp); if (!$type) { - common_user_error(_('This page is not available in a '. - 'media type you accept'), 406); - exit(0); + throw new ClientException(_('This page is not available in a '. + 'media type you accept'), 406); } } header('Content-Type: '.$type); - + $this->extraHeaders(); $this->startXML('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); - // FIXME: correct language for interface - - $language = common_language(); + $language = $this->getLanguage(); $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', 'xml:lang' => $language, 'lang' => $language)); } + function getLanguage() + { + // FIXME: correct language for interface + return common_language(); + } + /** * Ends an HTML document * @@ -134,7 +137,7 @@ class HTMLOutputter extends XMLOutputter $this->elementEnd('html'); $this->endXML(); } - + /** * To specify additional HTTP headers for the action * @@ -255,7 +258,7 @@ class HTMLOutputter extends XMLOutputter foreach ($content as $value => $option) { if ($value == $selected) { $this->element('option', array('value' => $value, - 'selected' => $value), + 'selected' => 'selected'), $option); } else { $this->element('option', array('value' => $value), $option); |