You are here

function panels_mini_content in Panels 6.2

Same name and namespace in other branches
  1. 5.2 panels_mini/panels_mini.module \panels_mini_content()

Render a mini panel called from a panels display.

1 string reference to 'panels_mini_content'
panels_mini_panels_content_types in panels_mini/panels_mini.module
Expose all mini panels to our own system.

File

panels_mini/panels_mini.module, line 127
panels_mini.module

Code

function panels_mini_content($subtype, $conf, $panel_args, &$contexts) {
  $mini = panels_mini_load($conf['name']);
  if (!$mini) {
    return FALSE;
  }
  panels_load_include('plugins');

  // Load up any contexts we might be using.
  $context = panels_context_match_required_contexts($mini->requiredcontexts, $contexts);
  $mini->context = $mini->display->context = panels_context_load_contexts($mini, FALSE, $context);
  if (empty($mini) || !empty($mini->disabled)) {
    return;
  }
  $mini->display->args = $panel_args;
  $mini->display->css_id = panels_mini_get_id($conf['name']);
  $mini->display->owner = $mini;

  // unique ID of this mini.
  $mini->display->owner->id = $mini->name;
  $block = new stdClass();
  $block->module = 'panels_mini';
  $block->delta = $conf['name'];
  $block->subject = filter_xss_admin($mini->title);
  $block->content = panels_render_display($mini->display);
  return $block;
}