You are here

function domain_theme_submit in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_theme/domain_theme.admin.inc \domain_theme_submit()

FormsAPI submut handler for the theme settings

File

domain_theme/domain_theme_form.inc, line 65
Include file to handle theme configration screen.

Code

function domain_theme_submit($form_id, $form_values) {
  $theme = $form_values['theme_default'];
  $id = $form_values['domain_id'];
  $settings = NULL;

  // This is a placeholder for advanced functions.
  $check = domain_theme_lookup($id);
  if ($check == -1) {
    db_query("INSERT INTO {domain_theme} VALUES (%d, '%s', %b)", $id, $theme, $settings);
  }
  else {
    db_query("UPDATE {domain_theme} SET theme = '%s', settings = %b WHERE domain_id = %d", $theme, $settings, $id);
  }

  // Clear the cache.
  cache_clear_all();
}