You are here

public function views_plugin_cache::restore_headers in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_cache.inc \views_plugin_cache::restore_headers()
  2. 6.2 plugins/views_plugin_cache.inc \views_plugin_cache::restore_headers()

Restore out of band data saved to cache. Copied from Panels.

1 call to views_plugin_cache::restore_headers()
views_plugin_cache::cache_get in plugins/views_plugin_cache.inc
Retrieve data from the cache.

File

plugins/views_plugin_cache.inc, line 268
Definition of views_plugin_cache.

Class

views_plugin_cache
The base plugin to handle caching.

Code

public function restore_headers() {
  if (!empty($this->storage['head'])) {
    drupal_add_html_head($this->storage['head']);
  }
  if (!empty($this->storage['css'])) {
    foreach ($this->storage['css'] as $args) {
      drupal_add_css($args['data'], $args);
    }
  }
  if (!empty($this->storage['js'])) {
    foreach ($this->storage['js'] as $key => $args) {
      if ($key !== 'settings') {
        drupal_add_js($args['data'], $args);
      }
      else {
        foreach ($args as $setting) {
          drupal_add_js($setting, 'setting');
        }
      }
    }
  }
  if (!empty($this->storage['headers'])) {
    foreach ($this->storage['headers'] as $name => $value) {
      drupal_add_http_header($name, $value);
    }
  }
}