You are here

function domain_conf_variable_delete in Domain Access 6.2

Same name and namespace in other branches
  1. 7.2 domain_conf/domain_conf.module \domain_conf_variable_delete()

Delete a setting from {domain_conf}.

Parameters

$domain_id: The unique domain ID that is being edited.

$variable: The name of the variable you wish to delete.

1 call to domain_conf_variable_delete()
domain_settings_form_submit in domain_settings/domain_settings.module
Submit handler for domain-specific settings.

File

domain_conf/domain_conf.module, line 759
Domain manager configuration options.

Code

function domain_conf_variable_delete($domain_id, $variable) {

  // Get the current settings for this domain, if any.
  $settings = domain_unserialize(db_result(db_query("SELECT settings FROM {domain_conf} WHERE domain_id = %d", $domain_id)));

  // Settings found, remove them.
  if (!empty($settings)) {
    unset($settings[$variable]);
    db_query("UPDATE {domain_conf} SET settings = %b WHERE domain_id = %d", serialize($settings), $domain_id);
  }
}