APICHANGE: Use late static binding for Object::has_extension()

This commit is contained in:
Andrew O'Neil 2012-10-10 10:59:52 +13:00 committed by Sean Harvey
parent 48a9bcf276
commit b31188f252
3 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function init() { public function init() {
// set reading lang // set reading lang
if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) { if(SiteTree::has_extension('Translatable') && !$this->request->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree'))); Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
} }
@ -566,7 +566,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
* This bit breaks the all FileIFrameField functions if the field is used in CMS * This bit breaks the all FileIFrameField functions if the field is used in CMS
* and its relevent ajax calles, like loading the tree dropdown for TreeSelectorField. * and its relevent ajax calles, like loading the tree dropdown for TreeSelectorField.
*/ */
/* if($record && Object::has_extension('SiteTree', 'Translatable') && $record->Locale && $record->Locale != Translatable::get_current_locale()) { /* if($record && SiteTree::has_extension('Translatable') && $record->Locale && $record->Locale != Translatable::get_current_locale()) {
$record = null; $record = null;
}*/ }*/

View File

@ -366,7 +366,7 @@ HTML;
public function ContentLocale() { public function ContentLocale() {
if($this->dataRecord && $this->dataRecord->hasExtension('Translatable')) { if($this->dataRecord && $this->dataRecord->hasExtension('Translatable')) {
$locale = $this->dataRecord->Locale; $locale = $this->dataRecord->Locale;
} elseif(class_exists('Translatable') && Object::has_extension('SiteTree', 'Translatable')) { } elseif(class_exists('Translatable') && SiteTree::has_extension('Translatable')) {
$locale = Translatable::get_current_locale(); $locale = Translatable::get_current_locale();
} else { } else {
$locale = i18n::get_locale(); $locale = i18n::get_locale();

View File

@ -44,7 +44,7 @@ class RootURLController extends Controller {
// TODO Move to 'translatable' module // TODO Move to 'translatable' module
if ( if (
class_exists('Translatable') class_exists('Translatable')
&& Object::has_extension('SiteTree', 'Translatable') && SiteTree::has_extension('Translatable')
&& $link = Translatable::get_homepage_link_by_locale(Translatable::get_current_locale()) && $link = Translatable::get_homepage_link_by_locale(Translatable::get_current_locale())
) { ) {
self::$cached_homepage_link = $link; self::$cached_homepage_link = $link;