mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Added disable()
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42152 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
48eaf7f0bc
commit
266ff8a796
@ -244,6 +244,14 @@ class Translatable extends DataObjectDecorator {
|
|||||||
Translatable::$enabled = true;
|
Translatable::$enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable the multilingual feature
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static function disable() {
|
||||||
|
Translatable::$enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether multilingual support has been enabled
|
* Check whether multilingual support has been enabled
|
||||||
*
|
*
|
||||||
@ -391,6 +399,7 @@ class Translatable extends DataObjectDecorator {
|
|||||||
// Every _lang table wants Versioned support
|
// Every _lang table wants Versioned support
|
||||||
return ($this->owner->databaseFields() && $this->hasOwnTranslatableFields());
|
return ($this->owner->databaseFields() && $this->hasOwnTranslatableFields());
|
||||||
}
|
}
|
||||||
|
|
||||||
function augmentDatabase() {
|
function augmentDatabase() {
|
||||||
if (! $this->stat('enabled')) return false;
|
if (! $this->stat('enabled')) return false;
|
||||||
Translatable::set_reading_lang(Translatable::default_lang());
|
Translatable::set_reading_lang(Translatable::default_lang());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user