diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-30 02:47:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-30 02:47:28 +0000 |
commit | 37c3c7ec7aff7fad84b3839ac3fa5437b7b256b2 (patch) | |
tree | 97fe1cd55f6501efaaa21129abd043fc94242d8e /modules | |
parent | 4f2d69698c849e4e20ad5ae92b0652654a88f840 (diff) | |
download | brdo-37c3c7ec7aff7fad84b3839ac3fa5437b7b256b2.tar.gz brdo-37c3c7ec7aff7fad84b3839ac3fa5437b7b256b2.tar.bz2 |
- Patch #769226 by Owen Barton, alanburke, sun: fixed JS/CSS preprocess should default to FALSE.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator/aggregator.module | 2 | ||||
-rw-r--r-- | modules/block/block.admin.inc | 4 | ||||
-rw-r--r-- | modules/book/book.module | 2 | ||||
-rw-r--r-- | modules/color/color.module | 2 | ||||
-rw-r--r-- | modules/comment/comment.module | 8 | ||||
-rw-r--r-- | modules/dblog/dblog.module | 2 | ||||
-rw-r--r-- | modules/field/field.attach.inc | 4 | ||||
-rw-r--r-- | modules/field/field.module | 8 | ||||
-rw-r--r-- | modules/forum/forum.module | 2 | ||||
-rw-r--r-- | modules/help/help.admin.inc | 2 | ||||
-rw-r--r-- | modules/image/image.admin.inc | 6 | ||||
-rw-r--r-- | modules/locale/locale.admin.inc | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/poll/poll.module | 2 | ||||
-rw-r--r-- | modules/search/search.module | 10 | ||||
-rw-r--r-- | modules/simpletest/tests/ajax.test | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/common.test | 6 | ||||
-rw-r--r-- | modules/system/system.module | 15 | ||||
-rw-r--r-- | modules/tracker/tracker.pages.inc | 2 | ||||
-rw-r--r-- | modules/user/user.module | 2 |
20 files changed, 51 insertions, 36 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 172361a2b..a5ff986d7 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -286,7 +286,7 @@ function _aggregator_category_title($category) { * Implements hook_init(). */ function aggregator_init() { - drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css'); + drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css', array('preprocess' => TRUE)); } /** diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 4d197e1e7..8d9738326 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -10,7 +10,7 @@ * Menu callback for admin/structure/block/demo. */ function block_admin_demo($theme = NULL) { - drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE)); + drupal_add_css(drupal_get_path('module', 'block') . '/block.css'); return ''; } @@ -53,7 +53,7 @@ function block_admin_display($theme = NULL) { */ function block_admin_display_form($form, &$form_state, $blocks, $theme) { - drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE)); + drupal_add_css(drupal_get_path('module', 'block') . '/block.css'); $block_regions = system_region_list($theme, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>'); diff --git a/modules/book/book.module b/modules/book/book.module index 7651a7aa6..8ef55f4f1 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -222,7 +222,7 @@ function book_admin_paths() { * Implements hook_init(). */ function book_init() { - drupal_add_css(drupal_get_path('module', 'book') . '/book.css'); + drupal_add_css(drupal_get_path('module', 'book') . '/book.css', array('preprocess' => TRUE)); } /** diff --git a/modules/color/color.module b/modules/color/color.module index 682518f04..6a3ca99c4 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -189,7 +189,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) { ), // Add custom CSS. 'css' => array( - $base . '/color.css' => array('preprocess' => FALSE), + $base . '/color.css' => array(), ), // Add custom JavaScript. 'js' => array( diff --git a/modules/comment/comment.module b/modules/comment/comment.module index c6b2a9155..62e2d3d4a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -290,6 +290,13 @@ function comment_menu() { } /** + * Implements hook_init(). + */ +function comment_init() { + drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css', array('preprocess' => TRUE)); +} + +/** * Implements hook_menu_alter(). */ function comment_menu_alter(&$items) { @@ -716,7 +723,6 @@ function comment_node_page_additions($node) { $comments = comment_load_multiple($cids); comment_prepare_thread($comments); $build = comment_view_multiple($comments, $node); - $build['#attached']['css'][] = drupal_get_path('module', 'comment') . '/comment.css'; $build['pager']['#theme'] = 'pager'; $additions['comments'] = $build; } diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index 7e59501ed..32ab03f76 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -91,7 +91,7 @@ function dblog_menu() { function dblog_init() { if (arg(0) == 'admin' && arg(1) == 'reports') { // Add the CSS for this module - drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', array('preprocess' => FALSE)); + drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css'); } } diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index 3753b2f75..3383a5793 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -542,7 +542,6 @@ function field_attach_form($entity_type, $entity, &$form, &$form_state, $langcod // Add custom weight handling. list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); - $form['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; $form['#pre_render'][] = '_field_extra_fields_pre_render'; $form['#entity_type'] = $entity_type; $form['#bundle'] = $bundle; @@ -1129,9 +1128,6 @@ function field_attach_view($entity_type, $entity, $view_mode, $langcode = NULL) $output['#entity_type'] = $entity_type; $output['#bundle'] = $bundle; - // Include CSS styles. - $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; - // Let other modules alter the renderable array. $context = array( 'entity_type' => $entity_type, diff --git a/modules/field/field.module b/modules/field/field.module index e421d9742..a429499f7 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -166,6 +166,13 @@ function field_theme() { } /** + * Implements hook_init(). + */ +function field_init() { + drupal_add_css(drupal_get_path('module', 'field') . '/theme/field.css', array('preprocess' => TRUE)); +} + +/** * Implements hook_cron(). * * Purges some deleted Field API data, if any exists. @@ -811,7 +818,6 @@ function field_view_field($entity_type, $entity, $field_name, $display = array() if (isset($result[$field_name])) { $output = $result[$field_name]; - $output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css'; } } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 3258b3930..a3d5e1c21 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -221,7 +221,7 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) { * Implements hook_init(). */ function forum_init() { - drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css'); + drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css', array('preprocess' => TRUE)); } /** diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc index c05d854f4..568a5ad2f 100644 --- a/modules/help/help.admin.inc +++ b/modules/help/help.admin.inc @@ -11,7 +11,7 @@ */ function help_main() { // Add CSS - drupal_add_css(drupal_get_path('module', 'help') . '/help.css', array('preprocess' => FALSE)); + drupal_add_css(drupal_get_path('module', 'help') . '/help.css'); $output = '<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>' . help_links_as_list(); return $output; } diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index cd822972e..ce1b039b6 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -16,7 +16,7 @@ function image_style_list() { $page['image_style_list'] = array( '#markup' => theme('image_style_list', array('styles' => $styles)), '#attached' => array( - 'css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array('preprocess' => FALSE)), + 'css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array()), ), ); @@ -48,7 +48,7 @@ function image_style_form($form, &$form_state, $style) { $form_state['image_style'] = $style; $form['#tree'] = TRUE; - $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array('preprocess' => FALSE); + $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array(); // Show the thumbnail preview. $form['preview'] = array( @@ -383,7 +383,7 @@ function image_effect_form($form, &$form_state, $style, $effect) { } $form['#tree'] = TRUE; - $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array('preprocess' => FALSE); + $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array(); if (function_exists($effect['form callback'])) { $form['data'] = call_user_func($effect['form callback'], $effect['data']); } diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc index 1235f8966..6ca3df30b 100644 --- a/modules/locale/locale.admin.inc +++ b/modules/locale/locale.admin.inc @@ -784,7 +784,7 @@ function locale_translate_overview_screen() { */ function locale_translate_seek_screen() { // Add CSS. - drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE)); + drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css'); $elements = drupal_get_form('locale_translation_filter_form'); $output = drupal_render($elements); diff --git a/modules/node/node.module b/modules/node/node.module index 5e875f281..0161ca1ba 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1998,7 +1998,7 @@ function _node_custom_theme() { * Implements hook_init(). */ function node_init() { - drupal_add_css(drupal_get_path('module', 'node') . '/node.css'); + drupal_add_css(drupal_get_path('module', 'node') . '/node.css', array('preprocess' => TRUE)); } function node_last_changed($nid) { diff --git a/modules/poll/poll.module b/modules/poll/poll.module index ee292aafa..3d38f46b0 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -31,7 +31,7 @@ function poll_help($path, $arg) { * Implements hook_init(). */ function poll_init() { - drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css'); + drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css', array('preprocess' => TRUE)); } /** diff --git a/modules/search/search.module b/modules/search/search.module index 2ab3a4210..2138562a6 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -98,6 +98,13 @@ function search_help($path, $arg) { } /** + * Implements hook_init(). + */ +function search_init() { + drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => TRUE)); +} + +/** * Implements hook_theme(). */ function search_theme() { @@ -875,9 +882,6 @@ function search_get_keys() { * An HTML string containing the search form. */ function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) { - // Add CSS - drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE)); - if (!$action) { $action = 'search/' . $type; } diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index 97cd2f5d2..91572bda0 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -53,7 +53,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { * Test behavior of ajax_render_error(). */ function testAJAXRenderError() { - $result = $this->drupalGetAJAX('ajax-test/render-error'); + $result = $this->discardSettings($this->drupalGetAJAX('ajax-test/render-error')); // Verify default error message. $this->assertEqual($result[0]['command'], 'alert', t('ajax_render_error() invokes alert command.')); $this->assertEqual($result[0]['text'], t('An error occurred while handling the request: The server received invalid input.'), t('Default error message is output.')); @@ -61,7 +61,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { $edit = array( 'message' => 'Custom error message.', ); - $result = $this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit)); + $result = $this->discardSettings($this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit))); $this->assertEqual($result[0]['text'], $edit['message'], t('Custom error message is output.')); } } diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 01635a5ea..35c5bbc3b 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -621,7 +621,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { function testRenderInlinePreprocess() { $css = 'body { padding: 0px; }'; $css_preprocessed = '<style type="text/css" media="all">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; - drupal_add_css($css, 'inline'); + drupal_add_css($css, array('type' => 'inline', 'preprocess' => TRUE)); $styles = drupal_get_css(); $this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.')); } @@ -631,7 +631,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { */ function testRenderInlineNoPreprocess() { $css = 'body { padding: 0px; }'; - drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE)); + drupal_add_css($css, array('type' => 'inline')); $styles = drupal_get_css(); $this->assertTrue(strpos($styles, $css) > 0, t('Rendering non-preprocessed inline CSS adds it to the page.')); } @@ -641,7 +641,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { */ function testRenderInlineFullPage() { $css = 'body { font-size: 254px; }'; - $expected = 'font-size:254px;'; + $expected = $css; // Create a node, using the PHP filter that tests drupal_add_css(). $php_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'PHP code'))->fetchField(); diff --git a/modules/system/system.module b/modules/system/system.module index 05eb78661..45144a245 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1066,6 +1066,7 @@ function system_library() { 'js' => array( 'misc/jquery.js' => array('weight' => JS_LIBRARY - 20), ), + 'preprocess' => TRUE, ); // jQuery Once. @@ -1076,6 +1077,7 @@ function system_library() { 'js' => array( 'misc/jquery.once.js' => array('weight' => JS_LIBRARY - 19), ), + 'preprocess' => TRUE, ); // jQuery Form Plugin. @@ -1120,7 +1122,7 @@ function system_library() { 'misc/farbtastic/farbtastic.js' => array(), ), 'css' => array( - 'misc/farbtastic/farbtastic.css' => array('preprocess' => FALSE), + 'misc/farbtastic/farbtastic.css' => array(), ), ); @@ -1816,14 +1818,15 @@ function _system_filetransfer_backend_form_common() { * Implements hook_init(). */ function system_init() { + $path = drupal_get_path('module', 'system'); // Add the CSS for this module. if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit' || arg(2) == 'delete'))) { - drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', array('weight' => CSS_SYSTEM)); + drupal_add_css($path . '/admin.css', array('weight' => CSS_SYSTEM)); } - drupal_add_css(drupal_get_path('module', 'system') . '/system.css', array('weight' => CSS_SYSTEM)); - drupal_add_css(drupal_get_path('module', 'system') . '/system-behavior.css', array('weight' => CSS_SYSTEM)); - drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', array('weight' => CSS_SYSTEM)); - drupal_add_css(drupal_get_path('module', 'system') . '/system-messages.css', array('weight' => CSS_SYSTEM)); + drupal_add_css($path . '/system.css', array('weight' => CSS_SYSTEM, 'preprocess' => TRUE)); + drupal_add_css($path . '/system-behavior.css', array('weight' => CSS_SYSTEM, 'preprocess' => TRUE)); + drupal_add_css($path . '/system-menus.css', array('weight' => CSS_SYSTEM, 'preprocess' => TRUE)); + drupal_add_css($path . '/system-messages.css', array('weight' => CSS_SYSTEM, 'preprocess' => TRUE)); // Ignore slave database servers for this request. diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc index 0a5a59654..c8f7dd476 100644 --- a/modules/tracker/tracker.pages.inc +++ b/modules/tracker/tracker.pages.inc @@ -113,7 +113,7 @@ function tracker_page($account = NULL, $set_title = FALSE) { '#theme' => 'table', '#empty' => t('No content available.'), '#attached' => array( - 'css' => array(drupal_get_path('module', 'tracker') . '/tracker.css' => array('preprocess' => FALSE)), + 'css' => array(drupal_get_path('module', 'tracker') . '/tracker.css' => array()), ), ); $page['pager'] = array( diff --git a/modules/user/user.module b/modules/user/user.module index ef2b4b374..12ed82d11 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1784,7 +1784,7 @@ function user_menu_site_status_alter(&$menu_site_status, $path) { * Implements hook_init(). */ function user_init() { - drupal_add_css(drupal_get_path('module', 'user') . '/user.css'); + drupal_add_css(drupal_get_path('module', 'user') . '/user.css', array('preprocess' => TRUE)); } /** |