You are here

function domain_domainupdate in Domain Access 5

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

Implement hook_domainupdate()

File

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

Code

function domain_domainupdate($op, $domain = array(), $edit = 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 = 'domain_id' AND gid = %d", $domain['domain_id']);
        db_query("DELETE FROM {node_access} WHERE realm = 'domain_editor' AND gid = %d", $domain['domain_id']);
        db_query("DELETE FROM {domain_access} WHERE realm = 'domain_id' AND gid = %d", $domain['domain_id']);
        db_query("DELETE FROM {domain_access} WHERE realm = 'domain_editor' AND gid = %d", $domain['domain_id']);
      }
      break;
  }

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