domain_conf_domain_bootstrap_full

Versions
domain
domain_conf_domain_bootstrap_full($domain)

Implementats hook_domain_bootstrap_full().

Code

domain_conf/domain_conf.module, line 18

<?php
function domain_conf_domain_bootstrap_full($domain) {
  static $check;
  // If running domain_set_domain(), we have issues with the variables
  // from the primary domain, which need to be loaded from cache.
  // @link http://drupal.org/node/412156
  if ($check) {
    global $_domain;
    if ($domain['domain_id'] == 0 && $check != $_domain['domain_id']) {
      _domain_conf_load_primary(TRUE);
    }
  }
  // Flag that we have already loaded.
  $check = $domain['domain_id'];
  $data = array();
  $data = db_fetch_array(db_query("SELECT settings FROM {domain_conf} WHERE domain_id = %d", $domain['domain_id']));
  if (!empty($data)) {
    global $conf;
    $settings = domain_unserialize($data['settings']);
    // Overwrite the $conf variables.
    foreach ($settings as $key => $value) {
      // Language handling is a special case.
      if ($key == 'language_default') {
        $table = domain_get_primary_table('system');
        $language = (bool) db_result(db_query("SELECT status FROM $table WHERE name = 'locale' AND type = 'module'"));
        if ($language) {
          $table = domain_get_primary_table('languages');
          $temp = db_fetch_object(db_query("SELECT * FROM $table WHERE language = '%s'", $value));
          if (!empty($temp)) {
            $value = $temp;
            $GLOBALS['language'] = $temp;
            $conf[$key] = $value;
          }
        }
      }
      else {
        $conf[$key] = $value;
      }
    }
  }
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List