本文整理匯總了PHP中Translatable::get_existing_content_languages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translatable::get_existing_content_languages方法的具體用法?PHP Translatable::get_existing_content_languages怎麽用?PHP Translatable::get_existing_content_languages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translatable
的用法示例。
在下文中一共展示了Translatable::get_existing_content_languages方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init()
{
// set reading lang
if (SiteTree::has_extension('Translatable') && !$this->getRequest()->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
parent::init();
Versioned::reading_stage("Stage");
Requirements::css(CMS_DIR . '/css/screen.css');
Requirements::customCSS($this->generatePageIconsCss());
Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
// Check legacy actions
$legacy = $this->config()->enabled_legacy_actions;
// Delete from live is unnecessary since we have unpublish which does the same thing
if (in_array('CMSBatchAction_DeleteFromLive', $legacy)) {
Deprecation::notice('4.0', 'Delete From Live is deprecated. Use Un-publish instead');
CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
}
// Delete action
if (in_array('CMSBatchAction_Delete', $legacy)) {
Deprecation::notice('4.0', 'Delete from Stage is deprecated. Use Archive instead.');
CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
} else {
CMSBatchActionHandler::register('archive', 'CMSBatchAction_Archive');
CMSBatchActionHandler::register('restore', 'CMSBatchAction_Restore');
}
}
示例2: init
public function init() {
// set reading lang
if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
parent::init();
Requirements::css(CMS_DIR . '/css/screen.css');
Requirements::combine_files(
'cmsmain.js',
array_merge(
array(
CMS_DIR . '/javascript/CMSMain.js',
CMS_DIR . '/javascript/CMSMain.EditForm.js',
CMS_DIR . '/javascript/CMSMain.AddForm.js',
CMS_DIR . '/javascript/CMSPageHistoryController.js',
CMS_DIR . '/javascript/CMSMain.Tree.js',
CMS_DIR . '/javascript/SilverStripeNavigator.js'
),
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)
)
);
CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
}
示例3: __construct
/**
* Create a new LanguageDropdownField
* @param string $name
* @param string $title
* @param array $excludeLocales List of locales that won't be included
* @param string $translatingClass Name of the class with translated instances where to look for used languages
* @param string $list Indicates the source language list. Can be either Common-English, Common-Native, Locale-English, Locale-Native
*/
function __construct($name, $title, $excludeLocales = array(), $translatingClass = 'SiteTree', $list = 'Common-English', $instance = null)
{
$usedLocalesWithTitle = Translatable::get_existing_content_languages($translatingClass);
$usedLocalesWithTitle = array_diff_key($usedLocalesWithTitle, $excludeLocales);
if ('Common-English' == $list) {
$allLocalesWithTitle = i18n::get_common_languages();
} else {
if ('Common-Native' == $list) {
$allLocalesWithTitle = i18n::get_common_languages(true);
} else {
if ('Locale-English' == $list) {
$allLocalesWithTitle = i18n::get_common_locales();
} else {
if ('Locale-Native' == $list) {
$allLocalesWithTitle = i18n::get_common_locales(true);
} else {
$allLocalesWithTitle = i18n::get_locale_list();
}
}
}
}
if (isset($allLocales[Translatable::default_locale()])) {
unset($allLocales[Translatable::default_locale()]);
}
// Limit to allowed locales if defined
// Check for canTranslate() if an $instance is given
$allowedLocales = Translatable::get_allowed_locales();
foreach ($allLocalesWithTitle as $locale => $localeTitle) {
if ($allowedLocales && !in_array($locale, $allowedLocales) || $excludeLocales && in_array($locale, $excludeLocales) || $usedLocalesWithTitle && array_key_exists($locale, $usedLocalesWithTitle)) {
unset($allLocalesWithTitle[$locale]);
}
}
// instance specific permissions
foreach ($allLocalesWithTitle as $locale => $localeTitle) {
if ($instance && !$instance->canTranslate(null, $locale)) {
unset($allLocalesWithTitle[$locale]);
}
}
foreach ($usedLocalesWithTitle as $locale => $localeTitle) {
if ($instance && !$instance->canTranslate(null, $locale)) {
unset($usedLocalesWithTitle[$locale]);
}
}
// Sort by title (array value)
asort($allLocalesWithTitle);
if (count($usedLocalesWithTitle)) {
asort($usedLocalesWithTitle);
$source = array(_t('Form.LANGAVAIL', "Available languages") => $usedLocalesWithTitle, _t('Form.LANGAOTHER', "Other languages") => $allLocalesWithTitle);
} else {
$source = $allLocalesWithTitle;
}
parent::__construct($name, $title, $source);
}
示例4: scaffoldFormField
/**
* Returns a LanguageDropdownField instance used as a default for form
* scaffolding.
*
* @param string $title Optional. Localized title of the generated instance
* @param array $params Optional.
*
* @return FormField
*
* @author Sebastian Diel <sdiel@pixeltricks.de>
* @since 20.03.2013
*/
public function scaffoldFormField($title = null, $params = null)
{
if (is_null($title)) {
$title = _t('SilvercartConfig.TRANSLATION');
}
$instance = null;
$alreadyTranslatedLocales = array();
$translatingClass = 'SiteTree';
if (array_key_exists('object', $params)) {
$translatingClass = $params['object']->ClassName;
$instance = $params['object'];
}
if ($instance) {
$alreadyTranslatedLocales = $instance->getTranslatedLocales();
unset($alreadyTranslatedLocales[$instance->Locale]);
}
$localeDropdown = new LanguageDropdownField($this->name, $title, $alreadyTranslatedLocales, $translatingClass, 'Locale-Native', $instance);
$currentLocale = Translatable::get_current_locale();
$localesWithTitle = $localeDropdown->getSource();
$usedLocalesWithTitle = Translatable::get_existing_content_languages('SiteTree');
$languageList = array();
$usedLanguageList = array();
foreach ($localesWithTitle as $locale => $localeTitle) {
if (is_array($localeTitle)) {
foreach ($localeTitle as $locale2 => $title2) {
$title2 = SilvercartLanguageHelper::getLanguageDisplayTitle($locale2, $currentLocale);
if (array_key_exists($locale2, $usedLocalesWithTitle)) {
$usedLanguageList[$locale2] = $title2;
unset($languageList[$locale2]);
} else {
$languageList[$locale2] = $title2;
}
}
} else {
$localeTitle = SilvercartLanguageHelper::getLanguageDisplayTitle($locale, $currentLocale);
if (array_key_exists($locale, $usedLocalesWithTitle)) {
$usedLanguageList[$locale] = $localeTitle;
unset($languageList[$locale]);
} else {
$languageList[$locale] = $localeTitle;
}
}
}
asort($languageList);
if (count($usedLanguageList)) {
asort($usedLanguageList);
$languageList = array(_t('Form.LANGAVAIL', "Available languages") => $usedLanguageList, _t('Form.LANGAOTHER', "Other languages") => $languageList);
}
$localeDropdown->setSource($languageList);
return $localeDropdown;
}
示例5: __construct
/**
* Create a new LanguageDropdownField
* @param string $name
* @param string $title
* @param array $dontInclude list of languages that won't be included
* @param string $translatingClass Name of the class with translated instances where to look for used languages
* @param string $list Indicates the source language list. Can be either Common-English, Common-Native Locale
*/
function __construct($name, $title, $dontInclude = array(), $translatingClass = 'SiteTree', $list = 'Common-English' ) {
$usedlangs = array_diff(
Translatable::get_existing_content_languages($translatingClass),
$dontInclude
);
// we accept in dontInclude both language codes and names, so another diff is required
$usedlangs = array_diff(
$usedlangs,
array_flip($dontInclude)
);
if (isset($usedlangs[Translatable::default_lang()])) unset($usedlangs[Translatable::default_lang()]);
if ('Common-English' == $list) $languageList = i18n::get_common_languages();
else if ('Common-Native' == $list) $languageList = i18n::get_common_languages(true);
else $languageList = i18n::get_locale_list();
$alllangs = array_diff(
$languageList,
(array)$usedlangs,
$dontInclude
);
$alllangs = array_flip(array_diff(
array_flip($alllangs),
$dontInclude
));
if (isset($alllangs[Translatable::default_lang()])) unset($alllangs[Translatable::default_lang()]);
asort($alllangs);
if (count($usedlangs)) {
asort($usedlangs);
$labelAvail = _t('Form.LANGAVAIL', "Available languages");
$labelOther = _t('Form.LANGAOTHER', "Other languages");
parent::__construct($name, $title, array(
$labelAvail => $usedlangs,
$labelOther => $alllangs
),
reset($usedlangs)
);
}
else {
parent::__construct($name, $title, $alllangs);
}
}
示例6: init
public function init()
{
// set reading lang
if (Object::has_extension('ContentModule', 'Translatable') && !$this->request->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('ContentModule')));
}
parent::init();
Versioned::reading_stage("Stage");
Requirements::css(CMS_DIR . '/css/screen.css');
Requirements::css(INPAGE_MODULES_DIR . '/css/ContentModule_Admin.css');
Requirements::combine_files('contentmodulemain.js', array_merge(array(CMS_DIR . '/javascript/CMSPageHistoryController.js')));
//CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
//CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
//CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
//CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
if (isset($_REQUEST['ID'])) {
$this->setCurrentPageID($_REQUEST['ID']);
}
}
示例7: get_locale_from_prefix
/**
* return the $locale based on the language prefix. If no locale is given,
* the default Translatable locale is assumed.
*
* @param string prefix
* @return string locale
*/
public static function get_locale_from_prefix($prefix = '')
{
// no prefix? must be root url, so set locale to default
if (empty($prefix)) {
return Translatable::default_locale();
}
// language prefixes defined?
if (!empty(self::$locale_prefix_map)) {
$arrayLocale = array_flip(self::$locale_prefix_map);
$locale = isset($arrayLocale[$prefix]) ? $arrayLocale[$prefix] : '';
// no prefixes defined so we use the locale as a prefix
} else {
$locale = $prefix;
}
// do we have a valid locale?
if ($locale) {
$validLocales = Translatable::get_existing_content_languages();
if (!array_key_exists($locale, $validLocales)) {
$locale = '';
}
}
// should we consider an empty locale at this point as faulty
return $locale;
}
示例8: init
/**
* @uses LeftAndMainDecorator->init()
* @uses LeftAndMainDecorator->accessedCMS()
* @uses CMSMenu
*/
function init()
{
parent::init();
SSViewer::setOption('rewriteHashlinks', false);
// set language
$member = Member::currentUser();
if (!empty($member->Locale)) {
i18n::set_locale($member->Locale);
}
if (!empty($member->DateFormat)) {
i18n::set_date_format($member->DateFormat);
}
if (!empty($member->TimeFormat)) {
i18n::set_time_format($member->TimeFormat);
}
// can't be done in cms/_config.php as locale is not set yet
CMSMenu::add_link('Help', _t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'), self::$help_link);
// set reading lang
if (Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
// Allow customisation of the access check by a decorator
// Also all the canView() check to execute Director::redirect()
if (!$this->canView() && !$this->response->isFinished()) {
// When access /admin/, we should try a redirect to another part of the admin rather than be locked out
$menu = $this->MainMenu();
foreach ($menu as $candidate) {
if ($candidate->Link && $candidate->Link != $this->Link() && $candidate->MenuItem->controller && singleton($candidate->MenuItem->controller)->canView()) {
return Director::redirect($candidate->Link);
}
}
if (Member::currentUser()) {
Session::set("BackURL", null);
}
// if no alternate menu items have matched, return a permission error
$messageSet = array('default' => _t('LeftAndMain.PERMDEFAULT', "Please choose an authentication method and enter your credentials to access the CMS."), 'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY', "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below"), 'logInAgain' => _t('LeftAndMain.PERMAGAIN', "You have been logged out of the CMS. If you would like to log in again, enter a username and password below."));
return Security::permissionFailure($this, $messageSet);
}
// Don't continue if there's already been a redirection request.
if (Director::redirected_to()) {
return;
}
// Audit logging hook
if (empty($_REQUEST['executeForm']) && !$this->isAjax()) {
$this->extend('accessedCMS');
}
// Set the members html editor config
HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
// Set default values in the config if missing. These things can't be defined in the config
// file because insufficient information exists when that is being processed
$htmlEditorConfig = HtmlEditorConfig::get_active();
$htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
if (!$htmlEditorConfig->getOption('content_css')) {
$cssFiles = 'cms/css/editor.css';
// Use theme from the site config
if (($config = SiteConfig::current_site_config()) && $config->Theme) {
$theme = $config->Theme;
} elseif (SSViewer::current_theme()) {
$theme = SSViewer::current_theme();
} else {
$theme = false;
}
if ($theme) {
$cssFiles .= ',' . THEMES_DIR . "/{$theme}/css/editor.css";
} else {
if (project()) {
$cssFiles .= ',' . project() . '/css/editor.css';
}
}
$htmlEditorConfig->setOption('content_css', $cssFiles);
}
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/layout.css');
Requirements::css(CMS_DIR . '/css/cms_left.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
Requirements::css(SAPPHIRE_DIR . '/css/Form.css');
if (isset($_REQUEST['debug_firebug'])) {
// Firebug is a useful console for debugging javascript
// Its available as a Firefox extension or a javascript library
// for easy inclusion in other browsers (just append ?debug_firebug=1 to the URL)
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/firebug-lite/firebug.js');
} else {
// By default, we include fake-objects for all firebug calls
// to avoid javascript errors when referencing console.log() etc in javascript code
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/firebug-lite/firebugx.js');
}
Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototypefix/intro.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototypefix/outro.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/jquery_improvements.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
//import all of jquery ui
Requirements::javascript(CMS_DIR . '/thirdparty/jquery-layout/jquery.layout.js');
Requirements::javascript(CMS_DIR . '/thirdparty/jquery-layout/jquery.layout.state.js');
//.........這裏部分代碼省略.........
示例9: MultipleLanguages
/**
* Determine if there are more than one languages in our site tree.
*
* @return boolean
*/
function MultipleLanguages()
{
$langs = Translatable::get_existing_content_languages('SiteTree');
return count($langs) > 1;
}
示例10: get_target_locales
/**
* Get the locales that should be translated
* @return array containing the locales to use
*/
protected static function get_target_locales()
{
// if locales are explicitly set, use these
if (is_array(self::config()->locales)) {
return (array) self::config()->locales;
// otherwise check the allowed locales. If these have been set, use these
} else {
if (is_array(Translatable::get_allowed_locales())) {
return (array) Translatable::get_allowed_locales();
}
}
// last resort is to take the existing content languages
return array_keys(Translatable::get_existing_content_languages());
}
示例11: init
/**
* @uses LeftAndMainDecorator->init()
* @uses LeftAndMainDecorator->accessedCMS()
* @uses CMSMenu
* @uses Director::set_site_mode()
*/
function init() {
parent::init();
Director::set_site_mode('cms');
// set language
$member = Member::currentUser();
if(!empty($member->Locale)) {
i18n::set_locale($member->Locale);
}
// can't be done in cms/_config.php as locale is not set yet
CMSMenu::add_link(
'Help',
_t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'),
'http://userhelp.silverstripe.com'
);
// set reading lang
if(Translatable::is_enabled() && !Director::is_ajax()) {
Translatable::choose_site_lang(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
// Allow customisation of the access check by a decorator
if(!$this->canView()) {
// When access /admin/, we should try a redirect to another part of the admin rather than be locked out
$menu = $this->MainMenu();
foreach($menu as $candidate) {
if(
$candidate->Link &&
$candidate->Link != $this->Link()
&& $candidate->MenuItem->controller
&& singleton($candidate->MenuItem->controller)->canView()
) {
return Director::redirect($candidate->Link);
}
}
if(Member::currentUser()) {
Session::set("BackURL", null);
}
// if no alternate menu items have matched, return a permission error
$messageSet = array(
'default' => _t('LeftAndMain.PERMDEFAULT',"Please choose an authentication method and enter your credentials to access the CMS."),
'alreadyLoggedIn' => _t('LeftAndMain.PERMALREADY',"I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below"),
'logInAgain' => _t('LeftAndMain.PERMAGAIN',"You have been logged out of the CMS. If you would like to log in again, enter a username and password below."),
);
return Security::permissionFailure($this, $messageSet);
}
// Don't continue if there's already been a redirection request.
if(Director::redirected_to()) return;
// Audit logging hook
if(empty($_REQUEST['executeForm']) && !Director::is_ajax()) $this->extend('accessedCMS');
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/layout.css');
Requirements::css(CMS_DIR . '/css/cms_left.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
Requirements::css(SAPPHIRE_DIR . '/css/Form.css');
if(isset($_REQUEST['debug_firebug'])) {
// Firebug is a useful console for debugging javascript
// Its available as a Firefox extension or a javascript library
// for easy inclusion in other browsers (just append ?debug_firebug=1 to the URL)
Requirements::javascript(THIRDPARTY_DIR . '/firebug/firebug-lite-compressed.js');
} else {
// By default, we include fake-objects for all firebug calls
// to avoid javascript errors when referencing console.log() etc in javascript code
Requirements::javascript(THIRDPARTY_DIR . '/firebug/firebugx.js');
}
Requirements::javascript(THIRDPARTY_DIR . '/prototype.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery_improvements.js');
Requirements::javascript(THIRDPARTY_DIR . '/behaviour.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/livequery/jquery.livequery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/core/jquery.ondemand.js');
Requirements::javascript(THIRDPARTY_DIR . '/prototype_improvements.js');
Requirements::javascript(THIRDPARTY_DIR . '/loader.js');
Requirements::javascript(THIRDPARTY_DIR . '/hover.js');
Requirements::javascript(THIRDPARTY_DIR . '/layout_helpers.js');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/i18n.js");
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/dragdrop.js');
Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/controls.js');
Requirements::css(THIRDPARTY_DIR . '/greybox/greybox.css');
Requirements::javascript(THIRDPARTY_DIR . '/greybox/AmiJS.js');
Requirements::javascript(THIRDPARTY_DIR . '/greybox/greybox.js');
//.........這裏部分代碼省略.........
示例12: init
function init() {
// set language
$member = Member::currentUser();
if(!empty($member->Locale)) {
i18n::set_locale($member->Locale);
}
// set reading lang
if(Translatable::is_enabled() && !Director::is_ajax()) {
Translatable::choose_site_lang(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
parent::init();
}
示例13: prepareLanguageDropdownField
/**
* Creates and returns the language dropdown field
*
* @param DataObject $dataObj DataObject to get dropdown for
* @param string $translatingClass Context class of the LanguageDropdownField
* @param string $fieldName Name of the LanguageDropdownField
*
* @return LanguageDropdownField
*
* @author Sebastian Diel <sdiel@pixeltricks.de>
* @since 21.12.2015
*/
public static function prepareLanguageDropdownField($dataObj, $translatingClass = null, $fieldName = 'Locale')
{
$instance = null;
$alreadyTranslatedLocales = array();
if (is_null($translatingClass)) {
$translatingClass = $dataObj->ClassName;
$instance = $dataObj;
}
if ($instance) {
$alreadyTranslatedLocales = $instance->getTranslatedLocales();
unset($alreadyTranslatedLocales[$instance->Locale]);
}
$localeDropdown = new LanguageDropdownField($fieldName, _t('SilvercartConfig.TRANSLATION'), $alreadyTranslatedLocales, $translatingClass, 'Locale-Native', $instance);
$currentLocale = Translatable::get_current_locale();
$localesWithTitle = $localeDropdown->getSource();
$usedLocalesWithTitle = Translatable::get_existing_content_languages('SiteTree');
$languageList = array();
$usedLanguageList = array();
foreach ($localesWithTitle as $locale => $title) {
if (is_array($title)) {
foreach ($title as $locale2 => $title2) {
$title2 = self::getLanguageDisplayTitle($locale2, $currentLocale);
if (array_key_exists($locale2, $usedLocalesWithTitle)) {
$usedLanguageList[$locale2] = $title2;
unset($languageList[$locale2]);
} else {
$languageList[$locale2] = $title2;
}
}
} else {
$title = self::getLanguageDisplayTitle($locale, $currentLocale);
if (array_key_exists($locale, $usedLocalesWithTitle)) {
$usedLanguageList[$locale] = $title;
unset($languageList[$locale]);
} else {
$languageList[$locale] = $title;
}
}
}
asort($languageList);
if (count($usedLanguageList)) {
asort($usedLanguageList);
$languageList = array(_t('Form.LANGAVAIL', "Available languages") => $usedLanguageList, _t('Form.LANGAOTHER', "Other languages") => $languageList);
}
$localeDropdown->setSource($languageList);
$localeDropdown->setValue($dataObj->Locale);
return $localeDropdown;
}