You are here

function lazy_pane_render in Lazy Pane 7

Render a pane or a display using its designated style.

Parameters

stdClass $pane: A panels pane object.

panels_display $display: The panels display object to be rendered.

Return value

string Rendered panel pane markup.

1 call to lazy_pane_render()
lazy_pane_ajax in ./lazy_pane.inc
Menu callback to load a lazy-pane through ajax.

File

./lazy_pane.inc, line 95
Miscellaneous functions for Lazy Pane.

Code

function lazy_pane_render($pane, $display) {
  $output = '';

  // If it's a display, render it now.
  if (empty($pane) && !empty($display)) {
    $display->cache = array();
    $output = $display
      ->render();
  }
  elseif (!empty($pane) && !empty($display)) {

    // Get type of renderer.
    $renderer_handler = $display->renderer_handler->plugin['renderer'];

    // Instantiate renderer.
    $renderer = new $renderer_handler();

    // Set the renderer display settings to those passed into this function.
    $renderer->display = $display;

    // The placeholder was cached for this display so we need to skip caching.
    $renderer->display->skip_cache = TRUE;
    $output = $renderer
      ->render_pane($pane);
  }
  return $output;
}