You are here

function workspace_configure_form_submit in Workspace 5

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

File

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

Code

function workspace_configure_form_submit($form_id, $edit) {
  global $user;
  $user = user_load(array(
    'uid' => $user->uid,
  ));
  if (!isset($user->workspaces)) {
    $user->workspaces = array();
  }
  $user->workspaces['default']['maxnodes'] = (int) $edit['maxnodes'];
  $user->workspaces['default']['maxfilenames'] = (int) $edit['maxfilenames'];
  user_save($user, array(
    'workspaces' => $user->workspaces,
  ));
  drupal_set_message(t('Your workspace preferences have been saved.'));
  return 'workspace';
}