You are here

function hs_content_taxonomy_form_alter in Hierarchical Select 6.3

Same name and namespace in other branches
  1. 5.3 modules/hs_content_taxonomy.module \hs_content_taxonomy_form_alter()

Implementation of hook_form_alter().

File

modules/hs_content_taxonomy.module, line 38
Implementation of the Hierarchical Select API for the Content Taxonomy module.

Code

function hs_content_taxonomy_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['type']) && isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) {
    if (isset($form['#field_info']) && count($form['#field_info']) > 0) {
      foreach ($form['#field_info'] as $field_name => &$field_info) {
        if ($field_info['widget']['type'] == 'content_taxonomy_hs') {
          $form['#submit'][] = 'hs_content_taxonomy_form_submit';
          break;
        }
      }
    }
  }
}