You are here

function spaces_announce_group_save in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_announce/spaces_announce.module \spaces_announce_group_save()

After build handler for announcement node forms.

1 string reference to 'spaces_announce_group_save'
spaces_announce_form_alter in spaces_announce/spaces_announce.module
Implementation of hook_form_alter.

File

spaces_announce/spaces_announce.module, line 197

Code

function spaces_announce_group_save($form, $form_values) {
  if (count($form['#post'])) {
    $gid = spaces_gid();
    $gids[$gid] = $gid;
    if (count($form['#post']['announce'])) {
      $announce_gids = $form['#post']['announce'];
    }
    elseif (isset($form['#post']['announce_hidden'])) {
      $announce_gids = unserialize($form['#post']['announce_hidden']);
    }
    if (is_array($announce_gids)) {
      foreach ($announce_gids as $value) {
        $gids[$value] = $value;
      }
      form_set_value($form['og_nodeapi']['visible']['og_groups'], $gids);
    }
  }
  return $form;
}