diff --git a/includes/common.inc b/includes/common.inc index 01265c6c997f..54ead636a04d 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4447,48 +4447,12 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS } } - // Sort the JavaScript so that it appears in the correct order. - uasort($items, 'drupal_sort_css_js'); - - // Provide the page with information about the individual JavaScript files - // used, information not otherwise available when aggregation is enabled. - $setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1); - unset($setting['ajaxPageState']['js']['settings']); - drupal_add_js($setting, 'setting'); - - // If we're outputting the header scope, then this might be the final time - // that drupal_get_js() is running, so add the setting to this output as well - // as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's - // because drupal_get_js() was intentionally passed a $javascript argument - // stripped off settings, potentially in order to override how settings get - // output, so in this case, do not add the setting to this output. - if ($scope == 'header' && isset($items['settings'])) { - $items['settings']['data'][] = $setting; - } - - $elements = array( - '#type' => 'scripts', - '#items' => $items, - ); - - return drupal_render($elements); -} - -/** - * #pre_render callback to add the elements needed for scripts tags to be - * rendered. - * - * @param array $elements - * A render array containing: - * - '#items': The JS items as returned by drupal_add_js() and altered by - * drupal_get_js(). - * - * @return array - * A render array that will render to a string of XHTML "