[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/jquery_ui/ -> jquery_ui.install (source)

   1  <?php
   2  // $Id: jquery_ui.install,v 1.5.2.4 2010/09/08 23:12:42 sun Exp $
   3  
   4  /**
   5   * @file
   6   * Installation file for jQuery UI module.
   7   */
   8  
   9  /**
  10   * Implementation of hook_requirements().
  11   */
  12  function jquery_ui_requirements($phase) {
  13    $requirements = array();
  14    $t = get_t();
  15    $jquery_ui_version = 0;
  16  
  17    if ($phase == 'install') {
  18      // The jquery_ui_get_version() function is in the .module file, which isn't
  19      // loaded yet.
  20      include_once dirname(__FILE__) . '/jquery_ui.module';
  21    }
  22  
  23    $requirements['jquery_ui']['title'] = $t('jQuery UI');
  24    if ($jquery_ui_version = jquery_ui_get_version()) {
  25      // Everything looks good; display the current jQuery UI version.
  26      $requirements['jquery_ui']['value'] = $jquery_ui_version;
  27      $requirements['jquery_ui']['severity'] = REQUIREMENT_OK;
  28    }
  29    else {
  30      // Required library wasn't found. Abort installation.
  31      $requirements['jquery_ui']['value'] = $t('Not found');
  32      // Provide a download link to the jQuery UI development bundle. The provided
  33      // link will list the latest 1.6.x build.
  34      $requirements['jquery_ui']['description'] = $t('The <a href="@jqueryui">jQuery UI</a> plugin is missing. <a href="@download">Download</a> and extract it to your <em>jquery_ui</em> module directory.', array(
  35        '@jqueryui' => 'http://jqueryui.com',
  36        '@download' => 'http://code.google.com/p/jquery-ui/downloads/list?q=1.6',
  37      ));
  38      $requirements['jquery_ui']['severity'] = REQUIREMENT_ERROR;
  39    }
  40  
  41    return $requirements;
  42  }
  43  
  44  /**
  45   * Implementation of hook_uninstall().
  46   */
  47  function jquery_ui_uninstall() {
  48    variable_del('jquery_ui_compression_type');
  49  }
  50  


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7