You are here

function domain_domainupdate in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain.module \domain_domainupdate()
  2. 7.2 domain.module \domain_domainupdate()

Implement hook_domainupdate()

File

./domain.module, line 2452
Core module functions for the Domain Access suite.

Code

function domain_domainupdate($op, $domain, $form_state = array()) {
  switch ($op) {
    case 'delete':
      if ($domain != -1) {

        // Remove domain-specific entries from the {node_access} table and clear the cache.
        db_query("DELETE FROM {node_access} WHERE realm = '%s' AND gid = %d", 'domain_id', $domain['domain_id']);
        db_query("DELETE FROM {domain_access} WHERE realm = '%s' AND gid = %d", 'domain_id', $domain['domain_id']);
        db_query("DELETE FROM {domain_editor} WHERE domain_id = %d", $domain['domain_id']);
      }
      break;
  }

  // In all cases, we need to force a menu rebuild, which also clears the cache.
  menu_rebuild();
}