You are here

function panels_panel_context_save in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/task_handlers/panel_context.inc \panels_panel_context_save()

Callback to allow the handler to react to being saved.

When a handler with a display is saved, two things have to happen. First, we have to save the display so that it becomes a real display, not the fake one we started with. Second, we have to cache any CSS that the display is using. This CSS can get re-cached later if the file disappears, but it's imperative that we do it here to make sure that old, dirty CSS cache gets removed.

1 string reference to 'panels_panel_context_save'
panel_context.inc in plugins/task_handlers/panel_context.inc
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

File

plugins/task_handlers/panel_context.inc, line 360
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

Code

function panels_panel_context_save(&$handler, $update) {

  // Only save the display if we believe it has been modified.
  if (isset($handler->conf['display'])) {
    panels_save_display($handler->conf['display']);
    $handler->conf['did'] = $handler->conf['display']->did;
    unset($handler->conf['display']);
  }

  // Delete any previous CSS cache file.
  ctools_include('css');
  ctools_css_clear('panel_context:' . $handler->name);
  if (isset($handler->conf['temp_layout'])) {
    unset($handler->conf['temp_layout']);
  }
}