You are here

function panels_new_pane in Panels 7.3

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

Create a new pane.

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

3 calls to panels_new_pane()
panels_change_layout in includes/display-layout.inc
Form definition for the display layout converter.
panels_layouts_ui::edit_form in plugins/export_ui/panels_layouts_ui.class.php
Provide the actual editing form.
panels_renderer_editor::ajax_add_pane in plugins/display_renderers/panels_renderer_editor.class.php
AJAX entry point to add a new pane.

File

./panels.module, line 963
Core functionality for the Panels engine.

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);
  }
  drupal_alter('panels_new_pane', $pane);
  return $pane;
}