You are here

function domain_theme_batch in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_theme/domain_theme.module \domain_theme_batch()

Custom handler for domain_theme_domainbatch().

Parameters

$form_values: The form values passed by the FormsAPI.

1 string reference to 'domain_theme_batch'
domain_theme_domainbatch in domain_theme/domain_theme.module
Implement hook_domainbatch()

File

domain_theme/domain_theme.module, line 258
Domain Theme module for the Domain Access module group.

Code

function domain_theme_batch($form_values) {
  foreach ($form_values['domain_batch'] as $key => $value) {
    if ($key > 0) {
      $data = db_fetch_array(db_query("SELECT theme FROM {domain_theme} WHERE domain_id = %d", $key));
      if (isset($data['theme'])) {
        db_query("UPDATE {domain_theme} SET theme = '%s' WHERE domain_id = %d", $value, $key);
      }
      else {
        db_query("INSERT INTO {domain_theme} (domain_id, theme) VALUES (%d, '%s')", $key, $value);
      }
    }
    else {
      variable_set('theme_default', $value);
    }
  }
}