1 views_plugin_cache.inc views_plugin_cache::restore_headers()

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

File

core/modules/views/plugins/views_plugin_cache.inc, line 256
Definition of views_plugin_cache.

Class

views_plugin_cache
The base plugin to handle caching.

Code

function restore_headers() {
  if (!empty($this->storage['head'])) {
    foreach ($this->storage['head'] as $key => $data) {
      backdrop_add_html_head($this->storage['head']);
    }
  }
  if (!empty($this->storage['css'])) {
    foreach ($this->storage['css'] as $args) {
      backdrop_add_css($args['data'], $args);
    }
  }
  if (!empty($this->storage['js'])) {
    foreach ($this->storage['js'] as $key => $args) {
      if ($key !== 'settings') {
        backdrop_add_js($args['data'], $args);
      }
      else {
        foreach ($args as $setting) {
          backdrop_add_js($setting, 'setting');
        }
      }
    }
  }
  if (!empty($this->storage['headers'])) {
    foreach ($this->storage['headers'] as $name => $value) {
      backdrop_add_http_header($name, $value);
    }
  }
}