You are here

function panels_new_pane in Panels 8.3

Same name and namespace in other branches
  1. 6.3 panels.module \panels_new_pane()
  2. 6.2 panels.module \panels_new_pane()
  3. 7.3 panels.module \panels_new_pane()

Create a new pane.

@todo -- use schema API for some of this?

Related topics

File

./panels.module, line 525
panels.module

Code

function panels_new_pane($type, $subtype, $set_defaults = FALSE) {
  ctools_include('export');
  $pane = ctools_export_new_object('panels_pane', FALSE);
  $pane->pid = 'new';
  $pane->type = $type;
  $pane->subtype = $subtype;
  if ($set_defaults) {
    ctools_include('content');
    $content_type = ctools_get_content_type($type);
    $content_subtype = ctools_content_get_subtype($content_type, $subtype);
    $pane->configuration = ctools_content_get_defaults($content_type, $content_subtype);
  }
  return $pane;
}