diff options
Diffstat (limited to 'modules/field')
-rw-r--r-- | modules/field/field.attach.inc | 4 | ||||
-rw-r--r-- | modules/field/field.module | 8 |
2 files changed, 7 insertions, 5 deletions
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'; } } |