diff --git a/includes/common.inc b/includes/common.inc index 405c98a..996372c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2699,7 +2699,7 @@ function drupal_add_css($data = NULL, $options = NULL) { 'type' => 'file', 'weight' => CSS_DEFAULT, 'media' => 'all', - 'preprocess' => TRUE, + 'preprocess' => FALSE, 'data' => $data, 'browsers' => array(), ); @@ -3671,7 +3671,7 @@ function drupal_js_defaults($data = NULL) { 'scope' => 'header', 'cache' => TRUE, 'defer' => FALSE, - 'preprocess' => TRUE, + 'preprocess' => FALSE, 'version' => NULL, 'data' => $data, ); diff --git a/includes/locale.inc b/includes/locale.inc index 08c5492..b1b28f0 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1759,7 +1759,7 @@ function _locale_rebuild_js($langcode = NULL) { */ function _locale_translate_language_list($translation, $limit_language) { // 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'); $languages = language_list(); unset($languages['en']); diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 672d078..103f2a5 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 a36a71a..6b24a10 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 ''; } @@ -45,7 +45,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 e49f4fb..ef2b9c8 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -229,7 +229,8 @@ 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)); + drupal_add_js(drupal_get_path('module', 'book') . '/book.js', array('preprocess' => TRUE)); } /** @@ -501,9 +502,6 @@ function _book_add_form_elements(&$form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', - '#attached' => array( - 'js' => array(drupal_get_path('module', 'book') . '/book.js'), - ), '#tree' => TRUE, '#attributes' => array('class' => array('book-outline-form')), ); diff --git a/modules/color/color.module b/modules/color/color.module index 5966dcf..cb0d60d 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 1d818f5..d38d7f5 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -290,6 +290,14 @@ function comment_menu() { } /** + * Implements hook_init(). + */ +function comment_init() { + drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css', array('preprocess' => TRUE)); + drupal_add_js(drupal_get_path('module', 'comment') . '/comment-node-form.js', array('preprocess' => TRUE)); +} + +/** * Implements hook_menu_alter(). */ function comment_menu_alter(&$items) { @@ -716,7 +724,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; } @@ -1077,9 +1084,6 @@ function comment_form_node_type_form_alter(&$form, $form_state) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', - '#attached' => array( - 'js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'), - ), ); $form['comment']['comment_default_mode'] = array( '#type' => 'checkbox', @@ -1150,9 +1154,6 @@ function comment_form_alter(&$form, $form_state, $form_id) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', - '#attached' => array( - 'js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'), - ), '#weight' => 30, ); $comment_count = isset($node->nid) ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() : 0; diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index e6b33d3..0493141 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 7434dda..4004c9a 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 06be61d..1122013 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/field/modules/text/text.module b/modules/field/modules/text/text.module index eb06b09..17c6db1 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -20,6 +20,13 @@ function text_help($path, $arg) { } /** + * Implements hook_init(). + */ +function text_init() { + drupal_add_js(drupal_get_path('module', 'text') . '/text.js', array('preprocess' => TRUE)); +} + +/** * Implements hook_field_info(). * * Field settings: @@ -537,9 +544,6 @@ function text_field_widget_form(&$form, &$form_state, $field, $instance, $langco '#title' => t('Summary'), '#rows' => $instance['widget']['settings']['summary_rows'], '#description' => t('Leave blank to use trimmed value of full text as the summary.'), - '#attached' => array( - 'js' => array(drupal_get_path('module', 'text') . '/text.js'), - ), '#attributes' => array('class' => array('text-summary')), '#prefix' => '
' . t('Help is available on the following items:') . '
' . help_links_as_list(); return $output; } diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index d41c86a..b244f8d 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/image/image.field.inc b/modules/image/image.field.inc index 43f5a2d..ca46e0d 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -356,7 +356,6 @@ function image_field_widget_process($element, &$form_state, $form) { $widget_settings = $instance['widget']['settings']; $element['#theme'] = 'image_widget'; - $element['#attached']['css'][] = drupal_get_path('module', 'image') . '/image.css'; // Add the image preview. if ($element['#file'] && $widget_settings['preview_image_style']) { diff --git a/modules/image/image.module b/modules/image/image.module index 50be71c..a8f7792 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -66,6 +66,13 @@ function image_help($path, $arg) { } /** + * Implements hook_init(). + */ +function image_init() { + drupal_add_css(drupal_get_path('module', 'image') . '/image.css', array('preprocess' => TRUE)); +} + +/** * Implements hook_menu(). */ function image_menu() { diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc index 3b79afe..706e43a 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 f900961..7d9dc5e 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/openid/openid.module b/modules/openid/openid.module index 66521bd..8f4e8e0 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -62,6 +62,14 @@ function openid_help($path, $arg) { } /** + * Implements hook_init(). + */ +function openid_init() { + drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', array('preprocess' => TRUE)); + drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js', array('preprocess' => TRUE)); +} + +/** * Implements hook_user_insert(). */ function openid_user_insert(&$edit, $account, $category) { @@ -115,8 +123,6 @@ function openid_form_user_login_alter(&$form, &$form_state) { } function _openid_user_login_form_alter(&$form, &$form_state) { - $form['#attached']['css'][] = drupal_get_path('module', 'openid') . '/openid.css'; - $form['#attached']['js'][] = drupal_get_path('module', 'openid') . '/openid.js'; $form['#attached']['library'][] = array('system', 'cookie'); if (!empty($form_state['input']['openid_identifier'])) { $form['name']['#required'] = FALSE; diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc index 06738a1..ed7c7fb 100644 --- a/modules/openid/openid.pages.inc +++ b/modules/openid/openid.pages.inc @@ -29,7 +29,6 @@ function openid_authentication_page() { */ function openid_user_identities($account) { drupal_set_title(format_username($account)); - drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css'); // Check to see if we got a response $result = openid_complete(); diff --git a/modules/poll/poll.module b/modules/poll/poll.module index c9bbd2c..db75586 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 7f1bfa3..bb3d655 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() { @@ -872,9 +879,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/shortcut/shortcut.module b/modules/shortcut/shortcut.module index 464312d..4425806 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -167,6 +167,13 @@ function shortcut_menu() { } /** + * Implements hook_init(). + */ +function shortcut_init() { + drupal_add_css(drupal_get_path('module', 'shortcut') . '/shortcut.css', array('preprocess' => TRUE)); +} + +/** * Implements hook_theme(). */ function shortcut_theme() { @@ -674,7 +681,6 @@ function shortcut_preprocess_page(&$variables) { if (theme_get_setting('shortcut_module_link')) { $variables['title_suffix']['add_or_remove_shortcut'] = array( - '#attached' => array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')), '#prefix' => '