You are here

function domain_locale_restore_default in Domain Locale 6

Same name and namespace in other branches
  1. 7 domain_locale.module \domain_locale_restore_default()

Reset Domain Locale settings to site language settings

Parameters

int $domain_id:

2 calls to domain_locale_restore_default()
domain_locale_domainupdate in ./domain_locale.module
Implements hook_domainupdate().
domain_locale_reset_form_submit in ./domain_locale.admin.inc
FormsAPI for domain_locale_reset_form.

File

./domain_locale.module, line 168
domain_locale Domain Locale: manage languages Provides domain specific language settings

Code

function domain_locale_restore_default($domain_id) {
  if ($domain_id > 1) {
    $enabled_languages = db_query('SELECT language, weight FROM {languages} WHERE enabled=1');
    while ($lang = db_fetch_object($enabled_languages)) {
      $default = $current_language == $language_default ? 1 : 0;
      db_query("INSERT INTO {domain_locale}(language, domain_id, weight) VALUES\n      ('%s', %d, %d)", $lang->language, $domain_id, $lang->weight);
    }
  }
}