You are here

function domain_prefix_domainupdate in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_prefix/domain_prefix.module \domain_prefix_domainupdate()

Implement hook_domainupdate().

File

domain_prefix/domain_prefix.module, line 729
Interface for selective table prefixing for use with Domain Access. For this module to work correctly, you will need to follow the INSTALL.txt instructions for editing your settings.php file.

Code

function domain_prefix_domainupdate($op, $domain = array(), $edit = array()) {
  switch ($op) {
    case 'create':
      $rule = variable_get('domain_prefix_options', 1);
      if ($rule) {

        // Get the current settings.
        $settings = unserialize(variable_get('domain_prefix', NULL));
        if (!empty($settings)) {
          $settings['domain_id'] = $domain['domain_id'];
          drupal_execute('domain_prefix_form', $settings, $domain['domain_id'], $edit['domain_arguments']);
        }
      }
      break;
    case 'delete':
      domain_prefix_drop_records($domain['domain_id']);
      break;
  }
}