ENHANCEMENT Subsite::Language field now falls back to the default set in i18n - this is useful for a good default when adding a new Subsite via SubsiteAdmin

This commit is contained in:
Sean Harvey 2010-08-23 00:30:34 +00:00
parent abed456e16
commit 5039e2ebd3

View File

@ -46,7 +46,7 @@ class Subsite extends DataObject implements PermissionProvider {
);
static $defaults = array(
'IsPublic' => 1,
'IsPublic' => 1
);
static $searchable_fields = array(
@ -103,6 +103,14 @@ class Subsite extends DataObject implements PermissionProvider {
}
}
public function getLanguage() {
if($this->getField('Language')) {
return $this->getField('Language');
} else {
return i18n::get_locale();
}
}
/**
* Whenever a Subsite is written, rewrite the hostmap
*