mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
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:
parent
abed456e16
commit
5039e2ebd3
@ -46,7 +46,7 @@ class Subsite extends DataObject implements PermissionProvider {
|
|||||||
);
|
);
|
||||||
|
|
||||||
static $defaults = array(
|
static $defaults = array(
|
||||||
'IsPublic' => 1,
|
'IsPublic' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
static $searchable_fields = array(
|
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
|
* Whenever a Subsite is written, rewrite the hostmap
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user