Merge pull request #92 from Josua2012/master

FIX: Update has_extension calls.
This commit is contained in:
Will Rossiter 2013-02-01 14:03:43 -08:00
commit 0f2f463677
3 changed files with 10 additions and 10 deletions

View File

@ -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');
}
}

View File

@ -77,11 +77,11 @@ class LanguageDropdownField extends GroupedDropdownField {
return 'languagedropdown dropdown';
}
public function getAttributes() {
return array_merge(
parent::getAttributes(),
array('data-locale-url' => $this->Link('getLocaleForObject'))
);
public function getAttributes() {
return array_merge(
parent::getAttributes(),
array('data-locale-url' => $this->Link('getLocaleForObject'))
);
}
/**
@ -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);

View File

@ -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();