You are here

function _compact_forms_include_js in Compact Forms 5

Same name and namespace in other branches
  1. 6 compact_forms.module \_compact_forms_include_js()
  2. 7 compact_forms.module \_compact_forms_include_js()

Include JavaScript and CSS and attach behaviors to all selected forms.

Parameters

$css_ids: An array containing CSS form ids.

1 call to _compact_forms_include_js()
compact_forms_form_alter in ./compact_forms.module
Implementation of hook_form_alter().

File

./compact_forms.module, line 126
Compact Forms Drupal module.

Code

function _compact_forms_include_js($css_ids) {
  $path = drupal_get_path('module', 'compact_forms');
  drupal_add_js($path . '/compact_forms.js');
  drupal_add_css($path . '/compact_forms.css');
  $settings = array(
    'compactForms' => array(
      'forms' => $css_ids,
      'stars' => (int) variable_get('compact_forms_stars', 2),
      'colons' => (int) variable_get('compact_forms_colons', 0),
    ),
  );
  drupal_add_js($settings, 'setting');
}