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) {
|
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();
|
$siteConfig = SiteConfig::current_site_config();
|
||||||
$form->Fields()->push(new HiddenField('Locale','', $siteConfig->Locale));
|
$form->Fields()->push(new HiddenField('Locale','', $siteConfig->Locale));
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ class TranslatableCMSMainExtension extends Extension {
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function IsTranslatableEnabled() {
|
function IsTranslatableEnabled() {
|
||||||
return Object::has_extension('SiteTree', 'Translatable');
|
return SiteTree::has_extension('Translatable');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -77,11 +77,11 @@ class LanguageDropdownField extends GroupedDropdownField {
|
|||||||
return 'languagedropdown dropdown';
|
return 'languagedropdown dropdown';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAttributes() {
|
public function getAttributes() {
|
||||||
return array_merge(
|
return array_merge(
|
||||||
parent::getAttributes(),
|
parent::getAttributes(),
|
||||||
array('data-locale-url' => $this->Link('getLocaleForObject'))
|
array('data-locale-url' => $this->Link('getLocaleForObject'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,7 +93,7 @@ class LanguageDropdownField extends GroupedDropdownField {
|
|||||||
$id = (int)$this->getRequest()->requestVar('id');
|
$id = (int)$this->getRequest()->requestVar('id');
|
||||||
$class = Convert::raw2sql($this->getRequest()->requestVar('class'));
|
$class = Convert::raw2sql($this->getRequest()->requestVar('class'));
|
||||||
$locale = Translatable::get_current_locale();
|
$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
|
// temporarily disable locale filter so that we won't filter out the object
|
||||||
Translatable::disable_locale_filter();
|
Translatable::disable_locale_filter();
|
||||||
$object = DataObject::get_by_id($class, $id);
|
$object = DataObject::get_by_id($class, $id);
|
||||||
|
@ -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 Object::has_extension('SiteTree', 'Translatable');
|
return SiteTree::has_extension('Translatable');
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1454,7 +1454,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function providePermissions() {
|
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();
|
$locales = self::get_allowed_locales();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user