3.0 compatibibility (Object::has_extension)

SiteTree::has_extension() is only available in 3.1,
split off 3.0 compat branch to avoid deprecation warnings.

See https://github.com/silverstripe/silverstripe-translatable/issues/98#issuecomment-14020318
This commit is contained in:
Ingo Schommer 2013-02-27 10:48:57 +01:00
parent 02fb7b6772
commit 17195d4e86
3 changed files with 5 additions and 5 deletions

View File

@ -211,7 +211,7 @@ class TranslatableCMSMainExtension extends Extension {
* @return boolean * @return boolean
*/ */
function IsTranslatableEnabled() { function IsTranslatableEnabled() {
return SiteTree::has_extension('Translatable'); return Object::has_extension('SiteTree', 'Translatable');
} }
} }

View File

@ -495,7 +495,7 @@ class Translatable extends DataExtension implements PermissionProvider {
*/ */
static function is_enabled() { static function is_enabled() {
if(class_exists('SiteTree')){ if(class_exists('SiteTree')){
return SiteTree::has_extension('Translatable'); return Object::has_extension('SiteTree', 'Translatable');
}else{ }else{
return false; return false;
} }
@ -1454,7 +1454,7 @@ class Translatable extends DataExtension implements PermissionProvider {
} }
function providePermissions() { function providePermissions() {
if(!SiteTree::has_extension('Translatable') || !class_exists('SiteTree')) return false; if(!Object::has_extension('SiteTree', 'Translatable') || !class_exists('SiteTree')) return false;
$locales = self::get_allowed_locales(); $locales = self::get_allowed_locales();

View File

@ -16,8 +16,8 @@
"require": "require":
{ {
"php": ">=5.3.2", "php": ">=5.3.2",
"silverstripe/framework": ">=3.0.1", "silverstripe/framework": ">=3.0.1,<3.1",
"silverstripe/cms": ">=3.0.1" "silverstripe/cms": ">=3.0.1,<3.1"
}, },
"extra": "extra":
{ {