SLayout Class Reference
[Layouts]

This is the root layout class for PageRender2. More...

Inheritance diagram for SLayout:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 layout ()
 Layout our PR2 page and buffer it in the SPage object's meta-slot buffer.
 layoutBottomTags ($page, $ms, $layout)
 Layout the BottomTags meta-slot.
 layoutHead ($page, $ms, $dl)
 Layout the Head meta-slot.
 layoutStartBodyTags ($page, $ms, $layout)
 Layout the StartBodyTags meta-slot.
 layoutTopTags ($page, $ms, $layout)
 Layout the TopTags meta-slot.
 msBuild ($page, $ms, $layout)
 Generate the output for a specified meta-slot.
 msBuildDefault ($page, $ms, $layout)
 Generate the output for one of the default meta-slots.


Detailed Description

This is the root layout class for PageRender2.

Layout classes in PR2 are the classes that generate the actual output HTML. They do this by: (1) consulting the PR2's SPageTemplate object to see what meta-slots should be displayed and in what order (2) generating the HTML for each of these meta-slots based on the slots set in the SPage object (3) appending each of these completed meta-slots onto the SPage object.

This most basic layout class provides functions to build the HTML of meta-slots that should be common to most all site layouts.

This class can be extended to provide layouts that will work website-wide (i.e.,SShodorLayout) or a project-wide.

Author:
Jonathan Stuart-Moore <jwsm@shodor.org> (10-17-06)

Member Function Documentation

SLayout::layout (  ) 

Layout our PR2 page and buffer it in the SPage object's meta-slot buffer.

Layout all meta-slots requested by the PR2's page template; add the output to the SPage meta-slot buffer.

Ask the parent PR2 object for the active page layout. Get the meta-slots list requested by that pageLayout (using getMetaSlotsList()). For each of those meta-slots, generate the output (typically HTML) by calling msBuild(). This will switch on the name of the meta-slot to call layout functions in this class or subclasses. Output from the layout functions is appended onto the SPage object's meta-slot buffer.

Returns:
[bool]: True if layout succeeded, false if there was an error

SLayout::layoutBottomTags ( page,
ms,
layout 
)

Layout the BottomTags meta-slot.

This slot contains the end of the table that contains the main content of the page, the closing body tag, and the analytics code (if the Omniture or Analytics slots are full)

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$layout [string]: The layout configuration for this meta-slot

SLayout::layoutHead ( page,
ms,
dl 
)

Layout the Head meta-slot.

This slot contains the head section of an HTML document, with all head tags, etc.

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$dl [string]: The layout configuration for this meta-slot

Reimplemented in SShodorLayout.

SLayout::layoutStartBodyTags ( page,
ms,
layout 
)

Layout the StartBodyTags meta-slot.

This slot contains the opening body tag of the document, along with the start of the table containing the main content of the page.

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$layout [string]: The layout configuration for this meta-slot

SLayout::layoutTopTags ( page,
ms,
layout 
)

Layout the TopTags meta-slot.

This slot contains the HTML doctype, the opening HTML tag, and the PR2 version comment

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$layout [string]: The layout configuration for this meta-slot

SLayout::msBuild ( page,
ms,
layout 
)

Generate the output for a specified meta-slot.

Generate the output for a specified meta-slot by calling the appropriate layout methods using the msBuildDefault() function. The parameters passed must specify:

  • The SPage object, which provides both the slots used as the content of the page and the buffers in which to store the assembled meta-slots
  • The name of the meta-slot to layout
  • The layout configuration of the meta-slot (for meta-slots that can have multiple styles of layout, for instance, a content area that could show a sidebar either on the right or the left side)

You should override this function in your SLayout subclass and switch on the meta-slot name. Catch all calls for your custom meta-slots and call layout functions for them. When your function is out of cases, call this parent function for the defaults.

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$layout [string]: The layout configuration for this meta-slot

Reimplemented in SShodorLayout.

SLayout::msBuildDefault ( page,
ms,
layout 
)

Generate the output for one of the default meta-slots.

Generate the output for a specified default meta-slot by calling the appropriate layout method. The default meta-slots supported are:

  • TopTags
  • Head
  • StartBodyTags
  • BottomTags

Parameters:
$page [SPage]: The SPage object
$ms [string]: The name of the meta-slot to layout
$layout [string]: The layout configuration for this meta-slot


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:03:03 2010 for Common by  doxygen 1.5.6