function views_plugin_cache::restore_headers

Same name in other branches
  1. 6.x-3.x 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 263

Class

views_plugin_cache
The base plugin to handle caching.

Code

public function restore_headers() {
    if (!empty($this->storage['head'])) {
        foreach ($this->storage['head'] as $key => $data) {
            drupal_add_html_head($data, $key);
        }
    }
    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);
        }
    }
}