You are here

function domain_conf_variable_set in Domain Access 7.3

Same name and namespace in other branches
  1. 6.2 domain_conf/domain_conf.module \domain_conf_variable_set()
  2. 7.2 domain_conf/domain_conf.module \domain_conf_variable_set()

Change the variable setting for a domain. This function is called by external modules that wish to alter Domain Conf settings.

Note that this function saves the value to the database and changes the active $conf array.

@link http://drupal.org/node/367963

Parameters

$domain_id: The unique domain ID that is being edited.

$variable: The name of the variable you wish to set.

$value: The value of the variable to set. You may leave this value blank in order to unset the custom variable.

See also

domain_conf_variable_save()

2 calls to domain_conf_variable_set()
drush_domain_conf_set in domain_conf/domain_conf.drush.inc
mymodule_form_submit in ./domain.api.php
Allows module to reset domain-specific variables.

File

domain_conf/domain_conf.module, line 338
Domain manager configuration options.

Code

function domain_conf_variable_set($domain_id, $variable, $value = NULL) {
  global $conf, $_domain;
  domain_conf_variable_save($domain_id, $variable, $value);

  // Clear the cache.
  cache_clear_all('variables', 'cache');
  drupal_static_reset('domain_conf_variable_get_settings');
  drupal_static_reset('domain_conf_variable_get_base');

  // If we are on the active domain, set the active variable.
  if ($domain_id == $_domain['domain_id']) {
    $conf[$variable] = $value;
  }
}