You are here

function domain_theme_submit in Domain Access 6.2

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

FormsAPI submit handler for the theme settings

1 string reference to 'domain_theme_submit'
domain_theme_form_system_themes_form_alter in domain_theme/domain_theme.admin.inc
Implement hook_form_alter().

File

domain_theme/domain_theme.admin.inc, line 178
Include file to handle theme configration screen

Code

function domain_theme_submit($form, &$form_state) {
  $theme = $form_state['values']['theme_default'];
  $domain_id = $form_state['values']['domain_id'];
  $settings = NULL;

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

  // Return to the correct page.
  $form_state['redirect'] = 'admin/build/domain/theme/' . $domain_id;

  // Clear the cache.
  cache_clear_all();
}