mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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
This commit is contained in:
parent
d37bb428db
commit
559a4e5899
@ -81,7 +81,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
// collect languages for TinyMCE spellchecker plugin
|
// collect languages for TinyMCE spellchecker plugin
|
||||||
if(Translatable::is_enabled()) {
|
if(Translatable::is_enabled()) {
|
||||||
$spellcheckLangs = i18n::get_existing_content_languages();
|
$spellcheckLangs = Translatable::get_existing_content_languages();
|
||||||
} else {
|
} else {
|
||||||
$defaultLang = Translatable::default_lang();
|
$defaultLang = Translatable::default_lang();
|
||||||
$spellcheckLangs = array($defaultLang => i18n::get_language_name($defaultLang));
|
$spellcheckLangs = array($defaultLang => i18n::get_language_name($defaultLang));
|
||||||
@ -1188,7 +1188,7 @@ JS;
|
|||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restore a previously deleted page.
|
* Restore a previously deleted page.
|
||||||
* Internal action which shouldn't be executed through URL-handlers.
|
* Internal action which shouldn't be executed through URL-handlers.
|
||||||
@ -1376,7 +1376,7 @@ JS
|
|||||||
* Return a dropdown with existing languages
|
* Return a dropdown with existing languages
|
||||||
*/
|
*/
|
||||||
function LangSelector() {
|
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());
|
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
|
* Determine if there are more than one languages in our site tree
|
||||||
*/
|
*/
|
||||||
function MultipleLanguages() {
|
function MultipleLanguages() {
|
||||||
$langs = i18n::get_existing_content_languages('SiteTree');
|
$langs = Translatable::get_existing_content_languages('SiteTree');
|
||||||
|
|
||||||
return (count($langs) > 1);
|
return (count($langs) > 1);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ class LeftAndMain extends Controller {
|
|||||||
|
|
||||||
// set reading lang
|
// set reading lang
|
||||||
if(Translatable::is_enabled() && !Director::is_ajax()) {
|
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
|
// Allow customisation of the access check by a decorator
|
||||||
|
Loading…
Reference in New Issue
Block a user