You are here

function domain_locale_features_rebuild in Domain Locale 7

Implements hook_features_rebuild().

1 call to domain_locale_features_rebuild()
domain_locale_features_revert in ./domain_locale.features.inc
Implements hook_features_revert().

File

./domain_locale.features.inc, line 89
Features integration for Domain Locale.

Code

function domain_locale_features_rebuild($module) {
  if ($defaults = domain_locale_features_load($module, 'domain_locale_default_locales', TRUE)) {

    /*   // Check for hard rebuild/revert.
        if ($wipe = domain_locale_features_wipe_tables($defaults)) {
          // list all domain locales
          foreach (domain_locale_list(FALSE) as $domain_id => $languages) {
            $this_domain = domain_lookup($domain_id);
            foreach ($languages as $language => $weight) {
              $locale_machine_name = $this_domain['machine_name'] . '__locale-placeholder__' . $language;
              $locales[$locale_machine_name] = array(
                'domain_id'           => $this_domain['domain_id'],
                'locale_machine_name' => $locale_machine_name,
                'language'            => $language,
                'weight'              => $weight,
                );
            }
          }
          // loop locales and delete entries that does not exist anymore
          foreach ($locales as $locale) {
            if (!isset($defaults[$locale['locale_machine_name']])) {
              // Delete a single language
              domain_locale_delete_domain_language($locale['domain_id'], $locale['language']);
            }
          }
        }
        // Save the locales in this feature.
        foreach ($defaults as $domain_machine_name => $languages) {
          // Get the languages and weights for this domain
          foreach ($languages as $language => $weight) {
            $params = array(
              'language' => $language,
              'weight'   => $weight,
            )
          }
          // Load this domain
          $this_domain = domain_machine_name_load($domain_machine_name);
          // Write locale
          domain_locale_insert_domain($this_domain['domain_id'], $params);
        }
      */
  }
}