You are here

function og_access_form_alter in Organic groups 6.2

Same name and namespace in other branches
  1. 5.8 og_access.module \og_access_form_alter()
  2. 5 og_access.module \og_access_form_alter()
  3. 5.3 og_access.module \og_access_form_alter()
  4. 5.7 og_access.module \og_access_form_alter()
  5. 6 modules/og_access/og_access.module \og_access_form_alter()

Implementation of hook_form_alter().

File

modules/og_access/og_access.module, line 245

Code

function og_access_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['#node']) && $form_id == $form['#node']->type . '_node_form') {

    // This way, our js gets added even if form is cached.
    $form['#pre_render'][] = 'og_access_add_js';
    $node = $form['#node'];
    if (og_is_group_type($node->type)) {
      og_access_alter_group_form($form, $node);
    }
    else {
      og_access_alter_nongroup_form($form, $form_state, $node);
    }
  }
}