You are here

jquery_ui_filter.install in jQuery UI filter 6

Same filename and directory in other branches
  1. 7 jquery_ui_filter.install

Installation information for the 'jQuery UI filter' module.

File

jquery_ui_filter.install
View source
<?php

/**
 * @file
 * Installation information for the 'jQuery UI filter' module.
 */

/**
 * Implementation of hook_uninstall().
 */
function jquery_ui_filter_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'jquery_ui_filter_%%'");
  cache_clear_all('variables', 'cache');
}

/**
 * Allow Accordion and Tabs to use different header tags.
 */
function jquery_ui_filter_update_6000() {
  $header_tag = variable_get('jquery_ui_filter_header_tag', 'h3');
  variable_del('jquery_ui_filter_header_tag');
  if ($header_tag != 'h3') {
    variable_set('jquery_ui_filter_accordion_header_tag', $header_tag);
    variable_set('jquery_ui_filter_tabs_header_tag', $header_tag);
  }
}

/**
 * Split default input filter into 3 widget specific filters (accordion, dialog, & tabs)
 */
function jquery_ui_filter_update_6001() {
  $result = db_query("SELECT * FROM {filters} WHERE module='jquery_ui_filter' AND delta=0");
  while ($record = db_fetch_object($result)) {
    db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'jquery_ui_filter', 1, %d)", $record->format, $record->weight);
    db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'jquery_ui_filter', 2, %d)", $record->format, $record->weight);
  }
}

/**
 * Split jQuery UI widgets into widget specific modules (accordion, dialog, & tabs)
 */
function jquery_ui_filter_update_6002() {

  // Enable modules
  module_enable(array(
    'jquery_ui_filter_accordion',
    'jquery_ui_filter_dialog',
    'jquery_ui_filter_tabs',
  ));

  // Update filters
  db_query("UPDATE {filters} SET module='jquery_ui_filter_accordion', delta=0 WHERE module='jquery_ui_filter' AND delta=0");
  db_query("UPDATE {filters} SET module='jquery_ui_filter_dialog', delta=0  WHERE module='jquery_ui_filter' AND delta=1");
  db_query("UPDATE {filters} SET module='jquery_ui_filter_tabs', delta=0  WHERE module='jquery_ui_filter' AND delta=2");
}

Functions

Namesort descending Description
jquery_ui_filter_uninstall Implementation of hook_uninstall().
jquery_ui_filter_update_6000 Allow Accordion and Tabs to use different header tags.
jquery_ui_filter_update_6001 Split default input filter into 3 widget specific filters (accordion, dialog, & tabs)
jquery_ui_filter_update_6002 Split jQuery UI widgets into widget specific modules (accordion, dialog, & tabs)