You are here

function fivestar_add_css in Fivestar 5

Same name and namespace in other branches
  1. 6.2 fivestar.module \fivestar_add_css()
  2. 6 fivestar.module \fivestar_add_css()

Fetch the necessary CSS files to render the fivestar widget.

1 call to fivestar_add_css()
fivestar_init in ./fivestar.module
Implementation of hook_init(). Not that this will cause Drupal to post a warning on the admin screen when agressive caching is activated. Like CCK, Fivestar's use of hook_init IS compatible with agressive caching, we just need a way to annouce that.

File

./fivestar.module, line 1415
A simple n-star voting widget, usable in other forms.

Code

function fivestar_add_css($widget_css = NULL) {

  // Add fivestar CSS.
  drupal_add_css(drupal_get_path('module', 'fivestar') . '/css/fivestar.css');

  // Add widget specific CSS.
  if (!isset($widget_css)) {
    $widget_css = variable_get('fivestar_widget', 'default');
  }
  if ($widget_css != 'default') {
    drupal_add_css($widget_css);
  }
}