STransNavXML Class Reference
[Translators]

Translates a given NavXML resource into HTML for PageRender. More...

Inheritance diagram for STransNavXML:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 doc ()
 returns a brief description of this class
 translate ($si)
 Translates the NavXML resource into html.

Protected Member Functions

 buildPullDown ($xmlSection, $id, $name, $function, $extraScript, $si)
 A pulldown-builder. It takes a section of XML, an ID, Name, and function (plus any extra script) and generates the necessary html.
 createSearchBox ($xml)
 Reads the search bar section of the xml and creates a search box (if necessary). Like almost all the translator functions, this inputs its results directly into PageRender.
 formatNavBrowseHtml ($navXml, $si)
 Translates all the XML for the "Browse" menu.
 formatNavJumpToHtml ($navXml, $si)
 Translates all the XML for the "Jump To" menu.
 formatNavLocHtml ($navXml)
 Translates all the XML for the "Breadcrumbs Trail".
 formatTabs ($xml, $level)
 Creates the HTML for tabs.


Detailed Description

Translates a given NavXML resource into HTML for PageRender.

STransNavXML translates a NavXML string to generate all the navigation elements of your page ---the breadcrumbs and the jump-to, browse, and search controls.

Author:
Jonathan Stuart-Moore <jwsm@shodor.org>

Definition at line 11 of file STransNavXML.php5.


Member Function Documentation

STransNavXML::buildPullDown ( xmlSection,
id,
name,
function,
extraScript,
si 
) [protected]

A pulldown-builder. It takes a section of XML, an ID, Name, and function (plus any extra script) and generates the necessary html.

For internal use only.

The section of NavXML must be a set of levels, each of which has a value, a link, and a name. The ID is so that the javascript can indentify it (the ID argument is required: it will not be auto-set). The name is the top choice on the pulldown that is what the user sees to begin with. The HTML will call the function specifcied and will append the extra javascript to te appropriate slot.

Parameters:
$xmlSection [SimpleXMLObject]: This xml is just the part that is necessary for the pulldown menu itself.
$id [string]: The string ID that will be used to refer to the pulldown menu in the page.
$name [string]: The string that appears on the top, do-nothing option.
$function [string]: The name of the function that will be called (on page) to handle the javascript of the pull-down.
$extraScript [string]: Any extra javascript that should be appended to the slot of the same name in the page.
$si [SInput]: The SInput object currently being translated.
Returns:
[string]: The HTML output, ready to be submitted to the page (the function doesn't add the html directly).

Definition at line 160 of file STransNavXML.php5.

Referenced by formatNavBrowseHtml(), and formatNavJumpToHtml().

STransNavXML::createSearchBox ( xml  )  [protected]

Reads the search bar section of the xml and creates a search box (if necessary). Like almost all the translator functions, this inputs its results directly into PageRender.

Parameters:
$xml [SimpleXMLObject]: The xml being translated.

Definition at line 64 of file STransNavXML.php5.

Referenced by translate().

STransNavXML::doc (  ) 

returns a brief description of this class

Returns:
[string]: A brief description of this class

Reimplemented from STransXML.

Definition at line 17 of file STransNavXML.php5.

STransNavXML::formatNavBrowseHtml ( navXml,
si 
) [protected]

Translates all the XML for the "Browse" menu.

Parameters:
$navXml [SimpleXMLObject]: The (entire) XML object being translated (Not just the browse tags, though the name may seem to imply that).
$si [SInput]: The SInput object being translated.

Definition at line 109 of file STransNavXML.php5.

References buildPullDown().

Referenced by translate().

STransNavXML::formatNavJumpToHtml ( navXml,
si 
) [protected]

Translates all the XML for the "Jump To" menu.

Parameters:
$navXml [SimpleXMLObject]: The (entire) XML object being translated (Not just the jump to tags, though the name may seem to imply that).
$si [SInput]: The SInput object being translated.

Definition at line 98 of file STransNavXML.php5.

References buildPullDown().

Referenced by translate().

STransNavXML::formatNavLocHtml ( navXml  )  [protected]

Translates all the XML for the "Breadcrumbs Trail".

Parameters:
$navXml [SimpleXMLObject]: The (entire) XML object being translated (Not just the breadcrumb tags, though the name may seem to imply that).

Definition at line 127 of file STransNavXML.php5.

Referenced by translate().

STransNavXML::formatTabs ( xml,
level 
) [protected]

Creates the HTML for tabs.

For internal use only.

There can be up to two rows of tabs (level 1 and 2).

Parameters:
$xml [SimpleXMLObject]: The XML for the tabs (only).
$level [number]: The number of the level. Currently it are only used to retrieve options.
Returns:
[string]: The HTML for the tabs (this function does not input directly).

Definition at line 203 of file STransNavXML.php5.

References STrans::getOption().

Referenced by translate().

STransNavXML::translate ( si  ) 

Translates the NavXML resource into html.

Parameters:
$si [SInput]: the current SInput object being translated.
Returns:
[boolean]: always returns true.

Reimplemented from STransXML.

Definition at line 32 of file STransNavXML.php5.

References createSearchBox(), formatNavBrowseHtml(), formatNavJumpToHtml(), formatNavLocHtml(), formatTabs(), and SXMLHelper::parse().


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

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