You are here

function shs_node_count_form_field_ui_field_edit_form_alter in Simple hierarchical select 7

Implements hook_form_FORM_ID_alter().

File

modules/shs_node_count/shs_node_count.module, line 24
Node count functionality for Simple hierarchical select.

Code

function shs_node_count_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
  if (empty($form['instance']['widget']['settings']['shs'])) {
    return;
  }
  $settings_form =& $form['instance']['widget']['settings']['shs'];
  $settings =& $form['#instance']['widget']['settings']['shs'];
  $settings_form['node_count'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display number of nodes'),
    '#description' => t('Display the number of nodes associated with the term.'),
    '#default_value' => empty($settings['node_count']) ? FALSE : $settings['node_count'],
    '#weight' => -1,
  );
}