[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/jquery_update/ -> jquery_update.api.php (source)

   1  <?php
   2  
   3  /**
   4   * Perform necessary alterations to the JavaScript before it is presented on
   5   * the page.
   6   *
   7   * @param $javascript
   8   *   An array of all JavaScript being presented on the page. An associative
   9   *   array of scopes, file paths, and then options associated with the files.
  10   *
  11   * @see drupal_add_js()
  12   * @see drupal_get_js()
  13   * @see hook_js_alter()
  14   */
  15  function hook_jquery_update_alter(&$javascript) {
  16    // Retrieve the attributes about jQuery.
  17    $jquery = $javascript['core']['misc/drupal.js'];
  18    // Remove the old one.
  19    unset($javascript['core']['misc/drupal.js']);
  20  
  21    // Swap in the new one.
  22    $path = drupal_get_path('module', 'jquery_update');
  23    $scripts['core'][$path] = $jquery;
  24  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7