You are here

function globallink_get_mapped_drupal_locales in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 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.

27 calls to globallink_get_mapped_drupal_locales()
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.
globallink_block_dashboard_pager_form in globallink_block/globallink_block_send.inc
Builds form to add pagination to block send dashboard.
globallink_build_filters in ./globallink.inc
Builds filters.
globallink_dashboard_node_filter_form in ./globallink_send_translations.inc
Builds form to filter GlobalLink nodes to send for translation on dashboard.

... See full list

File

./globallink.inc, line 682
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;
}