You are here

function globallink_get_mapped_drupal_locales in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink.inc \globallink_get_mapped_drupal_locales()
  2. 7.6 globallink.inc \globallink_get_mapped_drupal_locales()

Gets mapped Drupal locales.

Parameters

bool $remove_default: Whether or not to remove the default locale. Defaults to true.

Return value

array Array of locales.

37 calls to globallink_get_mapped_drupal_locales()
globallink_beans_dashboard_filter_form in globallink_beans/globallink_beans_send.inc
Builds form to filter beans to send for translation on dashboard.
globallink_beans_dashboard_form in globallink_beans/globallink_beans_send.inc
Builds form to create a beans submission.
globallink_beans_dashboard_pager_form in globallink_beans/globallink_beans_send.inc
Builds form to add pagination to beans send dashboard.
globallink_block_dashboard_filter_form in globallink_block/globallink_block_send.inc
Builds form to filter blocks to send for translation on dashboard.
globallink_block_dashboard_form in globallink_block/globallink_block_send.inc
Builds form to create a block submission.

... See full list

File

./globallink.inc, line 621
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_get_mapped_drupal_locales($remove_default = TRUE) {
  $languages = array();
  $result = db_select('globallink_locale', 'tl')
    ->fields('tl')
    ->isNotNull('drupal_locale_code')
    ->orderBy('locale_desc', 'ASC')
    ->execute();
  foreach ($result as $row) {
    if ($remove_default) {
      if (language_default()->language == $row->drupal_locale_code) {
        continue;
      }
    }
    $languages[$row->drupal_locale_code] = $row->drupal_locale_desc;
  }
  return $languages;
}