You are here

function jquery_ui_filter_init in jQuery UI filter 7

Same name and namespace in other branches
  1. 6 jquery_ui_filter.module \jquery_ui_filter_init()

Implements hook_init().

File

./jquery_ui_filter.module, line 11
Converts static HTML to a jQuery UI accordian or tabs widget.

Code

function jquery_ui_filter_init() {
  drupal_add_library('system', 'ui.widget');

  // Add jQuery UI filter script and settings.
  // NOTE: Still including jQuery UI filter javascript even if it is disabled
  //       so that it be correctly aggregrated for every page on the site.
  drupal_add_js(drupal_get_path('module', 'jquery_ui_filter') . '/jquery_ui_filter.js', array(
    'type' => 'file',
    'every_page' => TRUE,
  ));
  $settings = array(
    'jQueryUiFilter' => array(
      'disabled' => drupal_match_path($_GET['q'], variable_get('jquery_ui_filter_disabled_pages', 'print*')) ? 1 : 0,
    ),
  );
  drupal_add_js($settings, 'setting');
}