You are here

function homebox_restore_defaults_submit in Homebox 7.3

Same name and namespace in other branches
  1. 6.3 homebox.module \homebox_restore_defaults_submit()
  2. 6.2 homebox.module \homebox_restore_defaults_submit()
  3. 7.2 homebox.module \homebox_restore_defaults_submit()

Submit function for homebox_restore_defaults.

Deletes the user's saved settings for a page, then redirects back to the page.

File

./homebox.module, line 1509
Homebox main file, takes care of global functions settings constants, etc.

Code

function homebox_restore_defaults_submit($form, &$form_state) {
  global $user;
  db_delete('homebox_users')
    ->condition('uid', $user->uid)
    ->condition('name', $form_state['values']['page'])
    ->execute();
  $page = homebox_load($form_state['values']['page']);
  $form_state['redirect'] = homebox_get_path($page);
}