You are here

function domain_locale_insert_domain in Domain Locale 6

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

Save language settings for a single domain

Parameters

int $domain_id:

array $params: Multidimensional array of language elements where language, weight and default are array keys

1 call to domain_locale_insert_domain()
domain_locale_languages_overview_form_submit in ./domain_locale.admin.inc
FormsAPI submit handler for domain language settings

File

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

Code

function domain_locale_insert_domain($domain_id, $params = array()) {
  if (count($params) > 0) {
    foreach ($params as $setting) {

      //Setting must have at least language defined, weight and default can have default values
      if (isset($setting['language'])) {
        $setting['domain_id'] = $domain_id;
        drupal_write_record('domain_locale', $setting);
      }
    }
  }
}