You are here

function CachePluginBase::restore_headers in Views (for Drupal 7) 8.3

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

1 call to CachePluginBase::restore_headers()
CachePluginBase::cache_get in lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
Retrieve data from the cache.

File

lib/Drupal/views/Plugin/views/cache/CachePluginBase.php, line 270
Definition of Drupal\views\Plugin\views\cache\CachePluginBase.

Class

CachePluginBase
The base plugin to handle caching.

Namespace

Drupal\views\Plugin\views\cache

Code

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');
        }
      }
    }
  }
}