You are here

function panels_renderer_standard::add_css in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/display_renderers/panels_renderer_standard.class.php \panels_renderer_standard::add_css()

Add CSS information to the renderer.

To facilitate previews over Views, CSS can now be added in a manner that does not necessarily mean just using drupal_add_css. Therefore, during the panel rendering process, this method can be used to add css and make certain that ti gets to the proper location.

The arguments should exactly match drupal_add_css().

See also

drupal_add_css

1 call to panels_renderer_standard::add_css()
panels_renderer_standard::add_meta in plugins/display_renderers/panels_renderer_standard.class.php
Attach out-of-band page metadata (e.g., CSS and JS).

File

plugins/display_renderers/panels_renderer_standard.class.php, line 505

Class

panels_renderer_standard

Code

function add_css($filename) {
  switch ($this->meta_location) {
    case 'standard':
      drupal_add_css($filename);
      break;
    case 'inline':
      $url = base_path() . $filename;
      $this->prefix .= '<link type="text/css" rel="stylesheet" href="' . file_create_url($url) . '" />' . "\n";
      break;
  }
}