You are here

function hook_shs_class_definitions_alter in Simple hierarchical select 2.0.x

Same name and namespace in other branches
  1. 8 shs.api.php \hook_shs_class_definitions_alter()

Alter the list of used javascript classes to create the shs widgets.

Parameters

array $definitions: List of class names keyed by type and class key.

array $context: Additional information about the current context (i.e. additional field settings).

1 function implements hook_shs_class_definitions_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

shs_chosen_shs_class_definitions_alter in modules/shs_chosen/shs_chosen.module
Implements hook_shs_class_definitions_alter().

File

./shs.api.php, line 21
Hooks for the shs module.

Code

function hook_shs_class_definitions_alter(array &$definitions, array $context) {
  if (!empty($context['settings']['custom_widget'])) {

    // Use custom class for option elements.
    $definitions['views']['widgetItem'] = 'Drupal.customShs.MyWidgetItemView';
  }
}