You are here

function chosen_init in Chosen 7

Same name and namespace in other branches
  1. 6 chosen.module \chosen_init()

Implements hook_init().

File

./chosen.module, line 18
General functions and hook implementations.

Code

function chosen_init() {
  drupal_add_css(libraries_get_path('chosen') . '/chosen/chosen.css');
  drupal_add_js(chosen_js_path());
  drupal_add_js(array(
    'chosen' => array(
      'selector' => variable_get('chosen_jquery_selector', 'select:visible'),
      'minimum' => variable_get('chosen_minimum', 20),
      'minimum_width' => variable_get('chosen_minimum_width', 200),
      'search_contains' => variable_get('chosen_search_contains', FALSE) ? TRUE : FALSE,
    ),
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'chosen') . '/chosen.js');
}