BUGFIX Fixed CMSMain->LangSelector() default language selection

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@76870 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-14 21:27:10 +00:00
parent d0e3ae5d6b
commit 8362026b12

View File

@ -1250,7 +1250,15 @@ JS;
function LangSelector() {
$member = Member::currentUser(); //check to see if the current user can switch langs or not
if(Permission::checkMember($member, 'VIEW_LANGS')) {
return new LanguageDropdownField('LangSelector', 'Language', array(), 'SiteTree', 'Locale-English');
$dropdown = new LanguageDropdownField(
'LangSelector',
'Language',
array(),
'SiteTree',
'Locale-English'
);
$dropdown->setValue(Translatable::get_current_locale());
return $dropdown;
}
//user doesn't have permission to switch langs so just show a string displaying current language