You are here

function hierarchical_select_common_config_apply in Hierarchical Select 7.3

Same name and namespace in other branches
  1. 5.3 includes/common.inc \hierarchical_select_common_config_apply()
  2. 6.3 includes/common.inc \hierarchical_select_common_config_apply()

Apply a config to a form item.

Parameters

$form_item: The form item that will be updated.

$config_id: A config id.

$defaults_override: Optionally override the defaults. @see hierarchical_select_common_config_get()

2 calls to hierarchical_select_common_config_apply()
hierarchical_select_common_config_form in includes/common.inc
Form definition of the hierarchical_select_common_config_form form.
hs_taxonomy_field_widget_form in modules/hs_taxonomy.module
Implements hook_field_widget_form().

File

includes/common.inc, line 82
Functions used by more than one Hierarchical Select implementation.

Code

function hierarchical_select_common_config_apply(&$form_item, $config_id, $defaults_override = array()) {
  $config = hierarchical_select_common_config_get($config_id, $defaults_override);
  $form_item['#config'] = array_merge(isset($form_item['#config']) && is_array($form_item['#config']) ? $form_item['#config'] : array(), $config);
}