Merge pull request #1933 from g4b0/content-negotiator-default-format

Bugfix: Added private static $defaultFormat...
This commit is contained in:
Ingo Schommer 2013-05-17 01:37:15 -07:00
commit 5e663b123b

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');
}
}
}