Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #92 from Josua2012/master

FIX: Update has_extension calls.
  • Loading branch information...
commit 0f2f46367708f5aed14fae7cfac5cb8c16a76807 2 parents d92c71d + ffecb65
@wilr wilr authored
View
4 code/controller/TranslatableCMSMainExtension.php
@@ -89,7 +89,7 @@ function init() {
}
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 @@ function MultipleLanguages() {
* @return boolean
*/
function IsTranslatableEnabled() {
- return Object::has_extension('SiteTree', 'Translatable');
+ return SiteTree::has_extension('Translatable');
}
}
View
12 code/forms/LanguageDropdownField.php
@@ -77,11 +77,11 @@ function Type() {
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 @@ function getLocaleForObject() {
$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
4 code/model/Translatable.php
@@ -495,7 +495,7 @@ static function disable() {
*/
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 @@ function MetaTags(&$tags) {
}
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();
Please sign in to comment.
Something went wrong with that request. Please try again.