You are here

function panels_cache_object::restore in Panels 7.3

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_cache_object::restore()
  2. 6.3 includes/plugins.inc \panels_cache_object::restore()
  3. 6.2 includes/plugins.inc \panels_cache_object::restore()

Restore out of band data saved to cache.

File

includes/plugins.inc, line 221
Contains helper code for plugins and contexts.

Class

panels_cache_object
An object to hold caching information while it is happening.

Code

function restore() {
  if (!empty($this->head)) {
    drupal_add_html_head($this->head);
  }
  if (!empty($this->css)) {
    foreach ($this->css as $args) {
      drupal_add_css($args['data'], $args);
    }
  }
  if (!empty($this->js)) {
    foreach ($this->js as $key => $args) {
      if ($key !== 'settings') {
        drupal_add_js($args['data'], $args);
      }
      else {
        foreach ($args['data'] as $setting) {
          drupal_add_js($setting, 'setting');
        }
      }
    }
  }
  if (!empty($this->tokens)) {
    foreach ($this->tokens as $token => $key) {
      list($type, $argument) = $key;
      ctools_set_page_token($token, $type, $argument);
    }
  }
}