You are here

function mymodule_form_submit in Domain Access 7.3

Same name and namespace in other branches
  1. 6.2 API.php \mymodule_form_submit()
  2. 7.2 domain.api.php \mymodule_form_submit()

Allows module to reset domain-specific variables.

This function is not a hook, it is a helper function that is implemented by the Domain Configuration module.

Use this function if you need to reset a domain-specific variable from your own code. It is especially useful in conjunction with hook_domain_update().

@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.

File

./domain.api.php, line 666
API documentation file.

Code

function mymodule_form_submit($form_state) {

  // When we save these changes, replicate them across all domains.
  if (!module_exists('domain_conf')) {
    return;
  }
  $domains = domain_domains();
  foreach ($domains as $domain) {
    $value = $form_state['values']['my_variable'];
    domain_conf_variable_set($domain['domain_id'], 'my_variable', $value);
  }
}