You are here

function workspace_configure_form_submit in Workspace 6

Same name and namespace in other branches
  1. 5 workspace.module \workspace_configure_form_submit()
  2. 7 workspace.module \workspace_configure_form_submit()

Submit handler for per-user configuration form.

See also

workspace_configure_form()

File

./workspace.module, line 210
Presents a user-centric view of content.

Code

function workspace_configure_form_submit($form, &$form_state) {

  // Must do a full user load to get existing serialized data.
  $account = user_load(array(
    'uid' => $form_state['values']['uid'],
  ));
  if (!isset($account->workspaces)) {
    $account->workspaces = array();
  }
  $account->workspaces['default']['maxnodes'] = (int) $form_state['values']['maxnodes'];
  $account->workspaces['default']['maxfilenames'] = (int) $form_state['values']['maxfilenames'];
  user_save($account, array(
    'workspaces' => $account->workspaces,
  ));
  drupal_set_message(t('The workspace preferences have been saved.'));
  $form_state['redirect'] = 'workspace/' . $form_state['values']['uid'];
}