domain_theme_submit

Versions
domain
domain_theme_submit($form, &$form_state)

FormsAPI submit handler for the theme settings

Code

domain_theme/domain_theme.admin.inc, line 178

<?php
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();
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List