You are here

function panels_get_pane_content in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_get_pane_content()

Get the content from a given pane.

Parameters

$pane: The pane to retrieve content from.

$args: The arguments sent to the display.

$context: The panels context.

$incoming_content: Any incoming content if this display is a wrapper.

Related topics

1 call to panels_get_pane_content()
panels_render_pane_content in includes/display-render.inc
Render a single pane, identifying its context, and put it into the $panes array.

File

includes/plugins.inc, line 528
plugins.inc

Code

function panels_get_pane_content($display, $pane, $args = array(), $context = NULL, $incoming_content = '') {
  if (!$context) {
    $context = new panels_context();
  }
  if (!$incoming_content === '') {
    $incoming_content = t('Incoming content will be displayed here.');
  }
  $content = FALSE;
  $caching = !empty($pane->cache['method']) ? TRUE : FALSE;
  if ($caching && ($cache = panels_get_cached_content($display, $args, $context, $pane))) {
    $content = $cache->content;
  }
  else {
    $content = panels_ct_get_content($pane->type, $pane->subtype, $pane->configuration, $args, $context, $incoming_content);
    foreach (module_implements('panels_pane_content_alter') as $module) {
      $function = $module . '_panels_pane_content_alter';
      $function($content, $pane, $args, $context);
    }
    if ($caching) {
      $cache = new panels_cache_object();
      $cache
        ->set_content($content);
      panels_set_cached_content($cache, $display, $args, $context, $pane);
    }
  }
  return $content;
}