You are here

function _filefield_add_css in FileField 6.2

Add all CSS files that extension file widgets might need, so that they exist even if the form element has only been inserted by JavaScript. Can also be used for formatter info arrays as those look similar.

1 call to _filefield_add_css()
filefield_widget in ./filefield.widget.inc
Implementation of hook_widget() - the one in filefield.module is just there to include this one on demand.

File

./filefield.module, line 567

Code

function _filefield_add_css($widget_or_formatter_info) {
  static $done = FALSE;
  if ($done) {
    return;

    // adding those files once should be enough for each request
  }
  foreach ($widget_or_formatter_info as $name => $info) {
    foreach ($info['css'] as $path) {
      drupal_add_css($path);
    }
  }
}