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:
Ingo Schommer 2007-09-16 17:23:59 +00:00
parent 48eaf7f0bc
commit 266ff8a796

View File

@ -244,6 +244,14 @@ class Translatable extends DataObjectDecorator {
Translatable::$enabled = true;
}
/**
* Disable the multilingual feature
*
*/
static function disable() {
Translatable::$enabled = false;
}
/**
* Check whether multilingual support has been enabled
*
@ -391,6 +399,7 @@ class Translatable extends DataObjectDecorator {
// Every _lang table wants Versioned support
return ($this->owner->databaseFields() && $this->hasOwnTranslatableFields());
}
function augmentDatabase() {
if (! $this->stat('enabled')) return false;
Translatable::set_reading_lang(Translatable::default_lang());