mymodule_form_submit

Versions
domain
mymodule_form_submit($form_state)

Demonstrates domain_conf_variable_set().

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_domainupdate().

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

Code

./API.php, line 698

<?php
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);
  }
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List