You are here

function domain_conf_variable_set in Domain Access 7.2

Same name and namespace in other branches
  1. 6.2 domain_conf/domain_conf.module \domain_conf_variable_set()
  2. 7.3 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()

1 call to domain_conf_variable_set()
mymodule_form_submit in ./domain.api.php
Demonstrates domain_conf_variable_set().

File

domain_conf/domain_conf.module, line 639
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');

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