CM3 Class Reference
[XML Content Encoders]

Create a StdXML3 document (XMLAlbum, XMLList or XMLResource) from sections of content. More...

List of all members.

Public Member Functions

 __construct ($XmlType)
 intializes the necessary variables
 addSection ($mapping, $attributes=array(), $parent=array())
 Add a section Currently uses a switch statment and a set of child functions to add sections.
 generateXML ()
 generate the XML for this set of sections
 sortSections ($recursive=false, $parent=array())
 Alphabetically sort the sections. NOTE: this destroys all the ids, so you will have to guess what the ids are after running this function. I _very_ strongly suggest this be the LAST function run on a section before translating into XML.


Detailed Description

Create a StdXML3 document (XMLAlbum, XMLList or XMLResource) from sections of content.

Allows users to add sections into the XML of their choice (XMLAlbum, XMLList, or XMLResource) The important functions are the constructor, addSection(), and generateXML().

Author:
Sandy Brady <sbrady@shodor.org>

Constructor & Destructor Documentation

CM3::__construct ( XmlType  ) 

intializes the necessary variables

Parameters:
$XmlType [string]: The type of Xml being inputted (Album, List, or Resource).


Member Function Documentation

CM3::addSection ( mapping,
attributes = array(),
parent = array() 
)

Add a section Currently uses a switch statment and a set of child functions to add sections.

Parameters:
$mapping [string]: the mapping for this section (category or item)
$attributes [Array]: (optional) an array of attributes ('attribute'=>'value')
$parent [Array]: (optional) an array of ids (array indeces) for the parent sections. Capture the return value from the addSection function for the parent section and then just plug it in here (makes it far easier than guessing what the indeces will be).
Returns:
[Array]: an array of indeces for the parent Id (in case you want a child section).

CM3::generateXML (  ) 

generate the XML for this set of sections

Returns:
[string]: valid XML3 ready to be put into PageRender!

CM3::sortSections ( recursive = false,
parent = array() 
)

Alphabetically sort the sections. NOTE: this destroys all the ids, so you will have to guess what the ids are after running this function. I _very_ strongly suggest this be the LAST function run on a section before translating into XML.

Parameters:
$recursive [boolean]: Tells the program to organize all the subsections as well. Defaults to false.
$parent [Array]: standard ID array.
Returns:
[boolean]: True on success, false on failure.


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

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