[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/panels/plugins/display_renderers/ -> panels_renderer_standard.class.php (summary)

(no description)

File Size: 623 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

panels_renderer_standard:: (13 methods):
  init()
  prepare()
  prepare_panes()
  prepare_regions()
  render()
  render_layout()
  add_meta()
  add_css()
  render_panes()
  render_pane()
  render_pane_content()
  render_regions()
  render_region()


Class: panels_renderer_standard  - X-Ref

The standard render pipeline for a Panels display object.

Given a fully-loaded panels_display object, this class will turn its
combination of layout, panes, and styles into HTML, invoking caching
appropriately along the way. Interacting with the renderer externally is
very simple - just pass it the display object and call the render() method:

init($plugin, &$display)   X-Ref
Receive and store the display object to be rendered.

This is a psuedo-constructor that should typically be called immediately
after object construction.

param: array $plugin
param: panels_display $display

prepare($external_settings = NULL)   X-Ref
Prepare the attached display for rendering.

This is the outermost prepare method. It calls several sub-methods as part
of the overall preparation process. This compartmentalization is intended
to ease the task of modifying renderer behavior in child classes.

If you override this method, it is important that you either call this
method via parent::prepare(), or manually set $this->prep_run = TRUE.

param: mixed $external_settings

prepare_panes($panes)   X-Ref
Prepare the list of panes to be rendered, accounting for visibility/access
settings and rendering order.

This method represents the standard approach for determining the list of
panes to be rendered that is compatible with all parts of the Panels
architecture. It first applies visibility & access checks, then sorts panes
into their proper rendering order, and returns the result as an array.

Inheriting classes should override this method if that renderer needs to
regularly make additions to the set of panes that will be rendered.

param: array $panes
return: array

prepare_regions($region_pane_list, $settings)   X-Ref
Prepare the list of regions to be rendered.

This method is primarily about properly initializing the style plugin that
will be used to render the region. This is crucial as regions cannot be
rendered without a style plugin (in keeping with Panels' philosophy of
hardcoding none of its output), but for most regions no style has been
explicitly set. The logic here is what accommodates that situation:
- If a region has had its style explicitly set, then we fetch that plugin
and continue.
- If the region has no explicit style, but a style was set at the display
level, then inherit the style from the display.
- If neither the region nor the dispay have explicitly set styles, then
fall back to the hardcoded 'default' style, a very minimal style.

The other important task accomplished by this method is ensuring that even
regions without any panes are still properly prepared for the rendering
process. This is essential because the way Panels loads display objects
(@see panels_load_displays) results only in a list of regions that
contain panes - not necessarily all the regions defined by the layout
plugin, which can only be determined by asking the plugin at runtime. This
method consults that retrieved list of regions and prepares all of those,
ensuring none are inadvertently skipped.

param: array $region_pane_list
param: array $settings
return: array

render()   X-Ref
Build inner content, then hand off to layout-specified theme function for
final render step.

This is the outermost method in the Panels render pipeline. It calls the
inner methods, which return a content array, which is in turn passed to the
theme function specified in the layout plugin.

return: string

render_layout()   X-Ref
Perform display/layout-level render operations.

This method triggers all the inner pane/region rendering processes, passes
that to the layout plugin's theme callback, and returns the rendered HTML.

If display-level caching is enabled and that cache is warm, this method
will not be called.

return: string

add_meta()   X-Ref
Attach out-of-band page metadata (e.g., CSS and JS).

This must be done before render, because panels-within-panels must have
their CSS added in the right order: inner content before outer content.

add_css($filename, $type = 'module', $media = 'all', $preprocess = TRUE)   X-Ref
Add CSS information to the renderer.

To facilitate previews over Views, CSS can now be added in a manner
that does not necessarily mean just using drupal_add_css. Therefore,
during the panel rendering process, this method can be used to add
css and make certain that ti gets to the proper location.

The arguments should exactly match drupal_add_css().


render_panes()   X-Ref
Render all prepared panes, first by dispatching to their plugin's render
callback, then handing that output off to the pane's style plugin.

return: array

render_pane(&$pane)   X-Ref
Render a pane using its designated style.

This method also manages 'title pane' functionality, where the title from
an individual pane can be bubbled up to take over the title for the entire
display.

param: stdClass $pane

render_pane_content(&$pane)   X-Ref
Render the interior contents of a single pane.

This method retrieves pane content and produces a ready-to-render content
object. It also manages pane-specific caching.

param: stdClass $pane
return: stdClass $content

render_regions()   X-Ref
Render all prepared regions, placing already-rendered panes into their
appropriate positions therein.

return: array

render_region($region_id, $panes)   X-Ref
Render a single panel region.

Primarily just a passthrough to the panel region rendering callback
specified by the style plugin that is attached to the current panel region.

param: $region_id
param: $panes
return: string



Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7