mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
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:
parent
02fb7b6772
commit
17195d4e86
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -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();
|
||||||
|
|
||||||
|
@ -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":
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user