mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Fix Object::has_extension deprecated('xx','xx')
This commit is contained in:
parent
d92c71d1d3
commit
ffecb6553d
@ -89,7 +89,7 @@ class TranslatableCMSMainExtension extends Extension {
|
||||
}
|
||||
|
||||
function updateEditForm(&$form) {
|
||||
if($form->getName() == 'RootForm' && Object::has_extension('SiteConfig',"Translatable")) {
|
||||
if($form->getName() == 'RootForm' && SiteConfig::has_extension("Translatable")) {
|
||||
$siteConfig = SiteConfig::current_site_config();
|
||||
$form->Fields()->push(new HiddenField('Locale','', $siteConfig->Locale));
|
||||
}
|
||||
@ -211,7 +211,7 @@ class TranslatableCMSMainExtension extends Extension {
|
||||
* @return boolean
|
||||
*/
|
||||
function IsTranslatableEnabled() {
|
||||
return Object::has_extension('SiteTree', 'Translatable');
|
||||
return SiteTree::has_extension('Translatable');
|
||||
}
|
||||
|
||||
}
|
@ -93,7 +93,7 @@ class LanguageDropdownField extends GroupedDropdownField {
|
||||
$id = (int)$this->getRequest()->requestVar('id');
|
||||
$class = Convert::raw2sql($this->getRequest()->requestVar('class'));
|
||||
$locale = Translatable::get_current_locale();
|
||||
if ($id && $class && class_exists($class) && Object::has_extension($class, 'Translatable')) {
|
||||
if ($id && $class && class_exists($class) && $class::has_extension('Translatable')) {
|
||||
// temporarily disable locale filter so that we won't filter out the object
|
||||
Translatable::disable_locale_filter();
|
||||
$object = DataObject::get_by_id($class, $id);
|
||||
|
@ -495,7 +495,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
*/
|
||||
static function is_enabled() {
|
||||
if(class_exists('SiteTree')){
|
||||
return Object::has_extension('SiteTree', 'Translatable');
|
||||
return SiteTree::has_extension('Translatable');
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
@ -1454,7 +1454,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
}
|
||||
|
||||
function providePermissions() {
|
||||
if(!Object::has_extension('SiteTree', 'Translatable') || !class_exists('SiteTree')) return false;
|
||||
if(!SiteTree::has_extension('Translatable') || !class_exists('SiteTree')) return false;
|
||||
|
||||
$locales = self::get_allowed_locales();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user