function widgets_add_multiselect in Widgets 6
Add javascript and stylesheets required for the multiselect widget.
Parameters
$element_id: DOM ID of the element to transform to a multiselect.
2 calls to widgets_add_multiselect()
- widgets_form_alter in ./
widgets.module - Implementation of hook_form_alter().
- widgets_form_node_type_form_alter in ./
widgets.module - Implementation of hook_form_FORM_ID_alter().
File
- ./
widgets.inc, line 97 - Implementaion of custom functions for Widgets module.
Code
function widgets_add_multiselect($element_id) {
// Styles.
drupal_add_css(drupal_get_path('module', 'jquery_ui') . '/jquery.ui/themes/base/ui.all.css');
drupal_add_css(drupal_get_path('module', 'widgets') . '/js/multiselect/css/ui.multiselect.css');
drupal_add_css(drupal_get_path('module', 'widgets') . '/css/widgets.css');
// jQuery UI.
jquery_ui_add(array(
'ui.sortable',
'ui.draggable',
));
// Multiselect.
drupal_add_js(drupal_get_path('module', 'widgets') . '/js/form.js');
drupal_add_js(drupal_get_path('module', 'widgets') . '/js/multiselect/js/ui.multiselect.js');
drupal_add_js('Drupal.behaviors.attachWidgets = function(){$("#' . $element_id . '").multiselect(); widgetsStatus(); }', 'inline');
}