You are here

function spaces_taxonomy_form_alter in Spaces 6.3

Same name and namespace in other branches
  1. 6 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_form_alter()
  2. 6.2 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_form_alter()
  3. 7.3 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_form_alter()
  4. 7 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_form_alter()

Implementation of hook_form_alter().

File

spaces_taxonomy/spaces_taxonomy.module, line 98

Code

function spaces_taxonomy_form_alter(&$form, $form_state, $form_id) {
  if ($form['#id'] == 'node-form' && arg(0) . '/' . arg(1) != 'admin/content') {
    $vid = variable_get('spaces_taxonomy_vid', 0);
    $space = spaces_get_space();
    if ($vid && !empty($form['taxonomy'][$vid]) && $space->type == 'taxonomy') {
      $form['taxonomy'][$vid]['#disabled'] = TRUE;
      $form['taxonomy'][$vid]['#default_value'] = $space->id;
    }
  }
}