Drupal - Overriding Drupal Core Javascript Files?

<?php
    define
('JQUERY_UPDATE_REPLACE_PATH', drupal_get_path('theme', 'themename') .'/jslocation');
    function
phptemplate_preprocess_page(&$vars) {                  
           
$scripts = drupal_add_js();     
           
$new_jquery = array(jquery_update_jquery_path() => $scripts['core']['misc/jquery.js']);
           
$scripts['core'] = array_merge($new_jquery, $scripts['core']);
      unset(
$scripts['core']['misc/jquery.js']);               
           
$vars['scripts'] = drupal_get_js('header', $scripts);   
}

 
/**
* Return the path to the jQuery file.
*/
function jquery_update_jquery_path() {
 
$jquery_file = array('none' => 'jquery.js', 'min' => 'jquery-1.4.3.js');
  return
JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')];
}
?>

Share Your Answers

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.