Permalink
Browse files

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

  • Loading branch information...
1 parent 48a9bcf commit b31188f2525b833753f19a81e9b59f25e29b90f1 @andrewandante andrewandante committed with halkyon Oct 9, 2012
@@ -50,7 +50,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function init() {
// 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')));
}
@@ -566,7 +566,7 @@ public function getRecord($id, $versionID = null) {
* 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.
*/
- /* 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;
}*/
@@ -366,7 +366,7 @@ public function LangAttributes() {
public function ContentLocale() {
if($this->dataRecord && $this->dataRecord->hasExtension('Translatable')) {
$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();
} else {
$locale = i18n::get_locale();
@@ -44,7 +44,7 @@ static public function get_homepage_link() {
// TODO Move to 'translatable' module
if (
class_exists('Translatable')
- && Object::has_extension('SiteTree', 'Translatable')
+ && SiteTree::has_extension('Translatable')
&& $link = Translatable::get_homepage_link_by_locale(Translatable::get_current_locale())
) {
self::$cached_homepage_link = $link;

0 comments on commit b31188f

Please sign in to comment.