summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-01-08 06:44:57 (GMT)
committerwebchick2014-01-08 06:44:57 (GMT)
commit99d3490f9f4003363b5704d8d2a5456ffbaf835f (patch)
treeb933cab01008cdc429ff64fc2f95cedb565518f7
parent9e239760221f2c5215ef19825b6598a5e28fb225 (diff)
Issue #2168113 by penyaskito, jessebeach, catch: Add leading underscore and other discouragement to drupal_add_css() and drupal_add_js().
-rw-r--r--core/includes/ajax.inc6
-rw-r--r--core/includes/common.inc79
-rw-r--r--core/includes/theme.inc2
-rw-r--r--core/lib/Drupal/Core/Ajax/AjaxResponse.php8
-rw-r--r--core/lib/Drupal/Core/Asset/CssCollectionGrouper.php2
-rw-r--r--core/lib/Drupal/Core/Asset/JsCollectionGrouper.php2
-rw-r--r--core/lib/Drupal/Core/Asset/JsCollectionRenderer.php2
-rw-r--r--core/modules/edit/lib/Drupal/edit/EditController.php4
-rw-r--r--core/modules/editor/editor.api.php2
-rw-r--r--core/modules/file/lib/Drupal/file/Controller/FileWidgetAjaxController.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php18
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php40
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php152
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php26
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php8
-rw-r--r--core/modules/system/system.api.php10
-rw-r--r--core/modules/system/tests/modules/ajax_test/ajax_test.module2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php16
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php8
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php4
20 files changed, 197 insertions, 196 deletions
diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index 5c4bb99..de6f5d0 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -245,14 +245,14 @@ function ajax_render($commands = array()) {
$items[$type] = array();
}
else {
- $function = 'drupal_add_' . $type;
+ $function = '_drupal_add_' . $type;
$items[$type] = $function();
drupal_alter($type, $items[$type]);
// @todo Inline CSS and JS items are indexed numerically. These can't be
// reliably diffed with array_diff_key(), since the number can change
// due to factors unrelated to the inline content, so for now, we strip
// the inline items from Ajax responses, and can add support for them
- // when drupal_add_css() and drupal_add_js() are changed to use a hash
+ // when _drupal_add_css() and _drupal_add_js() are changed to use a hash
// of the inline content as the array key.
foreach ($items[$type] as $key => $item) {
if (is_numeric($key)) {
@@ -290,7 +290,7 @@ function ajax_render($commands = array()) {
}
// Now add a command to merge changes and additions to drupalSettings.
- $scripts = drupal_add_js();
+ $scripts = _drupal_add_js();
if (!empty($scripts['settings'])) {
$settings = drupal_merge_js_settings($scripts['settings']['data']);
array_unshift($commands, ajax_command_settings($settings, TRUE));
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 86fd220..0099008 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1402,7 +1402,7 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
/**
* Adds a cascading stylesheet to the stylesheet queue.
*
- * Calling drupal_static_reset('drupal_add_css') will clear all cascading
+ * Calling drupal_static_reset('_drupal_add_css') will clear all cascading
* stylesheets added so far.
*
* If CSS aggregation/compression is enabled, all cascading style sheets added
@@ -1421,7 +1421,7 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* all typical visitors and most pages of a site. It is critical that all
* preprocessed files are added unconditionally on every page, even if the
* files do not happen to be needed on a page. This is normally done by calling
- * drupal_add_css() in a hook_page_build() implementation.
+ * _drupal_add_css() in a hook_page_build() implementation.
*
* Non-preprocessed files should only be added to the page when they are
* actually needed.
@@ -1494,9 +1494,9 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* - Then by the 'every_page' flag, with TRUE coming before FALSE.
* - Then by weight.
* - Then by the order in which the CSS was added. For example, all else
- * being the same, a stylesheet added by a call to drupal_add_css() that
+ * being the same, a stylesheet added by a call to _drupal_add_css() that
* happened later in the page request gets added to the page after one for
- * which drupal_add_css() happened earlier in the page request.
+ * which _drupal_add_css() happened earlier in the page request.
* Available constants are:
* - CSS_BASE: Styles for HTML elements ("base" styles).
* - CSS_LAYOUT: Styles that layout a page.
@@ -1523,7 +1523,7 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
*
* @see drupal_get_css()
*/
-function drupal_add_css($data = NULL, $options = NULL) {
+function _drupal_add_css($data = NULL, $options = NULL) {
$css = &drupal_static(__FUNCTION__, array());
// Construct the options, taking the defaults into consideration.
@@ -1613,13 +1613,13 @@ function drupal_add_css($data = NULL, $options = NULL) {
* @return
* A string of XHTML CSS tags.
*
- * @see drupal_add_css()
+ * @see _drupal_add_css()
*/
function drupal_get_css($css = NULL, $skip_alter = FALSE) {
global $theme_info;
if (!isset($css)) {
- $css = drupal_add_css();
+ $css = _drupal_add_css();
}
// Allow modules and themes to alter the CSS items.
@@ -1672,12 +1672,12 @@ function drupal_get_css($css = NULL, $skip_alter = FALSE) {
*
* @param $a
* First item for comparison. The compared items should be associative arrays
- * of member items from drupal_add_css() or drupal_add_js().
+ * of member items from _drupal_add_css() or _drupal_add_js().
* @param $b
* Second item for comparison.
*
- * @see drupal_add_css()
- * @see drupal_add_js()
+ * @see _drupal_add_css()
+ * @see _drupal_add_js()
*/
function drupal_sort_css_js($a, $b) {
// First order by group, so that all items in the CSS_AGGREGATE_DEFAULT group
@@ -1759,7 +1759,7 @@ function drupal_sort_css_js($a, $b) {
*
* @param $element
* A render array containing:
- * - '#items': The CSS items as returned by drupal_add_css() and altered by
+ * - '#items': The CSS items as returned by _drupal_add_css() and altered by
* drupal_get_css().
*
* @return
@@ -1981,17 +1981,17 @@ function drupal_html_id($id) {
*
* Examples:
* @code
- * drupal_add_js('core/misc/collapse.js');
- * drupal_add_js('core/misc/collapse.js', 'file');
- * drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
- * drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
+ * _drupal_add_js('core/misc/collapse.js');
+ * _drupal_add_js('core/misc/collapse.js', 'file');
+ * _drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
+ * _drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });',
* array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
* );
- * drupal_add_js('http://example.com/example.js', 'external');
- * drupal_add_js(array('myModule' => array('key' => 'value')), 'setting');
+ * _drupal_add_js('http://example.com/example.js', 'external');
+ * _drupal_add_js(array('myModule' => array('key' => 'value')), 'setting');
* @endcode
*
- * Calling drupal_static_reset('drupal_add_js') will clear all JavaScript added
+ * Calling drupal_static_reset('_drupal_add_js') will clear all JavaScript added
* so far.
*
* If JavaScript aggregation is enabled, all JavaScript files added with
@@ -2008,7 +2008,7 @@ function drupal_html_id($id) {
* all typical visitors and most pages of a site. It is critical that all
* preprocessed files are added unconditionally on every page, even if the
* files are not needed on a page. This is normally done by calling
- * drupal_add_js() in a hook_page_build() implementation.
+ * _drupal_add_js() in a hook_page_build() implementation.
*
* Non-preprocessed files should only be added to the page when they are
* actually needed.
@@ -2085,9 +2085,9 @@ function drupal_html_id($id) {
* - Then by the 'every_page' flag, with TRUE coming before FALSE.
* - Then by weight.
* - Then by the order in which the JavaScript was added. For example, all
- * else being the same, JavaScript added by a call to drupal_add_js() that
+ * else being the same, JavaScript added by a call to _drupal_add_js() that
* happened later in the page request gets added to the page after one for
- * which drupal_add_js() happened earlier in the page request.
+ * which _drupal_add_js() happened earlier in the page request.
* - cache: If set to FALSE, the JavaScript file is loaded anew on every page
* call; in other words, it is not cached. Used only when 'type' references
* a JavaScript file. Defaults to TRUE.
@@ -2104,13 +2104,13 @@ function drupal_html_id($id) {
* @return
* The current array of JavaScript files, settings, and in-line code,
* including Drupal defaults, anything previously added with calls to
- * drupal_add_js(), and this function call's additions.
+ * _drupal_add_js(), and this function call's additions.
*
* @deprecated as of Drupal 8.0. Use the #attached key in render arrays instead.
*
* @see drupal_get_js()
*/
-function drupal_add_js($data = NULL, $options = NULL) {
+function _drupal_add_js($data = NULL, $options = NULL) {
$javascript = &drupal_static(__FUNCTION__, array());
// Construct the options, taking the defaults into consideration.
@@ -2128,7 +2128,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
$options['preprocess'] = $options['cache'] && empty($options['attributes']) ? $options['preprocess'] : FALSE;
// Tweak the weight so that files of the same weight are included in the
- // order of the calls to drupal_add_js().
+ // order of the calls to _drupal_add_js().
$options['weight'] += count($javascript) / 1000;
if (isset($data)) {
switch ($options['type']) {
@@ -2189,7 +2189,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
* (optional) The default data parameter for the JavaScript item array.
*
* @see drupal_get_js()
- * @see drupal_add_js()
+ * @see _drupal_add_js()
*/
function drupal_js_defaults($data = NULL) {
return array(
@@ -2217,7 +2217,7 @@ function drupal_js_defaults($data = NULL) {
*
* Note that hook_js_alter(&$javascript) is called during this function call
* to allow alterations of the JavaScript during its presentation. Calls to
- * drupal_add_js() from hook_js_alter() will not be added to the output
+ * _drupal_add_js() from hook_js_alter() will not be added to the output
* presentation. The correct way to add JavaScript during hook_js_alter()
* is to add another element to the $javascript array, deriving from
* drupal_js_defaults(). See locale_js_alter() for an example of this.
@@ -2239,13 +2239,13 @@ function drupal_js_defaults($data = NULL) {
* @return
* All JavaScript code segments and includes for the scope as HTML tags.
*
- * @see drupal_add_js()
+ * @see _drupal_add_js()
* @see locale_js_alter()
* @see drupal_js_defaults()
*/
function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALSE, $is_ajax = FALSE) {
if (!isset($javascript)) {
- $javascript = drupal_add_js();
+ $javascript = _drupal_add_js();
}
if (empty($javascript)) {
return '';
@@ -2294,17 +2294,17 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
// Skip if no files were added to the page otherwise jQuery.extend() will
// overwrite the drupalSettings.ajaxPageState.css object with an empty
// array.
- $css = drupal_add_css();
+ $css = _drupal_add_css();
if (!empty($css)) {
// Cast the array to an object to be on the safe side even if not empty.
$setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1);
}
- drupal_add_js($setting, 'setting');
+ _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 settings to this output as well
- // as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's
+ // 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 of settings, potentially in order to override how settings get
// output, so in this case, do not add the setting to this output.
@@ -2356,7 +2356,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
*
* By following jQuery.extend() merge logic rather than common PHP array merge
* logic, the following are ensured:
- * - drupal_add_js() is idempotent: calling it twice with the same parameters
+ * - _drupal_add_js() is idempotent: calling it twice with the same parameters
* does not change the output sent to the browser.
* - If pieces of the page are rendered in separate PHP requests and the
* returned settings are merged by JavaScript, the resulting settings are the
@@ -2365,7 +2365,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
* @param $settings_items
* An array of settings arrays, as returned by:
* @code
- * $js = drupal_add_js();
+ * $js = _drupal_add_js();
* $settings_items = $js['settings']['data'];
* @endcode
*
@@ -2373,7 +2373,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
* A merged $settings array, suitable for JSON encoding and returning to the
* browser.
*
- * @see drupal_add_js()
+ * @see _drupal_add_js()
* @see drupal_pre_render_scripts()
*/
function drupal_merge_js_settings($settings_items) {
@@ -2406,7 +2406,7 @@ function drupal_merge_attached(array $a, array $b) {
*
* @param $element
* A render array containing:
- * - #items: The JavaScript items as returned by drupal_add_js() and
+ * - #items: The JavaScript items as returned by _drupal_add_js() and
* altered by drupal_get_js().
* - #group_callback: A function to call to group #items. Following
* this function, #aggregate_callback is called to aggregate items within
@@ -2437,6 +2437,7 @@ function drupal_pre_render_scripts($elements) {
* to elements using the #attached property. The #attached property is an
* associative array, where the keys are the the attachment types and the values
* are the attached data. For example:
+ *
* @code
* $build['#attached'] = array(
* 'library' => array(array('taxonomy', 'taxonomy')),
@@ -2474,8 +2475,8 @@ function drupal_pre_render_scripts($elements) {
* dependencies were met.
*
* @see drupal_add_library()
- * @see drupal_add_js()
- * @see drupal_add_css()
+ * @see _drupal_add_js()
+ * @see _drupal_add_css()
* @see drupal_render()
*/
function drupal_process_attached($elements, $dependency_check = FALSE) {
@@ -2500,7 +2501,7 @@ function drupal_process_attached($elements, $dependency_check = FALSE) {
unset($elements['#attached']['library']);
// Add both the JavaScript and the CSS.
- // The parameters for drupal_add_js() and drupal_add_css() require special
+ // The parameters for _drupal_add_js() and _drupal_add_css() require special
// handling.
foreach (array('js', 'css') as $type) {
foreach ($elements['#attached'][$type] as $data => $options) {
@@ -2516,7 +2517,7 @@ function drupal_process_attached($elements, $dependency_check = FALSE) {
$data = $options['data'];
unset($options['data']);
}
- call_user_func('drupal_add_' . $type, $data, $options);
+ call_user_func('_drupal_add_' . $type, $data, $options);
}
unset($elements['#attached'][$type]);
}
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 37f04f9..46113c6 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2495,7 +2495,7 @@ function template_preprocess_maintenance_page(&$variables) {
// While this code is used in the installer, the language module may not be
// enabled yet (even maybe no database set up yet), but an RTL language
// selected should result in RTL stylesheets loaded properly already.
- $css = drupal_add_css();
+ $css = _drupal_add_css();
include_once DRUPAL_ROOT . '/core/modules/language/language.module';
// Wrapping drupal_get_css() and drupal_get_js() in an object so they can
// be called when printed.
diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 256ea95..85cebb9 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -104,14 +104,14 @@ class AjaxResponse extends JsonResponse {
$items[$type] = array();
}
else {
- $function = 'drupal_add_' . $type;
+ $function = '_drupal_add_' . $type;
$items[$type] = $function();
drupal_alter($type, $items[$type]);
// @todo Inline CSS and JS items are indexed numerically. These can't be
// reliably diffed with array_diff_key(), since the number can change
// due to factors unrelated to the inline content, so for now, we
// strip the inline items from Ajax responses, and can add support for
- // them when drupal_add_css() and drupal_add_js() are changed to use
+ // them when _drupal_add_css() and _drupal_add_js() are changed to use
// a hash of the inline content as the array key.
foreach ($items[$type] as $key => $item) {
if (is_numeric($key)) {
@@ -150,7 +150,7 @@ class AjaxResponse extends JsonResponse {
}
// Prepend a command to merge changes and additions to drupalSettings.
- $scripts = drupal_add_js();
+ $scripts = _drupal_add_js();
if (!empty($scripts['settings'])) {
$settings = drupal_merge_js_settings($scripts['settings']['data']);
// During Ajax requests basic path-specific settings are excluded from
@@ -158,7 +158,7 @@ class AjaxResponse extends JsonResponse {
// from already has the right values for the keys below. An Ajax request
// would update them with values for the Ajax request and incorrectly
// override the page's values.
- // @see drupal_add_js
+ // @see _drupal_add_js()
foreach (array('basePath', 'currentPath', 'scriptPath', 'pathPrefix') as $item) {
unset($settings[$item]);
}
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php b/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
index 2ccabfa..a8f4355 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
@@ -58,7 +58,7 @@ class CssCollectionGrouper implements AssetCollectionGrouperInterface {
// Group file items if their 'preprocess' flag is TRUE.
// Help ensure maximum reuse of aggregate files by only grouping
// together items that share the same 'group' value and 'every_page'
- // flag. See drupal_add_css() for details about that.
+ // flag. See _drupal_add_css() for details about that.
$group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['every_page'], $item['media'], $item['browsers']) : FALSE;
break;
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php b/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
index 9f0aed0..3547b51 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
@@ -45,7 +45,7 @@ class JsCollectionGrouper implements AssetCollectionGrouperInterface {
// Group file items if their 'preprocess' flag is TRUE.
// Help ensure maximum reuse of aggregate files by only grouping
// together items that share the same 'group' value and 'every_page'
- // flag. See drupal_add_js() for details about that.
+ // flag. See _drupal_add_js() for details about that.
$group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['every_page'], $item['browsers']) : FALSE;
break;
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index b9de5f8..5f920d4 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -39,7 +39,7 @@ class JsCollectionRenderer implements AssetCollectionRendererInterface {
// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
- // URL changed. Files that should not be cached (see drupal_add_js())
+ // URL changed. Files that should not be cached (see _drupal_add_js())
// get REQUEST_TIME as query-string instead, to enforce reload on every
// page request.
$default_query_string = $this->state->get('system.css_js_query_string') ?: '0';
diff --git a/core/modules/edit/lib/Drupal/edit/EditController.php b/core/modules/edit/lib/Drupal/edit/EditController.php
index 4621f94..1e62ab6 100644
--- a/core/modules/edit/lib/Drupal/edit/EditController.php
+++ b/core/modules/edit/lib/Drupal/edit/EditController.php
@@ -275,8 +275,8 @@ class EditController implements ContainerInjectionInterface {
// When working with a hidden form, we don't want any CSS or JS to be loaded.
if ($request->request->get('nocssjs') === 'true') {
- drupal_static_reset('drupal_add_css');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_css');
+ drupal_static_reset('_drupal_add_js');
}
return $response;
diff --git a/core/modules/editor/editor.api.php b/core/modules/editor/editor.api.php
index 0f44381..fe9548b 100644
--- a/core/modules/editor/editor.api.php
+++ b/core/modules/editor/editor.api.php
@@ -91,7 +91,7 @@ function hook_editor_default_settings_alter(&$default_settings, $editor) {
* Modifies JavaScript settings that are added for text editors.
*
* @param array $settings
- * All the settings that will be added to the page via drupal_add_js() for
+ * All the settings that will be added to the page via _drupal_add_js() for
* the text formats to which a user has access.
* @param array $formats
* The list of format objects for which settings are being added.
diff --git a/core/modules/file/lib/Drupal/file/Controller/FileWidgetAjaxController.php b/core/modules/file/lib/Drupal/file/Controller/FileWidgetAjaxController.php
index dde6bbe..4036a1f 100644
--- a/core/modules/file/lib/Drupal/file/Controller/FileWidgetAjaxController.php
+++ b/core/modules/file/lib/Drupal/file/Controller/FileWidgetAjaxController.php
@@ -75,7 +75,7 @@ class FileWidgetAjaxController extends FormAjaxController {
$status_messages = array('#theme' => 'status_messages');
$form['#prefix'] .= drupal_render($status_messages);
$output = drupal_render($form);
- $js = drupal_add_js();
+ $js = _drupal_add_js();
$settings = drupal_merge_js_settings($js['settings']['data']);
$response = new AjaxResponse();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index eced538..b70a1e6 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
@@ -31,10 +31,10 @@ class FrameworkTest extends AjaxTestBase {
*/
public function testAJAXRender() {
// Verify that settings command is generated when JavaScript settings are
- // set via drupal_add_js().
+ // set via _drupal_add_js().
$commands = $this->drupalGetAJAX('ajax-test/render');
$expected = new SettingsCommand(array('ajax' => 'test'), TRUE);
- $this->assertCommand($commands, $expected->render(), 'ajax_render() loads settings added with drupal_add_js().');
+ $this->assertCommand($commands, $expected->render(), 'ajax_render() loads settings added with _drupal_add_js().');
}
/**
@@ -46,7 +46,7 @@ class FrameworkTest extends AjaxTestBase {
// Expected commands, in a very specific order.
$expected_commands[0] = new SettingsCommand(array('ajax' => 'test'), TRUE);
- drupal_static_reset('drupal_add_css');
+ drupal_static_reset('_drupal_add_css');
$attached = array(
'#attached' => array(
'css' => array(
@@ -56,8 +56,8 @@ class FrameworkTest extends AjaxTestBase {
),
);
drupal_render($attached);
- $expected_commands[1] = new AddCssCommand(drupal_get_css(drupal_add_css(), TRUE));
- drupal_static_reset('drupal_add_js');
+ $expected_commands[1] = new AddCssCommand(drupal_get_css(_drupal_add_css(), TRUE));
+ drupal_static_reset('_drupal_add_js');
$attached = array(
'#attached' => array(
'js' => array(
@@ -66,8 +66,8 @@ class FrameworkTest extends AjaxTestBase {
),
);
drupal_render($attached);
- $expected_commands[2] = new PrependCommand('head', drupal_get_js('header', drupal_add_js(), TRUE));
- drupal_static_reset('drupal_add_js');
+ $expected_commands[2] = new PrependCommand('head', drupal_get_js('header', _drupal_add_js(), TRUE));
+ drupal_static_reset('_drupal_add_js');
$attached = array(
'#attached' => array(
'js' => array(
@@ -76,7 +76,7 @@ class FrameworkTest extends AjaxTestBase {
),
);
drupal_render($attached);
- $expected_commands[3] = new AppendCommand('body', drupal_get_js('footer', drupal_add_js(), TRUE));
+ $expected_commands[3] = new AppendCommand('body', drupal_get_js('footer', _drupal_add_js(), TRUE));
$expected_commands[4] = new HtmlCommand('body', 'Hello, world!');
// Load any page with at least one CSS file, at least one JavaScript file
@@ -123,7 +123,7 @@ class FrameworkTest extends AjaxTestBase {
'css' => drupal_get_path('module', 'system') . '/css/system.admin.css',
'js' => drupal_get_path('module', 'system') . '/system.js',
);
- // CSS files are stored by basename, see drupal_add_css().
+ // CSS files are stored by basename, see _drupal_add_css().
$expected_css_basename = drupal_basename($expected['css']);
// @todo D8: Add a drupal_css_defaults() helper function.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
index 052ea57..5c016ce 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
@@ -32,15 +32,15 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
function setUp() {
parent::setUp();
- // Reset drupal_add_css() before each test.
- drupal_static_reset('drupal_add_css');
+ // Reset _drupal_add_css() before each test.
+ drupal_static_reset('_drupal_add_css');
}
/**
* Checks that default stylesheets are empty.
*/
function testDefault() {
- $this->assertEqual(array(), drupal_add_css(), 'Default CSS is empty.');
+ $this->assertEqual(array(), _drupal_add_css(), 'Default CSS is empty.');
}
/**
@@ -48,7 +48,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testAddFile() {
$path = drupal_get_path('module', 'simpletest') . '/css/simpletest.module.css';
- $css = drupal_add_css($path);
+ $css = _drupal_add_css($path);
$this->assertEqual($css['simpletest.module.css']['data'], $path);
}
@@ -57,7 +57,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testAddExternal() {
$path = 'http://example.com/style.css';
- $css = drupal_add_css($path, 'external');
+ $css = _drupal_add_css($path, 'external');
$this->assertEqual($css[$path]['type'], 'external', 'Adding an external CSS file caches it properly.');
}
@@ -65,8 +65,8 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
* Makes sure that resetting the CSS empties the cache.
*/
function testReset() {
- drupal_static_reset('drupal_add_css');
- $this->assertEqual(array(), drupal_add_css(), 'Resetting the CSS empties the cache.');
+ drupal_static_reset('_drupal_add_css');
+ $this->assertEqual(array(), _drupal_add_css(), 'Resetting the CSS empties the cache.');
}
/**
@@ -74,7 +74,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testRenderFile() {
$css = drupal_get_path('module', 'simpletest') . '/css/simpletest.module.css';
- drupal_add_css($css);
+ _drupal_add_css($css);
$styles = drupal_get_css();
$this->assertTrue(strpos($styles, $css) > 0, 'Rendered CSS includes the added stylesheet.');
// Verify that newlines are properly added inside style tags.
@@ -88,7 +88,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testRenderExternal() {
$css = 'http://example.com/style.css';
- drupal_add_css($css, 'external');
+ _drupal_add_css($css, 'external');
$styles = drupal_get_css();
// Stylesheet URL may be the href of a LINK tag or in an @import statement
// of a STYLE tag.
@@ -105,7 +105,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
$css = 'body { padding: 0px; }';
$css_preprocessed = '<style media="all">' . "\n/* <![CDATA[ */\n" . "body{padding:0px;}\n" . "\n/* ]]> */\n" . '</style>';
- drupal_add_css($css, array('type' => 'inline'));
+ _drupal_add_css($css, array('type' => 'inline'));
$styles = drupal_get_css();
$this->assertEqual(trim($styles), $css_preprocessed, 'Rendering preprocessed inline CSS adds it to the page.');
}
@@ -115,7 +115,7 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testRenderInlineNoPreprocess() {
$css = 'body { padding: 0px; }';
- drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
+ _drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
$styles = drupal_get_css();
$this->assertTrue(strpos($styles, $css) > 0, 'Rendering non-preprocessed inline CSS adds it to the page.');
}
@@ -125,12 +125,12 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
*/
function testRenderOrder() {
// Load a module CSS file.
- drupal_add_css(drupal_get_path('module', 'simpletest') . '/css/simpletest.module.css');
+ _drupal_add_css(drupal_get_path('module', 'simpletest') . '/css/simpletest.module.css');
// Load a few system CSS files in a custom, early-loading aggregate group.
$test_aggregate_group = -100;
$system_path = drupal_get_path('module', 'system');
- drupal_add_css($system_path . '/css/system.module.css', array('group' => $test_aggregate_group, 'weight' => -10));
- drupal_add_css($system_path . '/css/system.theme.css', array('group' => $test_aggregate_group));
+ _drupal_add_css($system_path . '/css/system.module.css', array('group' => $test_aggregate_group, 'weight' => -10));
+ _drupal_add_css($system_path . '/css/system.theme.css', array('group' => $test_aggregate_group));
$expected = array(
$system_path . '/css/system.module.css',
@@ -157,16 +157,16 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
function testRenderOverride() {
$system = drupal_get_path('module', 'system');
- drupal_add_css($system . '/css/system.module.css');
- drupal_add_css($system . '/tests/css/system.module.css');
+ _drupal_add_css($system . '/css/system.module.css');
+ _drupal_add_css($system . '/tests/css/system.module.css');
// The dummy stylesheet should be the only one included.
$styles = drupal_get_css();
$this->assert(strpos($styles, $system . '/tests/css/system.module.css') !== FALSE, 'The overriding CSS file is output.');
$this->assert(strpos($styles, $system . '/css/system.module.css') === FALSE, 'The overridden CSS file is not output.');
- drupal_add_css($system . '/tests/css/system.module.css');
- drupal_add_css($system . '/css/system.module.css');
+ _drupal_add_css($system . '/tests/css/system.module.css');
+ _drupal_add_css($system . '/css/system.module.css');
// The standard stylesheet should be the only one included.
$styles = drupal_get_css();
@@ -180,8 +180,8 @@ class CascadingStylesheetsTest extends DrupalUnitTestBase {
function testAddCssFileWithQueryString() {
$css_without_query_string = drupal_get_path('module', 'node') . '/css/node.admin.css';
$css_with_query_string = '/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2';
- drupal_add_css($css_without_query_string);
- drupal_add_css($css_with_query_string);
+ _drupal_add_css($css_without_query_string);
+ _drupal_add_css($css_with_query_string);
$styles = drupal_get_css();
$query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
index 3f584aa..2e529e4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
@@ -47,8 +47,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
$config->set('js.preprocess', 0);
$config->save();
- // Reset drupal_add_js() and drupal_add_library() statics before each test.
- drupal_static_reset('drupal_add_js');
+ // Reset _drupal_add_js() and drupal_add_library() statics before each test.
+ drupal_static_reset('_drupal_add_js');
drupal_static_reset('drupal_add_library');
}
@@ -64,14 +64,14 @@ class JavaScriptTest extends DrupalUnitTestBase {
* Tests that default JavaScript is empty.
*/
function testDefault() {
- $this->assertEqual(array(), drupal_add_js(), 'Default JavaScript is empty.');
+ $this->assertEqual(array(), _drupal_add_js(), 'Default JavaScript is empty.');
}
/**
* Tests adding a JavaScript file.
*/
function testAddFile() {
- $javascript = drupal_add_js('core/misc/collapse.js');
+ $javascript = _drupal_add_js('core/misc/collapse.js');
$this->assertTrue(array_key_exists('core/misc/collapse.js', $javascript), 'JavaScript files are correctly added.');
}
@@ -81,11 +81,11 @@ class JavaScriptTest extends DrupalUnitTestBase {
function testAddSetting() {
// Add a file in order to test default settings.
drupal_add_library('system', 'drupalSettings');
- $javascript = drupal_add_js();
+ $javascript = _drupal_add_js();
$last_settings = reset($javascript['settings']['data']);
$this->assertTrue(array_key_exists('currentPath', $last_settings), 'The current path JavaScript setting is set correctly.');
- $javascript = drupal_add_js(array('drupal' => 'rocks', 'dries' => 280342800), 'setting');
+ $javascript = _drupal_add_js(array('drupal' => 'rocks', 'dries' => 280342800), 'setting');
$last_settings = end($javascript['settings']['data']);
$this->assertEqual(280342800, $last_settings['dries'], 'JavaScript setting is set correctly.');
$this->assertEqual('rocks', $last_settings['drupal'], 'The other JavaScript setting is set correctly.');
@@ -96,7 +96,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testAddExternal() {
$path = 'http://example.com/script.js';
- $javascript = drupal_add_js($path, 'external');
+ $javascript = _drupal_add_js($path, 'external');
$this->assertTrue(array_key_exists('http://example.com/script.js', $javascript), 'Added an external JavaScript file.');
}
@@ -107,8 +107,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
$default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
drupal_add_library('system', 'drupal');
- drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer')));
- drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer')));
+ _drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer')));
+ _drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer')));
$javascript = drupal_get_js();
$expected_1 = '<script src="http://example.com/script.js?' . $default_query_string . '" defer="defer"></script>';
@@ -128,8 +128,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
$default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
drupal_add_library('system', 'drupal');
- drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer')));
- drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer')));
+ _drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer')));
+ _drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer')));
$javascript = drupal_get_js();
$expected_1 = '<script src="http://example.com/script.js?' . $default_query_string . '" defer="defer"></script>';
@@ -152,40 +152,40 @@ class JavaScriptTest extends DrupalUnitTestBase {
$this->assertTrue(strpos($javascript, 'currentPath') > 0, 'Rendered JavaScript header returns currentPath setting.');
// Only the second of these two entries should appear in drupalSettings.
- drupal_add_js(array('commonTest' => 'commonTestShouldNotAppear'), 'setting');
- drupal_add_js(array('commonTest' => 'commonTestShouldAppear'), 'setting');
+ _drupal_add_js(array('commonTest' => 'commonTestShouldNotAppear'), 'setting');
+ _drupal_add_js(array('commonTest' => 'commonTestShouldAppear'), 'setting');
// Only the second of these entries should appear in drupalSettings.
- drupal_add_js(array('commonTestJsArrayLiteral' => array('commonTestJsArrayLiteralOldValue')), 'setting');
- drupal_add_js(array('commonTestJsArrayLiteral' => array('commonTestJsArrayLiteralNewValue')), 'setting');
+ _drupal_add_js(array('commonTestJsArrayLiteral' => array('commonTestJsArrayLiteralOldValue')), 'setting');
+ _drupal_add_js(array('commonTestJsArrayLiteral' => array('commonTestJsArrayLiteralNewValue')), 'setting');
// Only the second of these two entries should appear in drupalSettings.
- drupal_add_js(array('commonTestJsObjectLiteral' => array('key' => 'commonTestJsObjectLiteralOldValue')), 'setting');
- drupal_add_js(array('commonTestJsObjectLiteral' => array('key' => 'commonTestJsObjectLiteralNewValue')), 'setting');
+ _drupal_add_js(array('commonTestJsObjectLiteral' => array('key' => 'commonTestJsObjectLiteralOldValue')), 'setting');
+ _drupal_add_js(array('commonTestJsObjectLiteral' => array('key' => 'commonTestJsObjectLiteralNewValue')), 'setting');
// Real world test case: multiple elements in a render array are adding the
// same (or nearly the same) JavaScript settings. When merged, they should
// contain all settings and not duplicate some settings.
$settings_one = array('moduleName' => array('ui' => array('button A', 'button B'), 'magical flag' => 3.14159265359));
- drupal_add_js(array('commonTestRealWorldIdentical' => $settings_one), 'setting');
- drupal_add_js(array('commonTestRealWorldIdentical' => $settings_one), 'setting');
+ _drupal_add_js(array('commonTestRealWorldIdentical' => $settings_one), 'setting');
+ _drupal_add_js(array('commonTestRealWorldIdentical' => $settings_one), 'setting');
$settings_two = array('moduleName' => array('ui' => array('button A', 'button B'), 'magical flag' => 3.14159265359, 'thingiesOnPage' => array('id1' => array())));
- drupal_add_js(array('commonTestRealWorldAlmostIdentical' => $settings_two), 'setting');
+ _drupal_add_js(array('commonTestRealWorldAlmostIdentical' => $settings_two), 'setting');
$settings_two = array('moduleName' => array('ui' => array('button C', 'button D'), 'magical flag' => 3.14, 'thingiesOnPage' => array('id2' => array())));
- drupal_add_js(array('commonTestRealWorldAlmostIdentical' => $settings_two), 'setting');
+ _drupal_add_js(array('commonTestRealWorldAlmostIdentical' => $settings_two), 'setting');
$javascript = drupal_get_js('header');
- // Test whether drupal_add_js can be used to override a previous setting.
+ // Test whether _drupal_add_js can be used to override a previous setting.
$this->assertTrue(strpos($javascript, 'commonTestShouldAppear') > 0, 'Rendered JavaScript header returns custom setting.');
- $this->assertTrue(strpos($javascript, 'commonTestShouldNotAppear') === FALSE, 'drupal_add_js() correctly overrides a custom setting.');
+ $this->assertTrue(strpos($javascript, 'commonTestShouldNotAppear') === FALSE, '_drupal_add_js() correctly overrides a custom setting.');
- // Test whether drupal_add_js can be used to add and override a JavaScript
+ // Test whether _drupal_add_js can be used to add and override a JavaScript
// array literal (an indexed PHP array) values.
$array_override = strpos($javascript, 'commonTestJsArrayLiteralNewValue') > 0 && strpos($javascript, 'commonTestJsArrayLiteralOldValue') === FALSE;
- $this->assertTrue($array_override, 'drupal_add_js() correctly overrides settings within an array literal (indexed array).');
+ $this->assertTrue($array_override, '_drupal_add_js() correctly overrides settings within an array literal (indexed array).');
- // Test whether drupal_add_js can be used to add and override a JavaScript
+ // Test whether _drupal_add_js can be used to add and override a JavaScript
// object literal (an associate PHP array) values.
$associative_array_override = strpos($javascript, 'commonTestJsObjectLiteralNewValue') > 0 && strpos($javascript, 'commonTestJsObjectLiteralOldValue') === FALSE;
- $this->assertTrue($associative_array_override, 'drupal_add_js() correctly overrides settings within an object literal (associative array).');
+ $this->assertTrue($associative_array_override, '_drupal_add_js() correctly overrides settings within an object literal (associative array).');
// Parse the generated drupalSettings <script> back to a PHP representation.
$startToken = 'drupalSettings = ';
@@ -197,8 +197,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
// Test whether the two real world cases are handled correctly.
$settings_two['moduleName']['thingiesOnPage']['id1'] = array();
- $this->assertIdentical($settings_one, $parsed_settings['commonTestRealWorldIdentical'], 'drupal_add_js handled real world test case 1 correctly.');
- $this->assertEqual($settings_two, $parsed_settings['commonTestRealWorldAlmostIdentical'], 'drupal_add_js handled real world test case 2 correctly.');
+ $this->assertIdentical($settings_one, $parsed_settings['commonTestRealWorldIdentical'], '_drupal_add_js handled real world test case 1 correctly.');
+ $this->assertEqual($settings_two, $parsed_settings['commonTestRealWorldAlmostIdentical'], '_drupal_add_js handled real world test case 2 correctly.');
}
/**
@@ -206,9 +206,9 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testReset() {
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/collapse.js');
- drupal_static_reset('drupal_add_js');
- $this->assertEqual(array(), drupal_add_js(), 'Resetting the JavaScript correctly empties the cache.');
+ _drupal_add_js('core/misc/collapse.js');
+ drupal_static_reset('_drupal_add_js');
+ $this->assertEqual(array(), _drupal_add_js(), 'Resetting the JavaScript correctly empties the cache.');
}
/**
@@ -217,7 +217,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
function testAddInline() {
drupal_add_library('system', 'jquery');
$inline = 'jQuery(function () { });';
- $javascript = drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer'));
+ $javascript = _drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer'));
$this->assertTrue(array_key_exists('core/assets/vendor/jquery/jquery.js', $javascript), 'jQuery is added when inline scripts are added.');
$data = end($javascript);
$this->assertEqual($inline, $data['data'], 'Inline JavaScript is correctly added to the footer.');
@@ -229,7 +229,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
function testRenderExternal() {
drupal_add_library('system', 'drupal');
$external = 'http://example.com/example.js';
- drupal_add_js($external, 'external');
+ _drupal_add_js($external, 'external');
$javascript = drupal_get_js();
// Local files have a base_path() prefix, external files should not.
$this->assertTrue(strpos($javascript, 'src="' . $external) > 0, 'Rendering an external JavaScript file.');
@@ -241,17 +241,17 @@ class JavaScriptTest extends DrupalUnitTestBase {
function testFooterHTML() {
drupal_add_library('system', 'drupal');
$inline = 'jQuery(function () { });';
- drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer'));
+ _drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer'));
$javascript = drupal_get_js('footer');
$this->assertTrue(strpos($javascript, $inline) > 0, 'Rendered JavaScript footer returns the inline code.');
}
/**
- * Tests drupal_add_js() sets preproccess to FALSE when cache is also FALSE.
+ * Tests _drupal_add_js() sets preproccess to FALSE when cache is also FALSE.
*/
function testNoCache() {
drupal_add_library('system', 'drupal');
- $javascript = drupal_add_js('core/misc/collapse.js', array('cache' => FALSE));
+ $javascript = _drupal_add_js('core/misc/collapse.js', array('cache' => FALSE));
$this->assertFalse($javascript['core/misc/collapse.js']['preprocess'], 'Setting cache to FALSE sets proprocess to FALSE when adding JavaScript.');
}
@@ -260,7 +260,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testDifferentGroup() {
drupal_add_library('system', 'drupal');
- $javascript = drupal_add_js('core/misc/collapse.js', array('group' => JS_THEME));
+ $javascript = _drupal_add_js('core/misc/collapse.js', array('group' => JS_THEME));
$this->assertEqual($javascript['core/misc/collapse.js']['group'], JS_THEME, 'Adding a JavaScript file with a different group caches the given group.');
}
@@ -268,7 +268,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
* Tests adding a JavaScript file with a different weight.
*/
function testDifferentWeight() {
- $javascript = drupal_add_js('core/misc/collapse.js', array('weight' => 2));
+ $javascript = _drupal_add_js('core/misc/collapse.js', array('weight' => 2));
$this->assertEqual($javascript['core/misc/collapse.js']['weight'], 2, 'Adding a JavaScript file with a different weight caches the given weight.');
}
@@ -281,8 +281,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
$default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/collapse.js', array('browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE)));
- drupal_add_js('jQuery(function () { });', array('type' => 'inline', 'browsers' => array('IE' => FALSE)));
+ _drupal_add_js('core/misc/collapse.js', array('browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE)));
+ _drupal_add_js('jQuery(function () { });', array('type' => 'inline', 'browsers' => array('IE' => FALSE)));
$javascript = drupal_get_js();
$expected_1 = "<!--[if lte IE 8]>\n" . '<script src="' . file_create_url('core/misc/collapse.js') . '?' . $default_query_string . '"></script>' . "\n<![endif]-->";
@@ -297,8 +297,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testVersionQueryString() {
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/collapse.js', array('version' => 'foo'));
- drupal_add_js('core/misc/ajax.js', array('version' => 'bar'));
+ _drupal_add_js('core/misc/collapse.js', array('version' => 'foo'));
+ _drupal_add_js('core/misc/ajax.js', array('version' => 'bar'));
$javascript = drupal_get_js();
$this->assertTrue(strpos($javascript, 'core/misc/collapse.js?v=foo') > 0 && strpos($javascript, 'core/misc/ajax.js?v=bar') > 0 , 'JavaScript version identifiers correctly appended to URLs');
}
@@ -314,10 +314,10 @@ class JavaScriptTest extends DrupalUnitTestBase {
// same regardless of whether aggregation is enabled, so ensure this
// expected order, first with aggregation off.
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/ajax.js');
- drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE));
- drupal_add_js('core/misc/autocomplete.js');
- drupal_add_js('core/misc/batch.js', array('every_page' => TRUE));
+ _drupal_add_js('core/misc/ajax.js');
+ _drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE));
+ _drupal_add_js('core/misc/autocomplete.js');
+ _drupal_add_js('core/misc/batch.js', array('every_page' => TRUE));
$javascript = drupal_get_js();
$expected = implode("\n", array(
'<script src="' . file_create_url('core/misc/collapse.js') . '?' . $default_query_string . '"></script>',
@@ -329,16 +329,16 @@ class JavaScriptTest extends DrupalUnitTestBase {
// Now ensure that with aggregation on, one file is made for the
// 'every_page' files, and one file is made for the others.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$config = \Drupal::config('system.performance');
$config->set('js.preprocess', 1);
$config->save();
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/ajax.js');
- drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE));
- drupal_add_js('core/misc/autocomplete.js');
- drupal_add_js('core/misc/batch.js', array('every_page' => TRUE));
- $js_items = drupal_add_js();
+ _drupal_add_js('core/misc/ajax.js');
+ _drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE));
+ _drupal_add_js('core/misc/autocomplete.js');
+ _drupal_add_js('core/misc/batch.js', array('every_page' => TRUE));
+ $js_items = _drupal_add_js();
$javascript = drupal_get_js();
$expected = implode("\n", array(
'<script src="' . $this->calculateAggregateFilename(array('core/misc/collapse.js' => $js_items['core/misc/collapse.js'], 'core/misc/batch.js' => $js_items['core/misc/batch.js'])) . '"></script>',
@@ -353,14 +353,14 @@ class JavaScriptTest extends DrupalUnitTestBase {
function testAggregationOrder() {
// Enable JavaScript aggregation.
\Drupal::config('system.performance')->set('js.preprocess', 1)->save();
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
// Add two JavaScript files to the current request and build the cache.
drupal_add_library('system', 'drupal');
- drupal_add_js('core/misc/ajax.js');
- drupal_add_js('core/misc/autocomplete.js');
+ _drupal_add_js('core/misc/ajax.js');
+ _drupal_add_js('core/misc/autocomplete.js');
- $js_items = drupal_add_js();
+ $js_items = _drupal_add_js();
$scripts_html = array(
'#type' => 'scripts',
'#items' => array(
@@ -376,14 +376,14 @@ class JavaScriptTest extends DrupalUnitTestBase {
// Reset variables and add a file in a different scope first.
\Drupal::state()->delete('system.js_cache_files');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
drupal_add_library('system', 'drupal');
- drupal_add_js('some/custom/javascript_file.js', array('scope' => 'footer'));
- drupal_add_js('core/misc/ajax.js');
- drupal_add_js('core/misc/autocomplete.js');
+ _drupal_add_js('some/custom/javascript_file.js', array('scope' => 'footer'));
+ _drupal_add_js('core/misc/ajax.js');
+ _drupal_add_js('core/misc/autocomplete.js');
// Rebuild the cache.
- $js_items = drupal_add_js();
+ $js_items = _drupal_add_js();
$scripts_html = array(
'#type' => 'scripts',
'#items' => array(
@@ -404,16 +404,16 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testRenderOrder() {
// Add a bunch of JavaScript in strange ordering.
- drupal_add_js('(function($){alert("Weight 5 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));
- drupal_add_js('(function($){alert("Weight 0 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
- drupal_add_js('(function($){alert("Weight 0 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
- drupal_add_js('(function($){alert("Weight -8 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
- drupal_add_js('(function($){alert("Weight -8 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
- drupal_add_js('(function($){alert("Weight -8 #3");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
- drupal_add_js('http://example.com/example.js?Weight -5 #1', array('type' => 'external', 'scope' => 'footer', 'weight' => -5));
- drupal_add_js('(function($){alert("Weight -8 #4");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
- drupal_add_js('(function($){alert("Weight 5 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));
- drupal_add_js('(function($){alert("Weight 0 #3");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
+ _drupal_add_js('(function($){alert("Weight 5 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));
+ _drupal_add_js('(function($){alert("Weight 0 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
+ _drupal_add_js('(function($){alert("Weight 0 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
+ _drupal_add_js('(function($){alert("Weight -8 #1");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
+ _drupal_add_js('(function($){alert("Weight -8 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
+ _drupal_add_js('(function($){alert("Weight -8 #3");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
+ _drupal_add_js('http://example.com/example.js?Weight -5 #1', array('type' => 'external', 'scope' => 'footer', 'weight' => -5));
+ _drupal_add_js('(function($){alert("Weight -8 #4");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => -8));
+ _drupal_add_js('(function($){alert("Weight 5 #2");})(jQuery);', array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));
+ _drupal_add_js('(function($){alert("Weight 0 #3");})(jQuery);', array('type' => 'inline', 'scope' => 'footer'));
// Construct the expected result from the regex.
$expected = array(
@@ -449,7 +449,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
// flag, then by weight (see drupal_sort_css_js()), so to test the effect of
// weight, we need the other two options to be the same.
drupal_add_library('system', 'jquery');
- drupal_add_js('core/misc/collapse.js', array('group' => JS_LIBRARY, 'every_page' => TRUE, 'weight' => -21));
+ _drupal_add_js('core/misc/collapse.js', array('group' => JS_LIBRARY, 'every_page' => TRUE, 'weight' => -21));
$javascript = drupal_get_js();
$this->assertTrue(strpos($javascript, 'core/misc/collapse.js') < strpos($javascript, 'core/assets/vendor/jquery/jquery.js'), 'Rendering a JavaScript file above jQuery.');
}
@@ -461,8 +461,8 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testAlter() {
// Add both tableselect.js and simpletest.js, with a larger weight on SimpleTest.
- drupal_add_js('core/misc/tableselect.js');
- drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js', array('weight' => 9999));
+ _drupal_add_js('core/misc/tableselect.js');
+ _drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js', array('weight' => 9999));
// Render the JavaScript, testing if simpletest.js was altered to be before
// tableselect.js. See simpletest_js_alter() to see where this alteration
@@ -564,7 +564,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testAddJsFileWithQueryString() {
$js = drupal_get_path('module', 'node') . '/node.js';
- drupal_add_js($js);
+ _drupal_add_js($js);
$query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
$scripts = drupal_get_js();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
index 12d02b0..148dcdd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
@@ -369,7 +369,7 @@ class RenderTest extends DrupalUnitTestBase {
// Load the element from cache and verify the presence of the #attached
// JavaScript.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = array('#cache' => array('keys' => array('simpletest', 'drupal_render', 'children_attached')));
$this->assertTrue(strlen(drupal_render($element)) > 0, 'The element was retrieved from cache.');
$scripts = drupal_get_js();
@@ -461,7 +461,7 @@ class RenderTest extends DrupalUnitTestBase {
);
// #cache disabled.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#markup'] = '<p>#cache disabled</p>';
$output = drupal_render($element);
@@ -477,7 +477,7 @@ class RenderTest extends DrupalUnitTestBase {
\Drupal::request()->setMethod('GET');
// GET request: #cache enabled, cache miss.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache'] = array('cid' => 'post_render_cache_test_GET');
$element['#markup'] = '<p>#cache enabled, GET</p>';
@@ -501,7 +501,7 @@ class RenderTest extends DrupalUnitTestBase {
$this->assertIdentical($cached_element, $expected_element, 'The correct data is cached: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.');
// GET request: #cache enabled, cache hit.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element['#cache'] = array('cid' => 'post_render_cache_test_GET');
$element['#markup'] = '<p>#cache enabled, GET</p>';
$output = drupal_render($element);
@@ -518,7 +518,7 @@ class RenderTest extends DrupalUnitTestBase {
\Drupal::request()->setMethod('POST');
// POST request: #cache enabled, cache miss.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache'] = array('cid' => 'post_render_cache_test_POST');
$element['#markup'] = '<p>#cache enabled, POST</p>';
@@ -551,7 +551,7 @@ class RenderTest extends DrupalUnitTestBase {
// Test case 1.
// Create an element with a child and subchild. Each element has the same
// #post_render_cache callback, but with different contexts.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$context_1 = array('foo' => $this->randomString());
$context_2 = array('bar' => $this->randomString());
$context_3 = array('baz' => $this->randomString());
@@ -621,7 +621,7 @@ class RenderTest extends DrupalUnitTestBase {
$this->assertIdentical($cached_element, $expected_element, 'The correct data is cached: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.');
// GET request: #cache enabled, cache hit.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$output = drupal_render($element);
$this->assertIdentical($output, '<p>overridden</p>', 'Output is overridden.');
@@ -639,7 +639,7 @@ class RenderTest extends DrupalUnitTestBase {
// #post_render_cache callbacks. I.e. the #post_render_cache callbacks may
// not yet have run, or otherwise the cached parent element would contain
// personalized data, thereby breaking the render cache.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_parent');
$element['child']['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_child');
@@ -699,7 +699,7 @@ class RenderTest extends DrupalUnitTestBase {
$this->assertIdentical($cached_child_element, $expected_child_element, 'The correct data is cached for the child: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.');
// GET request: #cache enabled, cache hit, parent element.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_parent');
$output = drupal_render($element);
@@ -711,7 +711,7 @@ class RenderTest extends DrupalUnitTestBase {
$this->assertIdentical($settings['common_test'], $expected_settings, '#attached is modified; JavaScript settings for each #post_render_cache callback are added to page.');
// GET request: #cache enabled, cache hit, child element.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['child']['#cache']['keys'] = array('simpletest', 'drupal_render', 'children_post_render_cache', 'nested_cache_child');
$element = $element['child'];
@@ -744,7 +744,7 @@ class RenderTest extends DrupalUnitTestBase {
$expected_output = '<foo><bar>' . $context['bar'] . '</bar></foo>';
// #cache disabled.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$output = drupal_render($element);
$this->assertIdentical($output, $expected_output, 'Placeholder was replaced in output');
@@ -756,7 +756,7 @@ class RenderTest extends DrupalUnitTestBase {
\Drupal::request()->setMethod('GET');
// GET request: #cache enabled, cache miss.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache'] = array('cid' => 'render_cache_placeholder_test_GET');
$output = drupal_render($element);
@@ -785,7 +785,7 @@ class RenderTest extends DrupalUnitTestBase {
$this->assertIdentical($cached_element, $expected_element, 'The correct data is cached: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.');
// GET request: #cache enabled, cache hit.
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
$element = $test_element;
$element['#cache'] = array('cid' => 'render_cache_placeholder_test_GET');
$output = drupal_render($element);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
index 1cea46a..1a9d3d1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
@@ -28,10 +28,10 @@ class TableTest extends WebTestBase {
$header = array('one', 'two', 'three');
$rows = array(array(1,2,3), array(4,5,6), array(7,8,9));
$this->content = theme('table', array('header' => $header, 'rows' => $rows, 'sticky' => TRUE));
- $js = drupal_add_js();
+ $js = _drupal_add_js();
$this->assertTrue(isset($js['core/misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.');
$this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
}
/**
@@ -44,10 +44,10 @@ class TableTest extends WebTestBase {
$caption = NULL;
$colgroups = array();
$this->content = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes, 'caption' => $caption, 'colgroups' => $colgroups, 'sticky' => FALSE));
- $js = drupal_add_js();
+ $js = _drupal_add_js();
$this->assertFalse(isset($js['core/misc/tableheader.js']), 'tableheader.js was not included because $sticky = FALSE.');
$this->assertNoRaw('sticky-enabled', 'Table does not have a class of sticky-enabled because $sticky = FALSE.');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_js');
}
/**
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index cabea75..1de6b15 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -270,7 +270,7 @@ function hook_element_info_alter(&$type) {
* @param $javascript
* An array of all JavaScript being presented on the page.
*
- * @see drupal_add_js()
+ * @see _drupal_add_js()
* @see drupal_get_js()
* @see drupal_js_defaults()
*/
@@ -293,11 +293,11 @@ function hook_js_alter(&$javascript) {
* version_compare() to compare different versions.
* - 'js': An array of JavaScript elements; each element's key is used as $data
* argument, each element's value is used as $options array for
- * drupal_add_js(). To add library-specific (not module-specific) JavaScript
+ * _drupal_add_js(). To add library-specific (not module-specific) JavaScript
* settings, the key may be skipped, the value must specify
* 'type' => 'setting', and the actual settings must be contained in a 'data'
* element of the value.
- * - 'css': Like 'js', an array of CSS elements passed to drupal_add_css().
+ * - 'css': Like 'js', an array of CSS elements passed to _drupal_add_css().
* - 'dependencies': An array of libraries that are required for a library. Each
* element is an array listing the module and name of another library. Note
* that all dependencies for each dependent library will also be added when
@@ -390,7 +390,7 @@ function hook_library_info_alter(&$libraries, $module) {
* @param $css
* An array of all CSS items (files and inline CSS) being requested on the page.
*
- * @see drupal_add_css()
+ * @see _drupal_add_css()
* @see drupal_get_css()
*/
function hook_css_alter(&$css) {
@@ -2572,7 +2572,7 @@ function hook_install_tasks(&$install_state) {
*
* Elements available to be altered are only those added using
* drupal_add_html_head_link() or drupal_add_html_head(). CSS and JS files
- * are handled using drupal_add_css() and drupal_add_js(), so the head links
+ * are handled using _drupal_add_css() and _drupal_add_js(), so the head links
* for those files will not appear in the $head_elements array.
*
* @param $head_elements
diff --git a/core/modules/system/tests/modules/ajax_test/ajax_test.module b/core/modules/system/tests/modules/ajax_test/ajax_test.module
index eba9efb..2ea9eb9 100644
--- a/core/modules/system/tests/modules/ajax_test/ajax_test.module
+++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module
@@ -24,7 +24,7 @@ function ajax_test_system_theme_info() {
* Menu callback: Returns an element suitable for use by ajax_render().
*
* Additionally ensures that ajax_render() incorporates JavaScript settings
- * generated during the page request by invoking drupal_add_js() with a dummy
+ * generated during the page request by invoking _drupal_add_js() with a dummy
* setting.
*
* @deprecated \Drupal\ajax_test\Controller\AjaxTestController::render()
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php
index 29d3a21..dca282f 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php
@@ -142,17 +142,17 @@ class CacheTest extends PluginTestBase {
$output = $view->preview();
drupal_render($output);
unset($view->pre_render_called);
- drupal_static_reset('drupal_add_css');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_css');
+ drupal_static_reset('_drupal_add_js');
$view->destroy();
$view->setDisplay();
$output = $view->preview();
drupal_render($output);
- $css = drupal_add_css();
+ $css = _drupal_add_css();
$css_path = drupal_get_path('module', 'views_test_data') . '/views_cache.test.css';
$js_path = drupal_get_path('module', 'views_test_data') . '/views_cache.test.js';
- $js = drupal_add_js();
+ $js = _drupal_add_js();
$this->assertTrue(isset($css[basename($css_path)]), 'Make sure the css is added for cached views.');
$this->assertTrue(isset($js[$js_path]), 'Make sure the js is added for cached views.');
@@ -176,15 +176,15 @@ class CacheTest extends PluginTestBase {
$output = $view->preview();
drupal_render($output);
- drupal_static_reset('drupal_add_css');
- drupal_static_reset('drupal_add_js');
+ drupal_static_reset('_drupal_add_css');
+ drupal_static_reset('_drupal_add_js');
$view->destroy();
$output = $view->preview();
drupal_render($output);
- $css = drupal_add_css();
- $js = drupal_add_js();
+ $css = _drupal_add_css();
+ $js = _drupal_add_js();
$this->assertFalse(isset($css['system.maintenance.css']), 'Make sure that unrelated css is not added.');
$this->assertFalse(isset($js[drupal_get_path('module', 'user') . '/user.permissions.js']), 'Make sure that unrelated js is not added.');
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
index cfb0a8b..2f1273c 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
@@ -122,11 +122,11 @@ abstract class ViewsFormBase extends FormBase implements ViewsFormInterface {
// With the below logic, we may end up rendering a form twice (or two forms
// each sharing the same element ids), potentially resulting in
- // drupal_add_js() being called twice to add the same setting. drupal_get_js()
+ // _drupal_add_js() being called twice to add the same setting. drupal_get_js()
// is ok with that, but until ajax_render() is (http://drupal.org/node/208611),
- // reset the drupal_add_js() static before rendering the second time.
- $drupal_add_js_original = drupal_add_js();
- $drupal_add_js = &drupal_static('drupal_add_js');
+ // reset the _drupal_add_js() static before rendering the second time.
+ $drupal_add_js_original = _drupal_add_js();
+ $drupal_add_js = &drupal_static('_drupal_add_js');
$response = views_ajax_form_wrapper($form_state['form_id'], $form_state);
// If the form has not been submitted, or was not set for rerendering, stop.
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
index c938ce3..2151a89 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
@@ -73,8 +73,8 @@ abstract class ViewFormControllerBase extends EntityFormController {
*
* This returns an array of arrays. Each array represents a single
* file. The array format is:
- * - file: The fully qualified name of the file to send to drupal_add_css
- * - options: An array of options to pass to drupal_add_css.
+ * - file: The fully qualified name of the file to send to _drupal_add_css
+ * - options: An array of options to pass to _drupal_add_css.
*/
public static function getAdminCSS() {
$module_path = drupal_get_path('module', 'views_ui');