Special handling for jquery update.

Paramètres

$js: List of files in the header

2 calls to advagg_jquery_updater()
advagg_get_js_css_get_array dans ./advagg.module
Return a large array of the CSS & JS files loaded on this page.
advagg_process_html_js dans includes/js.inc

Fichier

./advagg.module, line 787

Code

function advagg_jquery_updater(&$js) {
    if (!module_exists('jquery_update') || !variable_get('jquery_update_replace', TRUE) || empty($js)) {
        return;
    }
    // Replace jquery.js first.
    $new_jquery = array(
        jquery_update_jquery_path() => $js['core']['misc/jquery.js'],
    );
    $js['core'] = array_merge($new_jquery, $js['core']);
    unset($js['core']['misc/jquery.js']);
    // Loop through each of the required replacements.
    $replacement_path = drupal_get_path('module', 'jquery_update') . '/replace/';
    foreach (jquery_update_get_replacements() as $type => $replacements) {
        foreach ($replacements as $find => $replace) {
            // If the file to replace is loaded on this page...
            if (isset($js[$type][$find])) {
                // Create a new entry for the replacement file, and unset the original one.
                $replace = $replacement_path . $replace;
                $js[$type][$replace] = $js[$type][$find];
                unset($js[$type][$find]);
            }
        }
    }
}