From 559a4e589927435a532c5931825751e89c7cca9e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 8 Jan 2009 03:36:58 +0000 Subject: [PATCH] ENHANCEMENT Moved i18n::get_existing_content_languages() to correct namespace in Translatable::get_existing_content_languages(). BUGFIX Using SQL DISTINCT in get_existing_content_languages() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@69891 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 8 ++++---- code/LeftAndMain.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index 6caec282..bc475a3f 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -81,7 +81,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr // collect languages for TinyMCE spellchecker plugin if(Translatable::is_enabled()) { - $spellcheckLangs = i18n::get_existing_content_languages(); + $spellcheckLangs = Translatable::get_existing_content_languages(); } else { $defaultLang = Translatable::default_lang(); $spellcheckLangs = array($defaultLang => i18n::get_language_name($defaultLang)); @@ -1188,7 +1188,7 @@ JS; return $response; } - + /** * Restore a previously deleted page. * Internal action which shouldn't be executed through URL-handlers. @@ -1376,7 +1376,7 @@ JS * Return a dropdown with existing languages */ function LangSelector() { - $langs = i18n::get_existing_content_languages('SiteTree'); + $langs = Translatable::get_existing_content_languages('SiteTree'); return new DropdownField("LangSelector","Language",$langs,Translatable::current_lang()); } @@ -1385,7 +1385,7 @@ JS * Determine if there are more than one languages in our site tree */ function MultipleLanguages() { - $langs = i18n::get_existing_content_languages('SiteTree'); + $langs = Translatable::get_existing_content_languages('SiteTree'); return (count($langs) > 1); } diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 42d57f4a..06903653 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -116,7 +116,7 @@ class LeftAndMain extends Controller { // set reading lang if(Translatable::is_enabled() && !Director::is_ajax()) { - Translatable::choose_site_lang(array_keys(i18n::get_existing_content_languages('SiteTree'))); + Translatable::choose_site_lang(array_keys(Translatable::get_existing_content_languages('SiteTree'))); } // Allow customisation of the access check by a decorator