Bugfix: Added private static $defaultFormat in order to choose default via config. Permit WCAG validation of XHTML.

This commit is contained in:
g4b0 2013-05-13 10:57:23 +02:00 committed by g4b0
parent fd1aa197d5
commit 6d7b938b7a

View File

@ -45,6 +45,12 @@ class ContentNegotiator extends Object {
* @var boolean
*/
private static $enabled = false;
/**
* @config
* @var string
*/
private static $default_format = 'html';
/**
* Set the character set encoding for this page. By default it's utf-8, but you could change it to, say,
@ -114,7 +120,7 @@ class ContentNegotiator extends Object {
);
$q = array();
if(headers_sent()) {
$chosenFormat = "html";
$chosenFormat = Config::inst()->get('ContentNegotiator', 'default_format');
} else if(isset($_GET['forceFormat'])) {
$chosenFormat = $_GET['forceFormat'];
@ -139,7 +145,7 @@ class ContentNegotiator extends Object {
krsort($q);
$chosenFormat = reset($q);
} else {
$chosenFormat = "html";
$chosenFormat = Config::inst()->get('ContentNegotiator', 'default_format');
}
}
}