You are here

function panels_edit_display_form_preview in Panels 6.3

Same name and namespace in other branches
  1. 7.3 includes/display-edit.inc \panels_edit_display_form_preview()

Submission of the preview button. Render the preview and put it into the preview widget area.

2 string references to 'panels_edit_display_form_preview'
panels_edit_display_form in includes/display-edit.inc
Form definition for the panels display editor
panels_layouts_ui::edit_form in plugins/export_ui/panels_layouts_ui.class.php
Provide the actual editing form.

File

includes/display-edit.inc, line 172

Code

function panels_edit_display_form_preview(&$form, &$form_state) {
  $display =& $form_state['display'];
  ctools_include('ajax');
  $display->context = ctools_context_replace_placeholders($display->context, $form_state['values']['preview']);
  $display->skip_cache = TRUE;
  $output = panels_render_display($display);

  // Add any extra CSS that some layouts may have added specifically for this.
  if (!empty($display->add_css)) {
    $output = "<style type=\"text/css\">\n{$display->add_css}</style>\n" . $output;
  }
  $commands = array();
  $commands[] = array(
    'command' => 'panel_preview',
    'output' => $output,
  );
  ctools_ajax_render($commands);
}