STrans Class Reference
[Translators]

The template class for all the translation classes. More...

Inheritance diagram for STrans:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($parent)
 A standard constructor method for all XML translators.
 doc ()
 A doc method that can be called externally to get a brief description of this class.
 getInFormat ()
 Gets the expected input format the user has set.
 getInputOption ($key)
 returns the value of the requested input option If the desired option is not set, returns null.
 getOption ($key)
 If the requested option is set, returns that option's value.
 getOutFormat ()
 Gets the expected output format the user wants.
 sendToTarget ($si, $input)
 Puts the output of the translator into the appropriate slot in the SPage object.
 setInputOption ($key, $value)
 Sets the given input option to the given value.
 setInputOptions ($options)
 Set all the input options. Sets all the input options. The given array is simply stored as the input options.
 setOption ($key, $value)
 Sets the desired option to the given value.
 translate ($si)
 A translator helper function that looks for the desired translation helper class.


Detailed Description

The template class for all the translation classes.

The most basic translation class. It is extended by all other classes. Do not use this translator directly. Extend it to make the desired translators.

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

Constructor & Destructor Documentation

STrans::__construct ( parent  ) 

A standard constructor method for all XML translators.

Parameters:
$parent [PageRender]: the current instance of PageRender in use.

Reimplemented in STransInteractivateInstructor, STransInteractivateLesson, STransListXML, and STransXFormsXML.


Member Function Documentation

STrans::doc (  ) 

A doc method that can be called externally to get a brief description of this class.

Returns:
[String] A brief description of this class.

Reimplemented from SObject.

Reimplemented in STransBookXML, STransHTML, STransListXML, STransMediaAgentSheetsApplet, STransMediaApplet, STransMediaDocument, STransMediaFile, STransMediaImage, STransMediaInteractivateApplet, STransMediaNetLogoApplet, STransNavXML, STransObject, STransPhotoXML, STransStdXML, STransStdXML3, STransTK, STransXML, and STransXSL.

STrans::getInFormat (  ) 

Gets the expected input format the user has set.

Child classes will override this function.

Returns:
[String] The format selected by the option 'inFormat'.

Reimplemented in STransHTML, STransMediaAgentSheetsApplet, STransMediaApplet, STransMediaDocument, STransMediaFile, STransMediaImage, STransMediaInteractivateApplet, STransMediaNetLogoApplet, STransObject, STransStdXML, STransStdXML3, STransTK, STransXML, and STransXSL.

STrans::getInputOption ( key  ) 

returns the value of the requested input option If the desired option is not set, returns null.

Parameters:
$key [string]: the name of the requested option.
Returns:
[string]: the value of the requested option (null if not found).

STrans::getOption ( key  ) 

If the requested option is set, returns that option's value.

If the option is set, returns the value. If it isn't set asks the parent for the same option.

Parameters:
$key [string]: the name of the option.
Returns:
[string]: the value of the requested option.

STrans::getOutFormat (  ) 

Gets the expected output format the user wants.

Child classes should override this function.

Returns:
[String] The format selected by the option 'outFormat'.

Reimplemented in STransHTML, STransMediaAgentSheetsApplet, STransMediaApplet, STransMediaDocument, STransMediaFile, STransMediaImage, STransMediaInteractivateApplet, STransMediaNetLogoApplet, STransObject, STransStdXML, STransStdXML3, STransTK, STransXML, and STransXSL.

STrans::sendToTarget ( si,
input 
)

Puts the output of the translator into the appropriate slot in the SPage object.

Grabs the target slot and the input mode (append or set) from the SInput object. If the option "trans_mode" is set to append, it will append to the slot. Otherwise it overwrites the slot ('set'). It hands SPage the desired slot and the output.

Parameters:
$si [SInput]: the SInput object just translated.
$input [string]: a string containing the result of translation (HTML, Javascript, or XML).

STrans::setInputOption ( key,
value 
)

Sets the given input option to the given value.

Parameters:
$key [string]: the name of the desired input option.
$value [string]: the desired value for the input option.

STrans::setInputOptions ( options  ) 

Set all the input options. Sets all the input options. The given array is simply stored as the input options.

Parameters:
$options [array]: an associative array of the input options.

STrans::setOption ( key,
value 
)

Sets the desired option to the given value.

Parameters:
$key [string]: the name of the option being set.
$value [string]: the value to set the option to.

STrans::translate ( si  ) 

A translator helper function that looks for the desired translation helper class.

Child classes can use this function to get the correct translator. NOTE: this translator does no translation itself. If a custom translator is set, the function will try to use it. If the translator has logged errors or cannot find the custom translator, it will return false. If no custom translator is selected or the custom translator is found, it returns true.

Parameters:
$si [SInput]: The SInput object being translated.

Reimplemented in STransBookXML, STransHTML, STransHTMLMedia, STransHTMLTK, STransListXML, STransMediaAgentSheetsApplet, STransMediaApplet, STransMediaDocument, STransMediaFile, STransMediaImage, STransMediaInteractivateApplet, STransMediaNetLogoApplet, STransNavXML, STransNSDLSearchXML, STransObject, STransPhotoXML, STransSDRMetadata, STransStdXML, STransStdXML3, STransTK, STransXFormsXML, STransXML, STransXSL, and TransSDRPendingXML.


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

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