You are here

function spaces_user_user in Spaces 5.2

Same name and namespace in other branches
  1. 6.3 spaces_user/spaces_user.module \spaces_user_user()
  2. 6 spaces_user/spaces_user.module \spaces_user_user()
  3. 6.2 spaces_user/spaces_user.module \spaces_user_user()

Implementation of hook_user().

File

./spaces_user.module, line 277

Code

function spaces_user_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'form':
      if ($category == 'account') {
        $space = spaces_load('user', $account->uid);
        $form = array(
          'spaces_preset' => spaces_form_presets($space),
        );
        return $form;
      }
      break;
    case 'insert':
    case 'update':
      if (isset($edit['preset'])) {
        $space = spaces_load('user', $account->uid);
        $space->preset = $edit['preset'];
        spaces_save($space);
      }
      break;
  }
}