* @copyright Copyright 2010 MASiv Productions, LLC * @license http://www.MASivProductions.com/WAMLicense WAM License * * Assists in the code-generated production of particularly sexy HTML, * including management of open tags and indentation. Also produces XHTML - * depending on programmer preference or browser request - and XML. * * @package HTPPS */ /* TODO for v0.99 ---------------------------- * Handling (incl. printing) of document schema declarations. * XHTML 1.0 Basic support (incl. generalized tag filter/translator). * Request analyzer, including best-fit-pretty-printer algorithm. * Pretty Printer catalogue, which serves as a factory. */ //CONSTANTS /////////// /** * Represents a language choice of XML within the context of a tag manager or * pretty printer. * * This should be converted to an integer prior to use. */ define('HTPPS_LanguageCode_XML', '0x1000'); /** * Represents a language choice of HTML within the context of a tag manager or * pretty printer. * * This should be converted to an integer prior to use. */ define('HTPPS_LanguageCode_HTML', '0x2000'); /** * Represents a language choice of XHTML within the context of a pretty * printer. * * This should be converted to an integer prior to use. */ define('HTPPS_LanguageCode_XHTML', '0x4000'); //SUBPACKAGE: Scribes ///////////////////// /** * Provides access to a scribe, which is ultimately responsible for sending * text to output. * * The scribe generalizes the output process, so the output may be directed to * a file, inserted into an array, or handled by any other method. It is * injected into a tag manager, which is its sole user. * * @package HTPPS * @subpackage Scribes */ interface HTPPS_iScribe { /** * Outputs a given string. * * @param Text string * The text to write. * * @return void */ public function Write($Text); /** * Outputs a newline. * * @return void */ public function WriteNewline(); /** * Outputs a given string that is used for indentation. * * This may be useful if indentations are to be treated differently than * principal content (e.g. disabled, perhaps conditionally). * * @param Indentation string * The indentation to write. * * @return void */ public function WriteIndentation($Indentation); } // End interface HTPPS_iScribe /** * The default scribe, which writes text to the output stream (stdout). * * This is technically unused by the tag manager, but it provides an example * and may be useful in complex architectures where scribes are interchanged. * * @package HTPPS * @subpackage Scribes */ class HTPPS_DefaultScribe implements HTPPS_iScribe { //PUBLIC FUNCTIONS ////////////////// /** * @see HTPPS_iScribe::Write() */ public function Write($Text) { print($Text); } /** * @see HTPPS_iScribe::WriteNewline() */ public function WriteNewline() { print("\n"); } /** * @see HTPPS_iScribe::WriteIndentation() */ public function WriteIndentation($Indentation) { print($Indentation); } } // End class HTPPS_DefaultScribe /** * A scribe which writes to a string and provides access to the string. * * @package HTPPS * @subpackage Scribes */ class HTPPS_StringScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The string variable to which everything is written. * * @var string */ protected $StringVariable; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_StringScribe::$StringVariable */ public function __construct() { $this->StringVariable = ''; } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_StringScribe::$StringVariable */ public function Write($Text) { $this->StringVariable .= $Text; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_StringScribe::$StringVariable */ public function WriteNewline() { $this->StringVariable .= "\n"; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_StringScribe::$StringVariable */ public function WriteIndentation($Indentation) { $this->StringVariable .= $Indentation; } /** * Returns the string which accumulates output. * * @param Clear bool * Determines whether to clear the object-scope string after reading * it. * * @uses HTPPS_StringScribe::$StringVariable */ public function String($Clear=false) { // Check if the string should be cleared after reading. if ($Clear) { // Make a copy of the string and clear it. $stringCopy = $this->StringVariable; $this->StringVariable = ''; // Return the copy of the string. return $stringCopy; } // Else leave the string unaffected. else { // Return the string. return $this->StringVariable; } } } // End class HTPPS_StringScribe /** * A scribe which writes to a string which is a reference of a user-provided * string. * * @package HTPPS * @subpackage Scribes */ class HTPPS_StringReferenceScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The reference to a string variable to which everything is written. * * @var string * A reference to the string. */ protected $StringReferenceVariable; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param String string * The string variable which will receive all output; it is passed by * reference. * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function __construct(&$String) { $this->StringReferenceVariable = &$String; } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function Write($Text) { $this->StringReferenceVariable .= $Text; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function WriteNewline() { $this->StringReferenceVariable .= "\n"; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function WriteIndentation($Indentation) { $this->StringReferenceVariable .= $Indentation; } /** * Sets the reference to the string which accumulates output. * * @param String string * The string variable which will receive all output; it is passed by * reference. * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function SetStringReference(&$String) { $this->StringReferenceVariable = &$String; } /** * Returns the string which accumulates output. * * This returns the string by value. * * @param Clear bool * Determines whether to clear the object-scope string after reading * it. * * @uses HTPPS_StringReferenceScribe::$StringReferenceVariable */ public function String($Clear=false) { // Check if the string should be cleared after reading. if ($Clear) { // Make a copy of the string and clear it. $stringCopy = $this->StringReferenceVariable; $this->StringReferenceVariable = ''; // Return the copy of the string. return $stringCopy; } // Else leave the string unaffected. else { // Return the string. return $this->StringReferenceVariable; } } } // End class HTPPS_StringReferenceScribe /** * A scribe which writes each line to an array entry and which provides access * to the array. * * @package HTPPS * @subpackage Scribes */ class HTPPS_ArrayScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The array variable to which everything is written. * * @var array */ protected $ArrayVariable; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_ArrayScribe::$ArrayVariable */ public function __construct() { $this->ArrayVariable = array(); } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_ArrayScribe::$ArrayVariable */ public function Write($Text) { // Set the array's cursor to its last element. end($this->ArrayVariable); // Using the key of the last element, append the string with this text. $this->ArrayVariable[key($this->ArrayVariable)] .= $Text; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_ArrayScribe::$ArrayVariable */ public function WriteNewline() { $this->ArrayVariable[] = ''; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_ArrayScribe::$ArrayVariable */ public function WriteIndentation($Indentation) { $this->ArrayVariable[key($this->ArrayVariable)] .= $Indentation; } /** * Returns the array which accumulates output. * * @param Clear bool * Determines whether to clear the object-scope array after reading it. * * @uses HTPPS_ArrayScribe::$ArrayVariable */ public function GetArray($Clear=false) { // Check if the array should be cleared after reading. if ($Clear) { // Make a copy of the array and clear it. $arrayCopy = $this->ArrayVariable; $this->ArrayVariable = array(); // Return the copy of the array. return $arrayCopy; } // Else leave the array unaffected. else { // Return the array. return $this->ArrayVariable; } } } // End class HTPPS_ArrayScribe /** * A scribe which writes each line to an array entry, wherein the array is a * reference to a user-provided array. * * @package HTPPS * @subpackage Scribes */ class HTPPS_ArrayReferenceScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The reference to an array variable to which everything is written. * * @var array * A reference to the array. */ protected $ArrayReferenceVariable; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param Array array * The array variable which will receive all output; it is passed by * reference. * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function __construct(&$Array) { $this->ArrayReferenceVariable = &$Array; } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function Write($Text) { // Set the array's cursor to its last element. end($this->ArrayReferenceVariable); // Using the key of the last element, append the string with this text. $this->ArrayReferenceVariable[key($this->ArrayReferenceVariable)] .= $Text; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function WriteNewline() { $this->ArrayReferenceVariable[] = ''; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function WriteIndentation($Indentation) { // Set the array's cursor to its last element. end($this->ArrayReferenceVariable); // Using the key of the last element, append the string with this text. $this->ArrayReferenceVariable[key($this->ArrayReferenceVariable)] .= $Indentation; } /** * Sets the reference to the array which accumulates output. * * @param Array array * The array variable which will receive all output; it is passed by * reference. * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function SetArrayReference(&$Array) { $this->ArrayReferenceVariable = &$Array; } /** * Returns the array which accumulates output. * * This returns the array by value. * * @param Clear bool * Determines whether to clear the object-scope array after reading * it. * * @uses HTPPS_ArrayReferenceScribe::$ArrayReferenceVariable */ public function GetArray($Clear=false) { // Check if the array should be cleared after reading. if ($Clear) { // Make a copy of the array and clear it. $arrayCopy = $this->ArrayReferenceVariable; $this->ArrayReferenceVariable = array(); // Return the copy of the array. return $arrayCopy; } // Else leave the array unaffected. else { // Return the array. return $this->ArrayReferenceVariable; } } } // End class HTPPS_ArrayReferenceScribe /** * A scribe which writes to a file. * * @package HTPPS * @subpackage Scribes */ class HTPPS_FileScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The file handle by which everything is written. * * @var resource|null * The FILE resource if a file is open or null otherwise. */ protected $FileVariable; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Attempts to open a handle to the file at the given path and store it in * the object-scope variable. * * This attempts to open the file in append mode. This unconditionally * closes the object-scope file handler if it is already bound to a file. * * @param FilePath string * The path to the file. * * @return bool * Returns true upon success and false otherwise. * * @uses HTPPS_FileScribe::$FileVariable */ protected function OpenFile($FilePath) { // Close the object-scope handler. $this->CloseFile(); // Attempt to open the file. $handle = fopen($FilePath, 'ab'); // If the opening was successful, assign the handler to the // object-scope variable and return an indication of success. if ($handle !== false) { $this->FileVariable = $handle; return true; } // Else return an indication of failure. else { return false; } } /** * Closes the file handler in object scope. * * This may be called if the handler is not bound to a file. * * @return void * * @uses HTPPS_FileScribe::$FileVariable */ protected function CloseFile() { // Close the object-scope handler. if (is_resource($this->FileVariable)) { fclose($this->FileVariable); } // Nullify the object-scope variable. $this->FileVariable = null; } /** * Appends a string to the file whose handler is in object scope. * * This may be called if the handler is not bound to a file, in which case * it does nothing. * * @return void * * @uses HTPPS_FileScribe::$FileVariable */ protected function AppendFile($Text) { // Check if a file is open. if ($this->FileVariable) { // Write to the file. fwrite($this->FileVariable, $Text); } } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param FilePath string|null * The path to the file to open; null by default. * @param ClearFile bool * Dictates whether the file should be deleted before it is opened for * append-mode writing. * * @uses HTPPS_FileScribe::$FileVariable * @uses HTPPS_CompactFileScribe::OpenFile() */ public function __construct($FilePath=null, $ClearFile=false) { // Initialize the handle. $this->FileVariable = null; // If a file path was given, attempt to open a handle to it. if ($FilePath) { $this->OpenFile($FilePath, $ClearFile); } } /** * Destructor. * * @uses HTPPS_FileScribe::$FileVariable */ public function __destruct() { // Close the file handle. $this->CloseFile(); } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_FileScribe::AppendFile() */ public function Write($Text) { $this->AppendFile($Text); } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_FileScribe::AppendFile() */ public function WriteNewline() { $this->AppendFile("\n"); } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_FileScribe::AppendFile() */ public function WriteIndentation($Indentation) { $this->AppendFile($Indentation); } /** * Opens a file for writing so it may receive the output of the scribe. * * The file is opened in append mode. * * @param FilePath string * The path to the file to open. * @param ClearFile bool * Dictates whether the file should be deleted before it is opened for * append-mode writing. * * @uses HTPPS_FileScribe::OpenFile() */ public function Open($FilePath, $ClearFile=false) { // Attempt to delete the file first if desired. if ($ClearFile) { @unlink($FilePath); } // Open the file for append-mode writing. $this->OpenFile($FilePath); } } // End class HTPPS_FileScribe /** * A scribe which writes to the output stream but does not write newlines or * indentations. * * @package HTPPS * @subpackage Scribes */ class HTPPS_CompactScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * Whether a newline was the most-recently-written string. * * @var bool */ protected $NewlineMostRecentlyWritten; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_CompactScribe::$NewlineMostRecentlyWritten */ public function __construct() { $NewlineMostRecentlyWritten = false; } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_CompactScribe::$NewlineMostRecentlyWritten */ public function Write($Text) { // Write the text. print($Text); // Mark that a newline was not most recently written. $NewlineMostRecentlyWritten = false; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_CompactScribe::$NewlineMostRecentlyWritten */ public function WriteNewline() { // Mark that a newline was most recently written. $NewlineMostRecentlyWritten = true; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_CompactScribe::$NewlineMostRecentlyWritten */ public function WriteIndentation($Indentation) { // If the indentation was preceded by a newline, write whitespace just // so there is some whitespace separating the prior text and the // forthcoming text. if ($NewlineMostRecentlyWritten) { print(' '); } // Mark that a newline was not most recently written. $NewlineMostRecentlyWritten = false; } } // End class HTPPS_CompactScribe /** * A scribe which writes to a file and does not write newlines or indentations. * * @package HTPPS * @subpackage Scribes */ class HTPPS_CompactFileScribe implements HTPPS_iScribe { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The file handle by which everything is written. * * @var resource|null * The FILE resource if a file is open or null otherwise. */ protected $FileVariable; /** * Whether a newline was the most-recently-written string. * * @var bool */ protected $NewlineMostRecentlyWritten; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Attempts to open a handle to the file at the given path and store it in * the object-scope variable. * * This attempts to open the file in append mode. This unconditionally * closes the object-scope file handler if it is already bound to a file. * * @param FilePath string * The path to the file. * * @return bool * Returns true upon success and false otherwise. * * @uses HTPPS_CompactFileScribe::$FileVariable */ protected function OpenFile($FilePath) { // Close the object-scope handler. $this->CloseFile(); // Attempt to open the file. $handle = fopen($FilePath, 'ab'); // If the opening was successful, assign the handler to the // object-scope variable and return an indication of success. if ($handle !== false) { $this->FileVariable = $handle; return true; } // Else return an indication of failure. else { return false; } } /** * Closes the file handler in object scope. * * This may be called if the handler is not bound to a file. * * @return void * * @uses HTPPS_CompactFileScribe::$FileVariable */ protected function CloseFile() { // Close the object-scope handler if it is open. if (is_resource($this->FileVariable)) { fclose($this->FileVariable); } // Nullify the object-scope variable. $this->FileVariable = null; } /** * Appends a string to the file whose handler is in object scope. * * This may be called if the handler is not bound to a file, in which case * it does nothing. * * @return void * * @uses HTPPS_CompactFileScribe::$FileVariable */ protected function AppendFile($Text) { // Check if a file is open. if ($this->FileVariable) { // Write to the file. fwrite($this->FileVariable, $Text); } } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param FilePath string|null * The path to the file to open; null by default. * @param ClearFile bool * Dictates whether the file should be deleted before it is opened for * append-mode writing. * * @uses HTPPS_CompactFileScribe::$FileVariable * @uses HTPPS_CompactFileScribe::$NewlineMostRecentlyWritten * @uses HTPPS_CompactFileScribe::OpenFile() */ public function __construct($FilePath=null) { // Initialize the handle and newline flag. $this->FileVariable = null; $NewlineMostRecentlyWritten = false; // If a file path was given, attempt to open a handle to it. if ($FilePath) { $this->OpenFile($FilePath, $ClearFile); } } /** * Destructor. * * @uses HTPPS_CompactFileScribe::$FileVariable */ public function __destruct() { // Close the file handle. $this->CloseFile(); } /** * @see HTPPS_iScribe::Write() * * @uses HTPPS_CompactFileScribe::AppendFile() * @uses HTPPS_CompactFileScribe::$NewlineMostRecentlyWritten */ public function Write($Text) { // Write the text. $this->AppendFile($Text); // Mark that a newline was not most recently written. $NewlineMostRecentlyWritten = false; } /** * @see HTPPS_iScribe::WriteNewline() * * @uses HTPPS_CompactFileScribe::AppendFile() * @uses HTPPS_CompactFileScribe::$NewlineMostRecentlyWritten */ public function WriteNewline() { // Mark that a newline was most recently written. $NewlineMostRecentlyWritten = true; } /** * @see HTPPS_iScribe::WriteIndentation() * * @uses HTPPS_CompactFileScribe::AppendFile() * @uses HTPPS_CompactFileScribe::$NewlineMostRecentlyWritten */ public function WriteIndentation($Indentation) { // If the indentation was preceded by a newline, write whitespace just // so there is some whitespace separating the prior text and the // forthcoming text. if ($NewlineMostRecentlyWritten) { $this->AppendFile(' '); } // Mark that a newline was not most recently written. $NewlineMostRecentlyWritten = false; } /** * Opens a file for writing so it may receive the output of the scribe. * * The file is opened in append mode. * * @param FilePath string * The path to the file to open. * @param ClearFile bool * Dictates whether the file should be deleted before it is opened for * append-mode writing. * * @uses HTPPS_CompactFileScribe::OpenFile() */ public function Open($FilePath, $ClearFile=false) { // Attempt to delete the file first if desired. if ($ClearFile) { @unlink($FilePath); } // Open the file for append-mode writing. $this->OpenFile($FilePath); } } // End class HTPPS_CompactFileScribe //SUBPACKAGE: Tag Managers ////////////////////////// /** * Provides access to a tag manager, which generically manages tags of HTML, * XHTML, or XML, including their being written to the output stream in a * pretty manner. * * The tag manager is the generic lower layer of a pretty printer that * specializes in a particular markup language or domain (e.g. XHTML web * pages). The tag manager is responsible for coordinating all writes to * output, and, in the absence of a scribe, directly writes all data to output. * * @package HTPPS * @subpackage TagManagers */ interface HTPPS_iTagManager { /** * Sets the scribe of the tag manager. * * @param Scribe HTPPS_iScribe * The scribe the tag manager will use. * * @return null */ public function SetScribe(HTPPS_iScribe $Scribe); /** * Removes the scribe from the tag manager and resets the tag manager to * default output behavior. * * @return null */ public function ResetScribe(); /** * Returns an escaped version of the given text so that it may be used in * the markup language of the class. * * This converts text to entity references where possible. It is not * responsible for handling symbols which are deemed illegal by the markup * language. * * @param Text string * The text to be escaped. * * @return string The escaped text. */ public function EscapeForMarkup($Text); /** * Returns an escaped version of the given text so that it may be used in * a quoted string with the given quote character. * * @param Text string * The text to be escaped. * @param QuoteCharacter string * The character used for a quote. * * @return string The escaped text. */ public function EscapeForQuotes($Text, $QuoteCharacter='"'); /** * Writes the opening of a tag and adds it to the stack of open tags. * * @param Tag string * The tag string, which will not be specially processed. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a tag with no inner text. * * @param Tag string * The tag string, which will not be specially processed. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteEmptyTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Returns the tag at the top of the stack, or null if there is no tag. * * @return string|null * The tag or null. */ public function MostRecentTag(); /** * Returns the depth of the tag stack, with zero indicating that no tags * are open and one indicating that one tag is open. * * @return integer The depth of the tag tree/stack. */ public function TagDepth(); /** * Increases the indentation level by a given value, such that after * calling this function with a positive-valued argument, there is more * indentation. * * This should be used as a public API rather than an intra-library call. * This is normally not needed, as the indentation level may be affected by * the opening and closing of tags. This function coerces the input to a * nonnegative integer. * * @param Amount integer * The amount to add to the indentation level; positive. * * @return void */ public function IncreaseIndentationLevel($Amount=1); /** * Decreases the indentation level by a given value, such that after * calling this function with a positive-valued argument, there is less * indentation. * * This should be used as a public API rather than an intra-library call. * This is normally not needed, as the indentation level may be affected by * the opening and closing of tags. This function coerces the input to a * nonnegative integer and prevents the indentation level from becoming * negative. * * @param Amount integer * The amount to subtract from the indentation level; positive. * * @return void */ public function DecreaseIndentationLevel($Amount=1); /** * Sets the indentation level to a given value, with zero corresponding to * no indentation. * * This function coerces the input to a nonnegative integer. * * @param IndentationLevel integer * The indentation level; nonnegative. * * @return void */ public function SetIndentationLevel($IndentationLevel); /** * Closes the most-recently-opened tag or all tags up to a given tag name, * optionally with a newline after each one. * * If any encountered tag brought a deeper level of indentation when it was * opened, the indentation level will be decremented accordingly. * * @param EndWithNewlines bool * Dictates whether this function should write newlines after each tag * it closes. * @param SearchTag string * The tag for which this function should search. * @param StopBeforeSearchTag bool * Dictates whether this function should stop closing tags right before * the search tag is found, which would leave it as the top of the * stack. * * @return void */ public function CloseTag($EndWithNewlines=true, $SearchTag=null, $StopBeforeSearchTag=null); /** * Closes a number of the most-recently-opened tags. * * @param Number integer * The number of tags to close. * @param EndWithNewlines bool * Dictates whether this function should write newlines after each tag * it closes. * * @return void */ public function CloseTags($Number, $EndWithNewlines=true); /** * Closes the most-recently-opened tags down to the given tag depth. * * @param TagDepth integer * The depth to which this function should close tags; after this * function, the document will be within the given level of tag (i.e. * giving 0 implies there are no tags open; giving 1 implies there is * one tag open). * @param EndWithNewlines bool * Dictates whether this function should write newlines after each tag * it closes. * * @return void */ public function CloseTagsToDepth($TagDepth, $EndWithNewlines=true); /** * Closes all open tags, optionally including system-opened tags. * * @param CloseSystemTags bool * Dictates whether this function should close system-level tags, which * are those responsible for the document to remain meaningful, * correct, and open for writing. * * @return void */ public function CloseAllTags($CloseSystemTags=false); /** * Opens a comment section. * * This does not write a newline or any space after the comment opening. * * @return void */ public function OpenComment(); /** * Closes a comment section. * * This does not write a space before the comment closing. * * @param EndWithNewline bool * Dictates whether a newline will be written after the closing. * * @return void */ public function CloseComment($EndWithNewline=true); /** * Writes a comment in the document. * * This does not pad the given text with spaces, and it does not process * the comment text. * * @param Text string * The text to write inside the comment. * @param EndWithNewline bool * Dictates whether a newline will be written after the closing. * * @return void */ public function WriteComment($Text, $EndWithNewline=true); /** * Writes text to the output stream, including management of indentation. * * This is the gateway for the vast majority of functions, including all * those in derived classes within the HTPPS system, which write to output. * This indents the written text if appropriate. * * @param Text string * The text to write. * * @return void */ public function Write($Text); /** * Writes text to the output stream, simply and without management of * indentation. * * When preceded by a newline, this text will be flush left with the left * side of the document. * * @param Text string * The text to write. * * @return void */ public function WriteUnindented($Text); /** * Writes a newline in the document. * * @return void */ public function WriteNewline(); /** * Ensures that the text written after this call starts on its own line. * * This may write a newline if necessary but may do nothing if a newline * was most recently written. * * @return void */ public function ClearLine(); /** * Ensures that there are a number of blank lines in the document. * * @param Number integer * The number of lines to skip. * * @return void */ public function SkipLine($Number=1); /** * Escapes data for markup-language output and then writes it to the output * stream, including management of indentation. * * @param Text string * The text to write and escape. * * @return void */ public function WriteAndEscape($Text); /** * Writes a preformatted block of text to output, without escaping for * markup or management of indentation. * * This writes a newline, then the block of text without additional * indentation or processing, and then a newline, after which point the * indentation policy will resume. * * @param Text string * The block of text to write, including its own newlines. * * @return void */ public function WriteBlock($Text); /** * Writes a preformatted block of text to output, without escaping for * markup but with management of indentation. * * This writes a newline, then each line in the block of text with the * appropriate amount of indentation, and then a newline, after which point * the indentation policy will resume. * * @param TextLines array * An array representing the lines of text in the block, which should * not contain their own newlines. * * @return void */ public function WriteBlockIndented(array $TextLines); /** * Calling this function signifies that the most-recently-opened tag has * established the beginning of principal document content (e.g. ). * * After this has been called properly, the user may call CloseAllTags() * using its default parameter and then expect that the document has only * the tags necessary to remain meaningful, correct, and open for writing. * * @return void */ public function BeginDocumentContentTags(); /** * Opens the document's root tag and any other tags necessary to begin * writing the principal document, except for declarations of schema. * * This shall make any declarations of language type, language version, or * encoding type which are required by the markup language to appear before * the document's principal tags. * * @param RootElementTag string * The tag of the root element of the document. * @param RootElementAttributes array * The array of attributes for the root element of the document; * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param RootElementOneAttributePerLine bool * Dictates whether the attributes of the root element will be written * with one attribute per line; if so, they will be aligned flush left. * @param RootElementExtraString string * Written inside the root-element tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null); /** * Closes the document's root tag and any other tags necessary to end * writing the document completely. * * @return void */ public function CloseDocumentTags(); /** * Returns an indication of the markup language used by the tag manager or * or pretty printer, which does not include version or dialect * information. * * @return integer * An integer corresponding to the package-scope constants for language * codes. */ public function MarkupLanguageCode(); /** * The name of the markup language used by the tag manager or pretty * printer, which does not include its version. * * @return string * The language name in a printable format, without its version. */ public function MarkupLanguageName(); /** * The version number of the markup language used by the tag manager or * pretty printer. * * @return string * The version number in a printable format. */ public function MarkupLanguageVersion(); /** * The dialect of the markup language used by the tag manager or * pretty printer, which may come from the schema or may be absent if it is * unavailable. * * @return string * The dialect name in a printable format. */ public function MarkupLanguageDialect(); /** * The name, version, and dialect of the markup language used by the tag * manager or pretty printer, suitable for presentation. * * @return string * The language name and version information. */ public function MarkupLanguage(); /** * Returns an indication of whether the markup language of the tag manager * or pretty printer is XML, which would include XHTML. * * @return bool */ public function IsXML(); /** * Returns an indication of whether the markup language of the tag manager * or pretty printer is HTML. * * @return bool */ public function IsHTML(); } // End interface HTPPS_iTagManager /** * The abstract base class of all tag managers, which generically manage tags * of an HTML, XHTML, or XML document, including their being written to output * in a pretty manner. * * The tag manager is the generic lower layer of a pretty printer that * specializes in a particular markup language or domain (e.g. XHTML web * pages). The tag manager is responsible for coordinating all writes to * output, and, in the absence of a scribe, directly writes all data to output. * * @package HTPPS * @subpackage TagManagers */ abstract class HTPPS_TagManager implements HTPPS_iTagManager { //CONSTANTS /////////// /** * The default string used for each individual indentation. */ const DefaultIndentationString = "\t"; /** * The default depth of indentation strings to prepare initially. */ const DefaultInitialMaxIndentationLevel = 10; //PRIVATE & PROTECTED DATA ////////////////////////// /** * If the tag manager has a custom scribe, then its reference is kept here; * else this is null. * * @var HTPPS_iScribe|null * The custom scribe used for this tag manager, or null. */ private $Scribe; /** * The zero-indexed level of indentation within the document, with 0 * corresponding to no indentation. * * @var integer * Nonnegative. */ protected $IndentationLevel; /** * The string used for each indentation. * * @var string * One instance of an indentation (e.g. ' ' or "\t"). */ private $IndentationString; /** * An array of strings which are the indentation strings used at each level * of indentation (e.g. ['', ' ', ' ', ' ']). * * The array index corresponds to the level of indentation. The [0] entry * is the empty string, since the indentaiton level of 0 corresponds to no * indentation. This array should be kept so that the strings can be reused * rather than for built every line, since PHP's string building is * inefficient. * * @var array * Array of strings. * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::$IndentationString */ private $IndentationStrings; /** * The stack of boolean values, which correspond to the values of $TagStack * that have caused an indentation. * * @var array * Array of bool. */ private $TagStackIndentaitonFlags; /** * The number of system-opened tags, which must not be closed when only * content tags are to be closed. * * @var integer * Nonnegative. */ private $TagStackSystemTagThreshold; /** * Whether a newline was the most-recently-written string. * * @var bool */ private $NewlineMostRecentlyWritten; //PUBLIC DATA ///////////// /** * The stack of open tags, with the last array element being the * most-recently-opened tag. * * This is publicly exposed to facilitate any algorithm which may need to * scan the stack quickly, as method access would probably be too slow for * any algorithm that needs to do so. Please be responsible, or else * override this method and alter its behavior. * * @var array * Array of strings, each of which is the tag used upon opening. */ public $TagStack; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Builds the array of indentation strings by constructing a fixed number * of strings. * * @param InitialDepth integer * The initial tag depth for which this should build indentation * strings. * * @return void * * @uses HTPPS_TagManager::$IndentationString * @uses HTPPS_TagManager::$IndentationStrings */ private function InitializeIndentationStrings($InitialDepth) { // Clear the array. $this->IndentationStrings = array(); // Build a number of indentation strings. for ($i = 0; $i < $InitialDepth; $i++) { $indentationString = ''; // Construct the indentation string via iteration. for ($j = 0; $j < $i; $j++) { $indentationString .= $this->IndentationString; } // Insert the string into the object-scope array. $this->IndentationStrings[] = $indentationString; } } /** * Writes the given string as an indentation, which may induce different * behavior than if it were written as general text. * * @return void * * @uses HTPPS_TagManager::$Scribe */ private function WriteStringAsIndentation($String) { // Write the indentation string. // Check if no custom scribe is given. if (!($this->Scribe)) { print($String); } // Else use the custom scribe. else { $this->Scribe->WriteIndentation($String); } } /** * Writes the indentation string to output. * * This writes the appropriate number of indentations, according to * $IndentationLevel. * * @return void * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::$IndentationString * @uses HTPPS_TagManager::$IndentationStrings * @uses HTPPS_TagManager::WriteStringAsIndentation() */ private function WriteIndentation() { // Ensure the indentation level is nonnegative. $this->IndentationLevel = max($this->IndentationLevel, 0); // Check if the indentation string has already been built for this // indentation level. if (sizeof($this->IndentationStrings) > $this->IndentationLevel) { // Write the pre-built indentation string. $this->WriteStringAsIndentation ($this->IndentationStrings[$this->IndentationLevel]); return; } // Else prepare the string and insert it into the array. $indentationString = ''; // Construct the indentation string via iteration. for ($i = 0; $i < $this->IndentationLevel; $i++) { $indentationString .= $this->IndentationString; } // Insert the string into the object-scope array. $this->IndentationStrings[] = $indentationString; // Write the string. $this->WriteStringAsIndentation($indentationString); } /** * Returns whether the markup language requires a slash in an empty tag. * * This defaults to the behavior dictated by HTML (i.e. returns false). * * @return bool */ protected function SlashInEmptyTag() { return false; } /** * Writes the opening of a tag. * * @param Tag string * The tag string, which will not be specially processed. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * @param EmptyTag bool * Dictates whether the tag should be closed within its opening. * * @return void * * @uses HTPPS_TagManager::EscapeForQuotes() * @uses HTPPS_TagManager::SlashInEmptyTag() * @uses HTPPS_TagManager::WriteAndEscape() * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteNewline() */ private function WriteTagOpening($Tag, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null, $EmptyTag=false) { $attributeLeftPadding = ''; // Write the first piece of text in a way that triggers indentation // management. $this->Write('<'.$Tag); // Write any attributes. Split behavior for one-attribute-per-line // formatting. if ($OneAttributePerLine && (sizeof($Attributes) > 0)) { // Rewind the array so that the first key and value may be fetched. $attributeValue = reset($Attributes); $attributeName = key($Attributes); // Write the first attribute's name and value. $this->WriteImpl(' '.$attributeName.'="'); $this->WriteAndEscape($this->EscapeForQuotes($attributeValue)); $this->WriteImpl('"'); // Build a string of spaces that will help pad each attribute so // that it is flush left with the first one. $attributeLeftPadding = ''; for ($i = 0; $i < strlen($Tag) + 1; $i++) { $attributeLeftPadding .= ' '; } // Advance the array of attributes. next($Attributes); // Iterate through all remaining attributes. while (list($attributeName, $attributeValue) = each($Attributes)) { // Write a newline first. $this->WriteNewline(); // Write a leading space so that the line starts with the usual // indentation. $this->Write(' '); // Write padding so the attribute is flush left with others. $this->WriteStringAsIndentation($attributeLeftPadding); // Write the attribute's name and value. $this->WriteImpl($attributeName.'="'); $this->WriteAndEscape($this->EscapeForQuotes($attributeValue)); $this->WriteImpl('"'); } } // Handle all-attributes-on-one-line formatting. else if (sizeof($Attributes) > 0) { // Iterate through all attributes. foreach ($Attributes as $attributeName => $attributeValue) { $this->WriteImpl(' '.$attributeName.'="'); $this->WriteAndEscape($this->EscapeForQuotes($attributeValue)); $this->WriteImpl('"'); } } // Write any extra string. if (strlen($ExtraString) > 0) { // If the attributes were written one per line, write this string // on its own line. if ($OneAttributePerLine) { $this->WriteNewline(); $this->WriteStringAsIndentation($attributeLeftPadding); } // Else precede the extra string with a space. else { $this->WriteImpl(' '); } // Write the extra string. $this->WriteAndEscape($ExtraString); } // Close the opening of the tag, optionally closing the tag entirely. if ($EmptyTag && $this->SlashInEmptyTag()) { $this->WriteImpl(' /'); } $this->WriteImpl('>'); } /** * Writes the closing of a non-empty tag. * * @param Tag string * The tag string, which will not be specially processed. * * @return void * * @uses HTPPS_TagManager::WriteImpl() */ private function WriteTagClosing($Tag) { // Write the text in a way that triggers indentation management. $this->Write(''); } /** * Writes text to output, using the scribe in object scope if it is * defined. * * This is the lowest-level gateway within the tag manager system for * writing to output, except for newlines and indentations. * * @param Text string * The text to be written verbatim to output. * * @return void * * @uses HTPPS_TagManager::$Scribe */ private function WriteImpl($Text) { // Check if no custom scribe is given. if (!($this->Scribe)) { print($Text); } // Else use the custom scribe. else { $this->Scribe->Write($Text); } } /** * Closes the most-recently-opened open tag, optionally with a newline * afterwards. * * If the current tag brought a deeper level of indentation when it was * opened, then the indentation level will be decremented. * * @return void * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::$TagStack * @uses HTPPS_TagManager::$TagStackIndentationFlags * @uses HTPPS_TagManager::WriteTagClosing() * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteNewline() */ private function CloseMostRecentTag($EndWithNewline=true) { // Check if there are any open tags. if (sizeof($this->TagStack) > 0) { // Fetch the current tag and its indentation flag. $currentTag = array_pop($this->TagStack); $currentTagIndentationFlag = array_pop($this->TagStackIndentationFlags); // Affect the indentaiton level if necessary. if ($currentTagIndentationFlag) { $this->IndentationLevel--; } // Write the tag closing. $this->WriteTagClosing($currentTag); // Write any following newline. if ($EndWithNewline) { $this->WriteNewline(); } } } /** * Closes the most-recently-opened tags until a specific tag is found, * optionally stopping before the given tag. * * @param SearchTag string * The tag for which this function should search. * @param StopBeforeSearchTag bool * Dictates whether this function should stop closing tags right before * the search tag is found, which would leave it as the top of the * stack. * @param EndWithNewlines bool * Dictates whether this function should write newlines after each tag * it closes. * * @return void * * @uses HTPPS_TagManager::$TagStack * @uses HTPPS_TagManager::$TagStackIndentationFlags * @uses HTPPS_TagManager::CloseMostRecentTag() */ private function CloseTagsUntilTagFound($SearchTag, $StopBeforeSearchTag=false, $EndWithNewlines=true) { // Search for the given tag, popping the stack until it is found. while (sizeof($this->TagStack) > 0) { // Capture the current tag. $currentTag = $this->MostRecentTag(); // If the tag was the search tag and this function should stop // before the search tag, abort. if (($currentTag == $SearchTag) && $StopBeforeSearchTag) { break; } // Close the tag. $this->CloseMostRecentTag($EndWithNewlines); // If the tag was the search tag, abort. if ($currentTag == $SearchTag) { break; } } } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param IndentationString string * The string used for each individual indentation. * @param InitialMaxIndentationLevel integer * The depth of indentation strings to prepare initially; this is a * string-building optimization that prepares indentation strings of * several lengths to correspond with indentation levels. This need * only be nonnegative. * @param Scribe HTPPS_iScribe|null * The scribe to use, or null to induce default behavior. * * @uses HTPPS_TagManager::$Scribe * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::$IndentationString * @uses HTPPS_TagManager::$IndentationStrings * @uses HTPPS_TagManager::$TagStackIndentaitonFlags * @uses HTPPS_TagManager::$TagStackSystemTagThreshold * @uses HTPPS_TagManager::$NewlineMostRecentlyWritten * @uses HTPPS_TagManager::$TagStack * @uses HTPPS_TagManager::InitializeIndentationStrings() */ public function __construct($IndentationString =self::DefaultIndentationString, $InitialMaxIndentationLevel =self::DefaultInitialMaxIndentationLevel, HTPPS_iScribe $Scribe=null) { // Set object-scope data to its correct type and value, in most cases. $this->Scribe = $Scribe; $this->IndentationLevel = 0; $this->IndentationString = $IndentationString; $this->IndentationStrings = array(); $this->TagStackIndentaitonFlags = array(); $this->TagStackSystemTagThreshold = 0; $this->NewlineMostRecentlyWritten = false; $this->TagStack = array(); // Initialize the array of indentation strings. $this->InitializeIndentationStrings($InitialMaxIndentationLevel); } /** * Destructor. */ public function __destruct() { } /** * @see HTPPS_iTagManager::SetScribe() * * @uses HTPPS_TagManager::$Scribe */ public function SetScribe(HTPPS_iScribe $Scribe) { $this->Scribe = $Scribe; } /** * @see HTPPS_iTagManager::ResetScribe() * * @uses HTPPS_TagManager::$Scribe */ public function ResetScribe() { $this->Scribe = null; } /** * @see HTPPS_iTagManager::EscapeForQuotes() */ public function EscapeForQuotes($Text, $QuoteCharacter='"') { // Coerce the argument to a string. $Text = strval($Text); // Search and replace. $Text = str_replace($QuoteCharacter, '\\'.$QuoteCharacter.'\\', $Text); // Return the modified string. return $Text; } /** * @see HTPPS_iTagManager::OpenTag() * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::$TagStack * @uses HTPPS_TagManager::$TagStackIndentaionFlags * @uses HTPPS_TagManager::WriteTagOpening() * @uses HTPPS_TagManager::WriteNewline() */ public function OpenTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Write the tag. $this->WriteTagOpening($Tag, $Attributes, $OneAttributePerLine, $ExtraString); // Record the open tag. $this->TagStack[] = $Tag; // Record the end-with-newline flag into a parallel stack, and print // the newline if desired. if ($EndWithNewline) { $this->IndentationLevel++; $this->TagStackIndentationFlags[] = true; $this->WriteNewline(); } else { $this->TagStackIndentationFlags[] = false; } } /** * @see HTPPS_iTagManager::WriteEmptyTag() * * @uses HTPPS_TagManager::WriteTagOpening() * @uses HTPPS_TagManager::WriteNewline() */ public function WriteEmptyTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Write the tag. $this->WriteTagOpening($Tag, $Attributes, $OneAttributePerLine, $ExtraString, true); // Write any trailing newline. if ($EndWithNewline) { $this->WriteNewline(); } } /** * @see HTPPS_iTagManager::MostRecentTag() * * @uses HTPPS_TagManager::$TagStack */ final public function MostRecentTag() { // If the tag stack contains elements, fetch its last element. if (sizeof($this->TagStack)) { return end($this->TagStack); } // Else return null. else { return null; } } /** * @see HTPPS_iTagManager::TagDepth() * * @uses HTPPS_TagManager::$TagStack */ final public function TagDepth() { return sizeof($this->TagStack); } /** * @see HTPPS_iTagManager::IncreaseIndentationLevel() * * @uses HTPPS_TagManager::$IndentationLevel */ final public function IncreaseIndentationLevel($Amount=1) { // Add to the indentation level, ensuring the value is nonnegative. $this->IndentationLevel += max(intval($Amount), 0); } /** * @see HTPPS_iTagManager::DecreaseIndentationLevel() * * @uses HTPPS_TagManager::$IndentationLevel */ final public function DecreaseIndentationLevel($Amount=1) { // Subtract from the indentation level, ensuring the value is // nonnegative. $this->IndentationLevel -= max(intval($Amount), 0); } /** * @see HTPPS_iTagManager::SetIndentationLevel() * * @uses HTPPS_TagManager::$IndentationLevel */ final public function SetIndentationLevel($IndentationLevel) { // Set the indentation level, ensuring the value is nonnegative. $this->IndentationLevel = max(intval($IndentationLevel), 0); } /** * @see HTPPS_iTagManager::CloseTag() * * @uses HTPPS_TagManager::CloseMostRecentTag() * @uses HTPPS_TagManager::CloseTagsUntilTagFound() */ public function CloseTag($EndWithNewlines=true, $SearchTag=null, $StopBeforeSearchTag=null) { // Check if there are any open tags. if (sizeof($this->TagStack) > 0) { // Check if a search tag was given. if ($SearchTag) { $this->CloseTagsUntilTagFound($SearchTag, $StopBeforeSearchTag, $EndWithNewlines); } // Else close the most-recently-opened tag. else { $this->CloseMostRecentTag($EndWithNewlines); } } } /** * @see HTPPS_iTagManager::CloseTags() * * @uses HTPPS_TagManager::CloseTag() */ final public function CloseTags($Number, $EndWithNewlines=true) { // Coerce the input to a nonnegative integer. $Number = max(intval($Number), 0); // Call CloseTags() the given number of times. for ($i = 0; $i < $Number; $i++) { $this->CloseTag($EndWithNewlines); } } /** * @see HTPPS_iTagManager::CloseTagsToDepth() * * @uses HTPPS_TagManager::CloseMostRecentTag() * @uses HTPPS_TagManager::TagDepth() */ final public function CloseTagsToDepth($TagDepth, $EndWithNewlines=true) { // Ensure the tag depth is nonnegative. $TagDepth = max(0, intval($TagDepth)); // Close tags up to the given tag depth. while ($this->TagDepth() > $TagDepth) { $this->CloseMostRecentTag($EndWithNewlines); } } /** * @see HTPPS_iTagManager::CloseTagsToDepth() * * @uses HTPPS_TagManager::$TagStackSystemTagThreshold * @uses HTPPS_TagManager::CloseTagsToDepth() */ final public function CloseAllTags($CloseSystemTags=false) { // Determine the stack-size threshold, depending on whether // system-opened tags should be closed. $tagStackThreshold = 0; if (!$CloseSystemTags) { $tagStackThreshold = $this->TagStackSystemTagThreshold; } // Close all applicable tags. $this->CloseTagsToDepth($tagStackThreshold); } /** * @see HTPPS_iTagManager::OpenComment() * * @uses HTPPS_TagManager::WriteImpl() */ final public function OpenComment() { // Write the opening. $this->Write(''); // Write any following newline. if ($EndWithNewline) { $this->WriteNewline(); } } /** * @see HTPPS_iTagManager::WriteComment() * * @uses HTPPS_TagManager::OpenComment() * @uses HTPPS_TagManager::CloseComment() * @uses HTPPS_TagManager::WriteImpl() */ final public function WriteComment($Text, $EndWithNewline=true) { // Write the opening. $this->OpenComment(); // Write the comment text. $this->WriteImpl($Text); // Write the closing. $this->CloseComment($EndWithNewline); } /** * @see HTPPS_iTagManager::Write() * * @uses HTPPS_TagManager::$NewlineMostRecentlyWritten * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteIndentation() */ public function Write($Text) { // Check if a newline was most recently written. if ($this->NewlineMostRecentlyWritten) { // Write the indentation. $this->WriteIndentation(); } // Write the given text. $this->WriteImpl($Text); // Deassert the newline flag. $this->NewlineMostRecentlyWritten = false; } /** * @see HTPPS_iTagManager::WriteUnindented() * * @uses HTPPS_TagManager::WriteImpl() */ public function WriteUnindented($Text) { // Write the given text. $this->WriteImpl($Text); } /** * @see HTPPS_iTagManager::WriteNewline() * * @uses HTPPS_TagManager::$NewlineMostRecentlyWritten * @uses HTPPS_TagManager::WriteImpl() */ public function WriteNewline() { // Write a newline. // Check if no custom scribe is given. if (!($this->Scribe)) { print("\n"); } // Else use the custom scribe. else { $this->Scribe->WriteNewline(); } // Record that a newline was most recently written. $this->NewlineMostRecentlyWritten = true; } /** * @see HTPPS_iTagManager::ClearLine() * * @uses HTPPS_TagManager::$NewlineMostRecentlyWritten * @uses HTPPS_TagManager::WriteNewline() */ final public function ClearLine() { // Check if a newline was not most recently written. if (!($this->NewlineMostRecentlyWritten)) { $this->WriteNewline(); } } /** * @see HTPPS_iTagManager::SkipLine() * * @uses HTPPS_TagManager::ClearLine() * @uses HTPPS_TagManager::WriteNewline() */ final public function SkipLine($Number=1) { // Ensure this function starts with a clear line. $this->ClearLine(); // Skip a number of lines. for ($i = 0; $i < $Number; $i++) { $this->WriteNewline(); } } /** * @see HTPPS_iTagManager::WriteAndEscape() * * @uses HTPPS_TagManager::EscapeForMarkup() * @uses HTPPS_TagManager::Write() */ final public function WriteAndEscape($Text) { $this->Write($this->EscapeForMarkup($Text)); } /** * @see HTPPS_iTagManager::WriteBlock() * * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteNewline() */ final public function WriteBlock($Text) { $this->WriteNewline(); $this->WriteImpl($Text); $this->WriteNewline(); } /** * @see HTPPS_iTagManager::WriteBlockIndented() * * @uses HTPPS_TagManager::Write() * @uses HTPPS_TagManager::WriteNewline() */ final public function WriteBlockIndented(array $TextLines) { // Write an initial newline. $this->WriteNewline(); // Write each text line, followed by a newline. foreach ($TextLines as $textLine) { $this->Write($textLine); $this->WriteNewline(); } } /** * @see HTPPS_iTagManager::BeginDocumentContentTags() * * @uses HTPPS_TagManager::$TagStackSystemTagThreshold * @uses HTPPS_TagManager::TagDepth() */ public function BeginDocumentContentTags() { $this->TagStackSystemTagThreshold = $this->TagDepth(); } /** * @see HTPPS_iTagManager::IsXML() * * @uses HTPPS_TagManager::MarkupLanguageCode() */ final public function IsXML() { return (($this->MarkupLanguageCode() & HTPPS_LanguageCode_XML) > 0) || (($this->MarkupLanguageCode() & HTPPS_LanguageCode_XHTML) > 0); } /** * @see HTPPS_iTagManager::IsHTML() * * @uses HTPPS_TagManager::MarkupLanguageCode() */ final public function IsHTML() { return (($this->MarkupLanguageCode() & HTPPS_LanguageCode_HTML) > 0); } } // End class HTPPS_TagManager /** * Provides access to an XML tag manager, which generically manages tags of * XHTML or XML documents, including their being written to output in a pretty * manner. * * An XML tag manager will ensure that tags are written according to XML * syntax, and it provides functions specific to writing the tags of an XML * document. * * @package HTPPS * @subpackage TagManagers */ interface HTPPS_iXMLTagManager extends HTPPS_iTagManager { /** * Sets the mapping between search strings and replacement strings that is * used to escape text for XML. * * This should probably not be exposed to all parts of the application, so * an override may want to seal off access to the implementation. * * @param SearchesAndReplacements array * Array of strings; associative, with the keys as the search strings * and the values as replacement strings. * * @return void */ public function SetMarkupEscapeTranslations(array $SearchesAndReplacements); /** * Writes an XML processing instruction that has a format similar to a * regular XML tag, in that it contains pseudo-attributes. * * This does not indent the instruction and writes a newline afterwards. * * @param Target string * The target of the procsesing instruction (e.g. 'xml'). * @param PseudoAttributes array * The array of pseudo-attributes; associative, with the keys as the * pseudo-attribute names and the values as the pseudo-attribute values. * The values will not be escaped according to the markup language when * they are written, though they will be escaped for double quotes. * @param OnePseudoAttributePerLine bool * Dictates whether the pseudo-attributes will be written with one * pseudo-attribute per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all pseudo-attributes. If this is given, * it is written following a space, and it is not escaped according to * the markup language. * * @return void */ public function WriteProcessingInstruction($Target, array $PseudoAttributes=array(), $OnePseudoAttributePerLine=false, $ExtraString=null); /** * Opens a CDATA section. * * Opening a tag via OpenTag, directly or indirectly, results in undefined * behavior when inside of a CDATA section. * * @param EndWithNewline bool * Dictates whether a newline will be written after the CDATA opening. * If so, there will also be an increase in indentation. * * @return void */ public function OpenCDATA($EndWithNewline=true); /** * Closes a CDATA section. * * @param EndWithNewline bool|null * Dictates whether a newline will be written after the CDATA closing. * If this is null, then a newline will be written if it was written * for the CDATA opening; in this case, the indentation level will also * be decremented. * * @return void */ public function CloseCDATA($EndWithNewline=true); /** * Writes text within a CDATA section. * * @param Text string * The text to write within the CDATA section. * @param EndWithNewline bool * Dictates whether a newline will be written after the CDATA. * * @return void */ public function WriteCDATA($Text, $EndWithNewline=false); } // End interface HTPPS_iXMLTagManager /** * The abstract base class of all XML tag managers, which generically manage * tags of XHTML or XML documents, including their being written to output in a * pretty manner. * * An XML tag manager will ensure that tags are written according to XML * syntax, and it provides functions specific to writing the tags of an XML * document. * * @package HTPPS * @subpackage TagManagers */ abstract class HTPPS_XMLTagManager extends HTPPS_TagManager implements HTPPS_iXMLTagManager { //PRIVATE & PROTECTED DATA ////////////////////////// /** * Whether the most-recently-opened CDATA caused an increase in indentation. * * This is false if a CDATA is not open. * * @var bool */ private $CDATAIncreasedIndentation; /** * The array of search strings used in a search=>replacement algorithm for * escaping text according to XML. * * This is a parallel array with $MarkupEscapeReplacementStrings. * * @var array * Array of strings. * * @see HTPPS_XMLTagManager::$MarkupEscapeReplacementStrings */ private $MarkupEscapeSearchStrings; /** * The array of replacement strings used in a search=>replacement algorithm * for escaping text according to XML. * * This is a parallel array with $MarkupEscapeSearchStrings. * * @var array * Array of strings. * * @see HTPPS_XMLTagManager::$MarkupEscapeSearchStrings */ private $MarkupEscapeSearchReplacements; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Returns whether the markup language requires a slash in an empty tag. * * @return bool */ protected function SlashInEmptyTag() { return true; } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param IndentationString string * The string used for each individual indentation. * @param InitialMaxIndentationLevel integer * The depth of indentation strings to prepare initially; this is a * string-building optimization that prepares indentation strings of * several lengths to correspond with indentation levels. This need * only be nonnegative. * @param Scribe HTPPS_iScribe|null * The scribe to use, or null to induce default behavior. * * @uses HTPPS_TagManager::__construct() * @uses HTPPS_XMLTagManager::$CDATAIncreasedIndentation * @uses HTPPS_XMLTagManager::SetMarkupEscapeTranslations() */ public function __construct($IndentationString =self::DefaultIndentationString, $InitialMaxIndentationLevel =self::DefaultInitialMaxIndentationLevel, HTPPS_iScribe $Scribe=null) { // Call the parent constructor. parent::__construct($IndentationString, $InitialMaxIndentationLevel, $Scribe); // Initialize object-scope data. $this->CDATAIncreasedIndentation = false; // Build the parallel arrays of search and replacement strings. // The search & replace is apparently done in serial, so the order // matters. $this->SetMarkupEscapeTranslations(array('/&/'=>'&', '/'<', '/>/'=>'>', '/"/'=>'"', "/'/"=>"'")); } /** * Destructor. * * @uses HTPPS_TagManager::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::EscapeForMarkup() * * @uses HTPPS_XMLTagManager::$MarkupEscapeSearchStrings * @uses HTPPS_XMLTagManager::$MarkupEscapeSearchReplacements */ public function EscapeForMarkup($Text) { // Make the replacement and return the result. return preg_replace($this->MarkupEscapeSearchStrings, $this->MarkupEscapeSearchReplacements, $Text); } /** * @see HTPPS_iXMLTagManager::SetMarkupEscapeTranslations() * * @uses HTPPS_XMLTagManager::$MarkupEscapeSearchStrings * @uses HTPPS_XMLTagManager::$MarkupEscapeSearchReplacements */ public function SetMarkupEscapeTranslations(array $SearchesAndReplacements) { // Set the object-scope data. $this->MarkupEscapeSearchStrings = array_keys($SearchesAndReplacements); $this->MarkupEscapeSearchReplacements = array_values($SearchesAndReplacements); } /** * @see HTPPS_iXMLTagManager::WriteProcessingInstruction() * * @uses HTPPS_TagManager::Write * @uses HTPPS_TagManager::WriteNewline * @uses HTPPS_TagManager::EscapeForQuotes */ public function WriteProcessingInstruction($Target, array $PseudoAttributes=array(), $OnePseudoAttributePerLine=false, $ExtraString=null) { // Write the opening of the tag. $this->Write(' 0)) { // Rewind the array so that the first key and value may be fetched. $pseudoAttributeValue = reset($PseudoAttributes); $pseudoAttributeName = key($PseudoAttributes); // Write the first pseudo-attribute's name and value. $this->Write(' '.$pseudoAttributeName.'="'); $this->Write($this->EscapeForQuotes($pseudoAttributeValue)); $this->Write('"'); // Build a string of spaces that will help pad each pseudo-attribute //so that it is flush left with the first one. $pseudoAttributeLeftPadding = $Target; for ($i = 0; $i < strlen($Target); $i++) { $pseudoAttributeLeftPadding[$i] = ' '; } // Iterate through all remaining pseudo-attributes. while (list($pseudoAttributeName, $pseudoAttributeValue) = each($PseudoAttributes)) { // Write a newline first. $this->WriteNewline(); // Write padding so the attribute is flush left with others. $this->Write($pseudoAttributeLeftPadding); // Write the attribute's name and value. $this->Write(' '.$pseudoAttributeName.'="'); $this->Write($this->EscapeForQuotes($pseudoAttributeValue)); $this->Write('"'); } } // Handle all-attributes-on-one-line formatting. else if (sizeof($PseudoAttributes) > 0) { // Iterate through all attributes. foreach ($PseudoAttributes as $pseudoAttributeName => $pseudoAttributeValue) { $this->Write(' '.$pseudoAttributeName.'="'); $this->Write($this->EscapeForQuotes($pseudoAttributeValue)); $this->Write('"'); } } // Write any extra string. if (strlen($ExtraString) > 0) { $this->Write(' '); $this->Write($ExtraString); } // Close the tag, followed by a newline. $this->Write('?>'); $this->WriteNewline(); } /** * @see HTPPS_iXMLTagManager::OpenCDATA() * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteNewline() * @uses HTPPS_XMLTagManager::$CDATAIncreasedIndentation */ public function OpenCDATA($EndWithNewline=true) { // Write the opening of the tag. $this->Write('WriteNewline(); $this->IndentationLevel++; } // Set the flag indicating whether the CDATA increased indentation. $this->CDATAIncreasedIndentation = $EndWithNewline; } /** * @see HTPPS_iXMLTagManager::CloseCDATA() * * @uses HTPPS_TagManager::$IndentationLevel * @uses HTPPS_TagManager::WriteImpl() * @uses HTPPS_TagManager::WriteNewline() * @uses HTPPS_XMLTagManager::$CDATAIncreasedIndentation */ public function CloseCDATA($EndWithNewline=true) { // Write the closing of the tag. $this->Write(']]>'); // Write a newline if desired or if the caller deferred to default and // the opening of the CDATA was written with a newline. if ((($EndWithNewline === null) && ($this->CDATAIncreasedIndentation)) || $EndWithNewline) { $this->WriteNewline(); } // Decrease the indentation level if this CDATA increased it. if ($this->CDATAIncreasedIndentation) { $this->IndentationLevel--; } // Reset the flag indicating whether the CDATA increased indentation. $this->CDATAIncreasedIndentation = false; } /** * @see HTPPS_iXMLTagManager::WriteCDATA() * * @uses HTPPS_XMLTagManager::OpenCDATA() * @uses HTPPS_XMLTagManager::CloseCDATA() * @uses HTPPS_TagManager::WriteImpl() */ public function WriteCDATA($Text, $EndWithNewline=false) { // Open the CDATA section. $this->OpenCDATA(false); // Write the text (character data). $this->Write($Text); // Close the CDATA section and write a newline. $this->CloseCDATA(true); } /** * @see HTPPS_iTagManager::OpenDocumentTags() * * @param XMLVersion string * The XML version as it is to be printed in the processing instruction. * * @param ContentEncoding string * The content encoding as it is to be printed in the processing * instruction. */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null, $XMLVersion=null, $ContentEncoding=null) { //Write the XML processing instruction. $this->WriteProcessingInstruction('xml', array('version'=>$XMLVersion, 'encoding'=>$ContentEncoding)); // Open the root element. $this->OpenTag($RootElementTag, true, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } /** * @see HTPPS_iTagManager::CloseDocumentTags() */ public function CloseDocumentTags() { $this->CloseAllTags(true); } /** * @see HTPPS_iTagManager::MarkupLanguageCode() * * @uses HTPPS_LanguageCode_XML */ public function MarkupLanguageCode() { return intval(HTPPS_LanguageCode_XML); } /** * @see HTPPS_iTagManager::MarkupLanguageName() */ public function MarkupLanguageName() { return 'XML'; } /** * @see HTPPS_iTagManager::MarkupLanguage() * * @uses HTPPS_XMLTagManager::MarkupLanguageName() * @uses HTPPS_XMLTagManager::MarkupLanguageVersion() */ public function MarkupLanguage() { return $this->MarkupLanguageName().' '.$this->MarkupLanguageVersion(); } } // End class HTPPS_XMLTagManager /** * Provides access to a tag manager for XML 1.0 documents. * * @package HTPPS * @subpackage TagManagers */ interface HTPPS_iXMLv10TagManager extends HTPPS_iXMLTagManager { } // End interface HTPPS_iXMLv10TagManager /** * A tag manager for XML 1.0 documents. * * @package HTPPS * @subpackage TagManagers */ class HTPPS_XMLv10TagManager extends HTPPS_XMLTagManager implements HTPPS_iXMLv10TagManager { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param IndentationString string * The string used for each individual indentation. * @param InitialMaxIndentationLevel integer * The depth of indentation strings to prepare initially; this is a * string-building optimization that prepares indentation strings of * several lengths to correspond with indentation levels. This need * only be nonnegative. * @param Scribe HTPPS_iScribe|null * The scribe to use, or null to induce default behavior. * * @uses HTPPS_XMLTagManager::__construct() */ public function __construct($IndentationString =self::DefaultIndentationString, $InitialMaxIndentationLevel =self::DefaultInitialMaxIndentationLevel, HTPPS_iScribe $Scribe=null) { parent::__construct($IndentationString, $InitialMaxIndentationLevel, $Scribe); } /** * Destructor. * * @uses HTPPS_XMLTagManager::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion() */ public function MarkupLanguageVersion() { return '1.0'; } /** * @see HTPPS_iTagManager::MarkupLanguageDialect() */ public function MarkupLanguageDialect() { return ''; } } // End class HTPPS_XMLv10TagManager /** * Provides access to an HTML tag manager, which generically manages tags of * HTML documents, including their being written to output in a pretty manner. * * An HTML tag manager will ensure that tags are written according to HTML * syntax, and it provides functions specific to writing the tags of an HTML * document. * * @package HTPPS * @subpackage TagManagers */ interface HTPPS_iHTMLTagManager extends HTPPS_iTagManager { } // End interface HTPPS_iHTMLTagManager /** * The abstract base class of all HTML tag managers, which manage tags of HTML * documents, including their being written to output in a pretty manner. * * An HTML tag manager will ensure that tags are written according to HTML * syntax, and it provides functions specific to writing the tags of an HTML * document. * * @package HTPPS * @subpackage TagManagers */ abstract class HTPPS_HTMLTagManager extends HTPPS_TagManager implements HTPPS_iHTMLTagManager { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param IndentationString string * The string used for each individual indentation. * @param InitialMaxIndentationLevel integer * The depth of indentation strings to prepare initially; this is a * string-building optimization that prepares indentation strings of * several lengths to correspond with indentation levels. This need * only be nonnegative. * @param Scribe HTPPS_iScribe|null * The scribe to use, or null to induce default behavior. * * @uses HTPPS_TagManager::__construct() */ public function __construct($IndentationString =self::DefaultIndentationString, $InitialMaxIndentationLevel =self::DefaultInitialMaxIndentationLevel, HTPPS_iScribe $Scribe=null) { parent::__construct($IndentationString, $InitialMaxIndentationLevel, $Scribe); } /** * Destructor. * * @uses HTPPS_TagManager::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::EscapeForMarkup() */ public function EscapeForMarkup($Text) { // Return the entity translation, without affecting quotes, since they // will be transformed by the caller of this function. return htmlentities($Text, ENT_NOQUOTES); } /** * @see HTPPS_iTagManager::OpenDocumentTags() */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { // Open the root element. $this->OpenTag($RootElementTag, true, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } /** * @see HTPPS_iTagManager::CloseDocumentTags() */ public function CloseDocumentTags() { $this->CloseAllTags(true); } /** * @see HTPPS_iTagManager::MarkupLanguageCode() * * @uses HTPPS_LanguageCode_HTML */ public function MarkupLanguageCode() { return intval(HTPPS_LanguageCode_HTML); } /** * @see HTPPS_iTagManager::MarkupLanguageName() */ public function MarkupLanguageName() { return 'HTML'; } /** * @see HTPPS_iTagManager::MarkupLanguage() * * @uses HTPPS_HTMLTagManager::MarkupLanguageName() * @uses HTPPS_HTMLTagManager::MarkupLanguageVersion() * @uses HTPPS_HTMLTagManager::MarkupLanguageDialect() */ public function MarkupLanguage() { // Start building the language's presentational form, starting with the // name. $languagePresentation = $this->MarkupLanguageName(); // Add a version if it is available. if (strlen($this->MarkupLanguageVersion()) > 0) { $languagePresentation .= $this->MarkupLanguageVersion(); } // Add a dialect if it is available. if (strlen($this->MarkupLanguageDialect()) > 0) { $languagePresentation .= $this->MarkupLanguageDialect(); } // Return the presentational form. return $languagePresentation; } } // End class HTPPS_HTMLTagManager /** * Provides access to an HTML 4.01 tag manager. * * @package HTPPS * @subpackage TagManagers */ interface HTPPS_iHTMLv401TagManager extends HTPPS_iHTMLTagManager { } // End interface HTPPS_iHTMLv401TagManager /** * A tag manager for HTML 4.01 documents. * * @package HTPPS * @subpackage TagManagers */ class HTPPS_HTMLv401TagManager extends HTPPS_HTMLTagManager implements HTPPS_iHTMLv401TagManager { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param IndentationString string * The string used for each individual indentation. * @param InitialMaxIndentationLevel integer * The depth of indentation strings to prepare initially; this is a * string-building optimization that prepares indentation strings of * several lengths to correspond with indentation levels. This need * only be nonnegative. * @param Scribe HTPPS_iScribe|null * The scribe to use, or null to induce default behavior. * * @uses HTPPS_HTMLTagManager::__construct() */ public function __construct($IndentationString =self::DefaultIndentationString, $InitialMaxIndentationLevel =self::DefaultInitialMaxIndentationLevel, HTPPS_iScribe $Scribe=null) { parent::__construct($IndentationString, $InitialMaxIndentationLevel, $Scribe); } /** * Destructor. * * @uses HTPPS_HTMLTagManager::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion() */ public function MarkupLanguageVersion() { return '4.01'; } /** * @see HTPPS_iTagManager::MarkupLanguageDialect() */ public function MarkupLanguageDialect() { return ''; } } // End class HTPPS_HTMLv401TagManager //SUBPACKAGE: Document Schemata /////////////////////////////// /** * Provides access to a document schema, which provides information about a * schema and perhaps means of declaring it within the document. * * @package HTPPS * @subpackage DocumentSchemata */ interface HTPPS_iDocumentSchema { /** * Represents a schema language choice of DTD within the context of a * document. * * This should be converted to an integer prior to use. */ const SchemaLanguage_DTD = 0x100; /** * Represents a schema language choice of XSD within the context of a * document. * * This should be converted to an integer prior to use. */ const SchemaLanguage_XSD = 0x200; /** * Represents a schema language choice of RELAX NG within the context of a * document. * * This should be converted to an integer prior to use. */ const SchemaLanguage_RELAXNG = 0x400; } // End interface HTPPS_iDocumentSchema //TODO com class HTPPS_DocumentSchema_DTD implements HTPPS_iDocumentSchema { } // End class HTPPS_DocumentSchema_DTD //TODO compact DTD? //TODO com class HTPPS_DocumentSchema_XSD implements HTPPS_iDocumentSchema { } // End class HTPPS_DocumentSchema_XSD //TODO com class HTPPS_DocumentSchema_RELAXNG implements HTPPS_iDocumentSchema { } // End class HTPPS_DocumentSchema_RELAXNG /** * A set of schema which apply to a document, which may be heterogeneous with * respect to schema languages. * * @package HTPPS * @subpackage DocumentSchemata */ class HTPPS_DocumentSchemata { //PRIVATE & PROTECTED DATA ////////////////////////// //PUBLIC FUNCTIONS ////////////////// //TODO do } // End class HTPPS_DocumentSchemata //SUBPACKAGE: Pretty Printers ///////////////////////////// /** * Provides access to a pretty printer. * * The pretty printer interacts directly with the application, and at this * level of abstraction, the pretty printer may write HTML, XML, or XHTML. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iPrettyPrinter extends HTPPS_iTagManager { /** * Accessor and mutator for the tag manager of the pretty printer. * * If the parameter is given, it is taken as a replacement tag manager; the * reference to the old tag manager will be unset, and the new tag manager * will be used immediately. * * @param TagManager null|HTPPS_iTagManager * The new tag manager, or null. If it is null, this function acts as * an accessor; else it acts as a mutator. * * @return HTPPS_iTagManger * The current tag mangaer, if this is an accessor call, or the new tag * manager, if this is a mutator call. */ public function TagManager(HTPPS_iTagManager $TagManager=null); /** * Mutator for the tag manager of the pretty printer. * * The reference to the old tag manager will be unset, and the new tag * manager will be used immediately. * * This is a sort of alias for TagManager(). * * @see HTPPS_iPrettyPrinter::TagManager() * * @param TagManager HTPPS_iTagManager * The new tag manager. * * @return void */ public function SetTagManager(HTPPS_iTagManager $TagManager); /** * Writes an element, including its opening tag, contents, and its closing * tag. * * The contents of this element should be simple text - i.e. there should * be no tags inside the text. * * @param Tag string * The tag string, which will not be specially processed. * @param WriteNewlineAfterOpening bool * Dictates whether a newline will be written after the tag opening, in * which case the level of indentation would also be increased. * @param WriteNewlineAfterClosing bool * Dictates whether a newline will be written after the tag closing. * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteTagAndContents($Tag, $WriteNewlineAfterOpening, $WriteNewlineAfterClosing, $Text, $EscapeText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Declares the document's schemata, then opens the document's root tag and * any other tags necessary to begin writing the principal document. * * This shall make any declarations of language type, language version, or * encoding type which are required by the markup language to appear before * the document's principal tags. * * @param Schemata HTPPS_DocumentSchemata * The schemata of the document. * @param RootElementTag string * The tag of the root element of the document. * @param RootElementAttributes array * The array of attributes for the root element of the document; * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. These may be ignorant of the * schemata. * @param RootElementOneAttributePerLine bool * Dictates whether the attributes of the root element will be written * with one attribute per line; if so, they will be aligned flush left. * @param RootElementExtraString string * Written inside the root-element tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function OpenDocument(HTPPS_DocumentSchemata $Schemata, $RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null); /** * Closes the writing of the document's root tag and any other tags * necessary to end writing the document completely. * * @return void */ public function CloseDocument(); /** * Returns an indication of whether the document is open - i.e. whether the * root tag is still open. * * @return bool * Whether the document is open. */ public function DocumentIsOpen(); /** * Returns an indication of whether the markup language of the pretty * printer is XHTML. * * @return bool */ public function IsXHTML(); } // End interface HTPPS_iPrettyPrinter /** * The abstract base class of all pretty printers. * * The pretty printer interacts directly with the application, and at this * level of abstraction, the pretty printer may write HTML, XML, or XHTML. This * class primarily serves to declare the tag manager and relay method calls to * the tag manager. Though using magic methods would be a more * theoretically-complete and robust solution, it would incur undue cost at * runtime. * * @package HTPPS * @subpackage PrettyPrinters */ abstract class HTPPS_PrettyPrinter implements HTPPS_iPrettyPrinter { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The tag manager. * * @var HTPPS_TagManager */ protected $Tags; //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param TagManager HTPPS_iTagManager * The tag manager to use in initialization. The tag manager will not * be initialized. * * @uses HTPPS_PrettyPrinter::TagManager() */ public function __construct(HTPPS_iTagManager $TagManager) { // Initialize object-scope data. $this->TagManager($TagManager); } /** * Destructor. * * @uses HTPPS_PrettyPrinter::CloseDocument() */ public function __destruct() { $this->CloseDocument(); } /** * @see HTPPS_iTagManager::SetScribe() * * @uses HTPPS_PrettyPrinter::$Tags */ public function SetScribe(HTPPS_iScribe $Scribe) { return $this->Tags->SetScribe($Scribe); } /** * @see HTPPS_iTagManager::ResetScribe() * * @uses HTPPS_PrettyPrinter::$Tags */ public function ResetScribe() { return $this->Tags->ResetScribe(); } /** * @see HTPPS_iTagManager::EscapeForMarkup() */ public function EscapeForMarkup($Text) { return $this->Tags->EscapeForMarkup($Text); } /** * @see HTPPS_iTagManager::EscapeForQuotes() */ public function EscapeForQuotes($Text, $QuoteCharacter='"') { return $this->Tags->EscapeForQuotes($Text, $QuoteCharacter); } /** * @see HTPPS_iTagManager::OpenTag() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->Tags->OpenTag($Tag, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iTagManager::WriteEmptyTag() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteEmptyTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->Tags->WriteEmptyTag($Tag, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iTagManager::MostRecentTag() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MostRecentTag() { return $this->Tags->MostRecentTag(); } /** * @see HTPPS_iTagManager::TagDepth() * * @uses HTPPS_PrettyPrinter::$Tags */ public function TagDepth() { return $this->Tags->TagDepth(); } /** * @see HTPPS_iTagManager::IncreaseIndentationLevel() * * @uses HTPPS_PrettyPrinter::$Tags */ public function IncreaseIndentationLevel($Amount=1) { return $this->Tags->IncreaseIndentationLevel($Amount); } /** * @see HTPPS_iTagManager::DecreaseIndentationLevel() * * @uses HTPPS_PrettyPrinter::$Tags */ public function DecreaseIndentationLevel($Amount=1) { return $this->Tags->DecreaseIndentationLevel($Amount); } /** * @see HTPPS_iTagManager::SetIndentationLevel() * * @uses HTPPS_PrettyPrinter::$Tags */ public function SetIndentationLevel($IndentationLevel) { return $this->Tags->SetIndentationLevel($IndentationLevel); } /** * @see HTPPS_iTagManager::CloseTag() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseTag($EndWithNewlines=true, $SearchTag=null, $StopBeforeSearchTag=null) { return $this->Tags->CloseTag($EndWithNewlines, $SearchTag, $StopBeforeSearchTag); } /** * @see HTPPS_iTagManager::CloseTags() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseTags($Number, $EndWithNewlines=true) { return $this->Tags->CloseTags($Number, $EndWithNewlines); } /** * @see HTPPS_iTagManager::CloseTagsToDepth() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseTagsToDepth($TagDepth, $EndWithNewlines=true) { return $this->Tags->CloseTagsToDepth($TagDepth, $EndWithNewlines); } /** * @see HTPPS_iTagManager::CloseTagsToDepth() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseAllTags($CloseSystemTags=false) { return $this->Tags->CloseAllTags($CloseSystemTags); } /** * @see HTPPS_iTagManager::OpenComment() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenComment() { return $this->Tags->OpenComment(); } /** * @see HTPPS_iTagManager::CloseComment() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseComment($EndWithNewline=true) { return $this->Tags->CloseComment($EndWithNewline); } /** * @see HTPPS_iTagManager::WriteComment() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteComment($Text, $EndWithNewline=true) { return $this->Tags->WriteComment($Text, $EndWithNewline); } /** * @see HTPPS_iTagManager::Write() * * @uses HTPPS_PrettyPrinter::$Tags */ public function Write($Text) { return $this->Tags->Write($Text); } /** * @see HTPPS_iTagManager::WriteUnindented() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteUnindented($Text) { return $this->Tags->WriteUnindented($Text); } /** * @see HTPPS_iTagManager::WriteNewline() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteNewline() { return $this->Tags->WriteNewline(); } /** * @see HTPPS_iTagManager::ClearLine() * * @uses HTPPS_PrettyPrinter::$Tags */ public function ClearLine() { return $this->Tags->ClearLine(); } /** * @see HTPPS_iTagManager::SkipLine() * * @uses HTPPS_PrettyPrinter::$Tags */ public function SkipLine($Number=1) { return $this->Tags->SkipLine($Number); } /** * @see HTPPS_iTagManager::WriteAndEscape() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteAndEscape($Text) { return $this->Tags->WriteAndEscape($Text); } /** * @see HTPPS_iTagManager::WriteBlock() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteBlock($Text) { return $this->Tags->WriteBlock($Text); } /** * @see HTPPS_iTagManager::WriteBlockIndented() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteBlockIndented(array $TextLines) { return $this->Tags->WriteBlockIndented($TextLines); } /** * @see HTPPS_iTagManager::BeginDocumentContentTags() * * @uses HTPPS_PrettyPrinter::$Tags */ public function BeginDocumentContentTags() { return $this->Tags->BeginDocumentContentTags(); } /** * @see HTPPS_iTagManager::IsXML() * * @uses HTPPS_PrettyPrinter::$Tags */ public function IsXML() { return $this->Tags->IsXML(); } /** * @see HTPPS_iTagManager::IsHTML() * * @uses HTPPS_PrettyPrinter::$Tags */ public function IsHTML() { return $this->Tags->IsHTML(); } /** * @see HTPPS_iTagManager::OpenDocumentTags() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { return $this->Tags->OpenDocumentTags($RootElementTag, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } /** * @see HTPPS_iTagManager::CloseDocumentTags() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseDocumentTags() { return $this->Tags->CloseDocumentTags(); } /** * @see HTPPS_iTagManager::MarkupLanguageCode() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MarkupLanguageCode() { return $this->Tags->MarkupLanguageCode(); } /** * @see HTPPS_iTagManager::MarkupLanguageName() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MarkupLanguageName() { return $this->Tags->MarkupLanguageName(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MarkupLanguageVersion() { return $this->Tags->MarkupLanguageVersion(); } /** * @see HTPPS_iTagManager::MarkupLanguage() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MarkupLanguage() { return $this->Tags->MarkupLanguage(); } /** * @see HTPPS_iPrettyPrinter::TagManager() * * @uses HTPPS_PrettyPrinter::$Tags */ public function TagManager(HTPPS_iTagManager $TagManager=null) { // Check if a new tag manager is given. if ($TagManager) { $this->Tags = $TagManager; } // Return the most current tag manager. return $this->Tags; } /** * @see HTPPS_iPrettyPrinter::SetTagManager() * * @uses HTPPS_PrettyPrinter::TagManager() */ public function SetTagManager(HTPPS_iTagManager $TagManager) { $this->TagManager($TagManager); } /** * @see HTPPS_iPrettyPrinter::WriteTagAndContents() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteAndEscape() */ final public function WriteTagAndContents($Tag, $WriteNewlineAfterOpening, $WriteNewlineAfterClosing, $Text, $EscapeText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenTag($Tag, $WriteNewlineAfterOpening, $Attributes, $OneAttributePerLine, $ExtraString); // Write the contents, optionally escaped. if ($EscapeText) { $this->WriteAndEscape($Text); } else { $this->Write($Text); } // Close the tag. $this->CloseTag($WriteNewlineAfterClosing); } /** * @see HTPPS_iPrettyPrinter::DocumentIsOpen() * * @uses HTPPS_PrettyPrinter::TagDepth() */ public function DocumentIsOpen() { return ($this->TagDepth() > 0); } /** * @see HTPPS_iPrettyPrinter::IsXHTML() * * @uses HTPPS_PrettyPrinter::$Tags */ public function IsXHTML() { return (($this->MarkupLanguageCode() & HTPPS_LanguageCode_XHTML) > 0); } //TODO: Flesh these out so that they take (use) schemata information. public function OpenDocument(HTPPS_DocumentSchemata $Schemata, $RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { $this->OpenTag($RootElementTag, true, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); // TODO adapt $this->MarkupLanguageDialect = 'Strict'; } public function CloseDocument() { $this->CloseAllTags(true); } } // End class HTPPS_PrettyPrinter /** * Provides access to an XML pretty printer. * * The pretty printer interacts directly with the application. XML pretty * printers write only XML documents. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iXMLPP extends HTPPS_iPrettyPrinter, HTPPS_iXMLTagManager { } // End interface HTPPS_iXMLPP /** * The abstract base class of all XML pretty printers. * * The pretty printer interacts directly with the application. XML pretty * printers write only XML documents. * * @package HTPPS * @subpackage PrettyPrinters */ abstract class HTPPS_XMLPP extends HTPPS_PrettyPrinter implements HTPPS_iXMLPP { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param TagManager HTPPS_iTagManager * The tag manager to use in initialization. The tag manager will not * be initialized. * * @uses HTPPS_PrettyPrinter::__construct() */ public function __construct(HTPPS_iTagManager $TagManager) { parent::__construct($TagManager); } /** * Destructor. * * @uses HTPPS_PrettyPrinter::__destruct() */ public function __destruct() { parent::__destruct(); } /** * This does nothing, as it seals off access to the potentially dangerous * implementation. * * @see HTPPS_iXMLTagManager::SetMarkupEscapeTranslations() */ public function SetMarkupEscapeTranslations(array $SearchesAndReplacements) { } /** * @see HTPPS_iXMLTagManager::WriteProcessingInstruction() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteProcessingInstruction($Target, array $PseudoAttributes=array(), $OnePseudoAttributePerLine=false, $ExtraString=null) { return $this->Tags->WriteProcessingInstruction ($Target, $PseudoAttributes, $OnePseudoAttributePerLine, $ExtraString); } /** * @see HTPPS_iXMLTagManager::OpenCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenCDATA($EndWithNewline=true) { return $this->Tags->OpenCDATA($EndWithNewline); } /** * @see HTPPS_iXMLTagManager::CloseCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseCDATA($EndWithNewline=true) { return $this->Tags->CloseCDATA($EndWithNewline); } /** * @see HTPPS_iXMLTagManager::WriteCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteCDATA($Text, $EndWithNewline=false) { return $this->Tags->WriteCDATA($Text, $EndWithNewline); } /** * @see HTPPS_iTagManager::OpenDocumentTags() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null, $XMLVersion=null, $ContentEncoding=null) { return $this->Tags->OpenDocumentTags($RootElementTag, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString, $XMLVersion, $ContentEncoding); } /** * @see HTPPS_iTagManager::MarkupLanguageDialect() * * @uses HTPPS_PrettyPrinter::$Tags */ public function MarkupLanguageDialect() { return $this->Tags->MarkupLanguageDialect(); } } // End class HTPPS_XMLPP /** * Provides access to an XML 1.0 pretty printer. * * The pretty printer interacts directly with the application. XML 1.0 pretty * printers write only XML 1.0 documents. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iXMLv10PP extends HTPPS_iPrettyPrinter, HTPPS_iXMLv10TagManager { } // End interface HTPPS_iXMLv10PP /** * The abstract base class of all XML pretty printers. * * The pretty printer interacts directly with the application. XML pretty * printers write only XML documents. * * @package HTPPS * @subpackage PrettyPrinters */ class HTPPS_XMLv10PP extends HTPPS_XMLPP implements HTPPS_iXMLv10PP { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param TagManager HTPPS_iTagManager * The tag manager to use in initialization. The tag manager will not * be initialized. * * @uses HTPPS_XMLPP::__construct() */ public function __construct(HTPPS_iTagManager $TagManager) { parent::__construct($TagManager); } /** * Destructor. * * @uses HTPPS_XMLPP::__destruct() */ public function __destruct() { parent::__destruct(); } } // End class HTPPS_XMLv10PP /** * Provides access to a Web page pretty printer. * * The pretty printer interacts directly with the application. Web page pretty * printers write Web pages, including common Web page elements. * * All tags and attribute names written by a Web page pretty printer shall be * in lowercase unless otherwise stated. * * Most all of the tags opened by these functions may be closed with generic * tag-closing functions, such as CloseTag(), although some elements have more * specialized tag-closing functions for correctness or convenience, such as * CloseJavaScript() and CloseTable(). * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iWebPagePP extends HTPPS_iPrettyPrinter { //HTTP FUNCTIONS //////////////// /** * Writes an HTTP/1.1 status code for the response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param StatusCode integer * The code number of the status. * @param ReasonPhrase string|null * The reason phrase which accompanies the code number, or null, in * which case the associated reason phrase from the HTTP/1.1 standard * will be used. * * @return void */ public function WriteHTTPResponseCode($StatusCode, $ReasonPhrase=null); /** * Writes an HTTP response header. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Name string * The name of the HTTP header. * @param Value string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * @param ReplaceExisting bool * Dictates whether the given header value will replace any existing * value for the same header. * @param StatusCode integer|null * The HTTP/1.1 response status code to accompany the header, or null, * in which case no status code will be written here. * * @return void */ public function WriteHTTPResponseHeader($Name, $Value, $ReplaceExisting=true, $StatusCode=null); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Directive string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_CacheControl($Directive); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * common "public" value. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @return void */ public function WriteHTTPResponse_CacheControl_Public(); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * common "private" value. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @return void */ public function WriteHTTPResponse_CacheControl_Private(); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * common "must-revalidate" value. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @return void */ public function WriteHTTPResponse_CacheControl_MustRevalidate(); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * common "no-cache" value. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @return void */ public function WriteHTTPResponse_CacheControl_NoCache(); /** * Writes the 'Cache-Control' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * common "no-store" value. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @return void */ public function WriteHTTPResponse_CacheControl_NoStore(); /** * Writes the 'Content-Type' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Type string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_ContentType($Type); /** * Writes the 'Content-Encoding' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Encoding string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_ContentEncoding($Encoding); /** * Writes the 'Content-Language' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param LanguageCodes string * A comma-separated list of language codes to be used as the value of * the header. * * @return void */ public function WriteHTTPResponse_ContentLanguage($LanguageCodes); /** * Writes the 'Content-Length' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param LengthInBytes integer * The value of the HTTP header. * * @return void */ public function WriteHTTPResponse_ContentLength($LengthInBytes); /** * Writes the 'Content-Disposition' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Disposition string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_ContentDisposition($Disposition); /** * Writes the 'Content-Disposition' HTTP response header, overwriting any * previous value for the header in this same response; this writes a value * of 'attachment' and allows for more parameters that characterize the * file. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Filename string * The value of the file as it will appear to the client. This will be * double-quoted in the output, to be more compatible with popular * browsers, and it will appear on its own header line. * @param CreationDate string|null * The date at which the file was purportedly, in RFC 822 date-time * format; e.g. "Sun, 14 Aug 2005 16:13:03 UTC". This will be written * on a line with ModificationDate. If this is null, no indication of a * creation date will be given. * @param ModificationDate string|null * The date at which the file was purportedly last modified, in RFC 822 * date-time format; e.g. "Sun, 14 Aug 2005 16:13:03 UTC". This will be * written on a line with CreationDate. If this is null, no indication * of a modification date will be given. * @param SizeInBytes integer|null * The size of the file in bytes. This will be written on its own line. * If this is null, no indication of a size will be given. * * @return void */ public function WriteHTTPResponse_ContentDisposition_Attachment($Filename, $CreationDate=null, $ModificationDate=null, $SizeInBytes=null); /** * Writes the 'Content-Description' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Description string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_ContentDescription($Description); /** * Writes the 'ETag' HTTP response header, overwriting any previous value * for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param ETag string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_ETag($ETag); /** * Writes the 'Expires' HTTP response header, overwriting any previous * value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Date string * The date in RFC 1123 date format; * e.g. "Thu, 01 Dec 1994 16:00:00 GMT". * * @return void */ public function WriteHTTPResponse_Expires($Date); /** * Writes the 'Expires' HTTP response header, overwriting any previous * value for the header in this same response; this writes the date as the * current server time plus a given number of seconds. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param SecondsFromNow integer * The number of seconds to add to the current time, the result of * which is used as the header value. * * @return void */ public function WriteHTTPResponse_Expires_NowPlus($SecondsFromNow); /** * Writes the 'Last-Modified' HTTP response header, overwriting any * previous value for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Date string * The date in RFC 1123 date format; * e.g. "Thu, 01 Dec 1994 16:00:00 GMT". * * @return void */ public function WriteHTTPResponse_LastModified($Date); /** * Writes the 'Last-Modified' HTTP response header, overwriting any * previous value for the header in this same response; this writes the * date as the current server time minus a given number of seconds. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param SecondsAgo integer * The number of seconds to subtract from the current time, the result * of which is used as the header value. * * @return void */ public function WriteHTTPResponse_LastModified_NowMinus($SecondsAgo); /** * Writes the 'Location' HTTP response header, overwriting any previous * value for the header in this same response; this may be used to serve * a redirection response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param URI string * The URI of the redirect. * @param HTTPStatusCode integer|null * A status code to accompany the redirect, or null, in which case a * code of 302 will be sent unless others have already been sent. * * @return void */ public function WriteHTTPResponse_Location($URI, $HTTPStatusCode=null); /** * Writes the 'Pragma' HTTP response header, overwriting any previous value * for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Directive string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_Pragma($Directive); /** * Writes the 'Vary' HTTP response header, overwriting any previous value * for the header in this same response. * * This may only be called while response headers may still be written; no * text of the message body should have been written. * * @param Directive string|array * The value of the HTTP header, either given as a string or a one-line * representation or an array of strings for a multi-line one, in which * case the strings of the array should contain any desired leading * whitespace. * * @return void */ public function WriteHTTPResponse_Vary($Directive); //DOCUMENT-STRUCTURE FUNCTIONS ////////////////////////////// /** * Declares the document's schemata, then opens the document's root tag and * any other tags necessary to begin writing the principal document, * according to the default schemata and root tag of the pretty printer. * * This shall make any declarations of language type, language version, or * encoding type which are required by the markup language to appear before * the document's principal tags. * * @param RootElementAttributes array * The array of attributes for the root element of the document; * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. These may be ignorant of the * schemata. * @param RootElementOneAttributePerLine bool * Dictates whether the attributes of the root element will be written * with one attribute per line; if so, they will be aligned flush left. * @param RootElementExtraString string * Written inside the root-element tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function OpenDocumentWithDefaultSchemata(array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null); /** * Opens a document-head element. * * @return void */ public function OpenHead(); /** * Writes a META element. * * This must be called while the document-head element is open. * * @param Name string * The name of the metadata field; this is mutually exclusive with * HTTPEquiv. * @param Content string * The content - i.e. the value - of the metadata field. * @param HTTPEquiv string * The HTTP-equivalent metadata specifier; this is mutually exclusive * with Name. * @param Scheme string * The scheme that may be used to interpret Value. * * @return void */ public function WriteMeta($Name=null, $Content=null, $HTTPEquiv=null, $Scheme=null); /** * Writes a META element that declares the content type of the document. * * This must be called while the document-head element is open. * * @param MediaType string * The media type of the document, such as "text/html". * @param CharsetEncoding string * The character-set encoding of the document, such as "UTF-8". * * @return void */ public function WriteMeta_ContentType($MediaType, $CharsetEncoding); /** * Writes a META element that declares the keywords of the document. * * This must be called while the document-head element is open. * * @param Keywords string * The keywords of the document. * * @return void */ public function WriteMeta_Keywords($Keywords); /** * Writes a META element that declares the description of the document. * * This must be called while the document-head element is open. * * @param Description string * The description of the document. * * @return void */ public function WriteMeta_Description($Description); /** * Writes a META element that declares the language(s) of the document * using two-letter codes from ISO 639. * * This must be called while the document-head element is open. * * @param LanguageCodes string * The comma-separated string of two-letter language codes. * * @return void */ public function WriteMeta_Language($LanguageCodes); /** * Writes a META element that declares a directive for robots that read the * document. * * This must be called while the document-head element is open. * * @param Directive string * The robots directive. * * @return void */ public function WriteMeta_Robots($Directive); /** * Declares the default stylesheet language of the document so that it does * not need to be specified for any inline styles. * * This must be called while the document-head element is open. * * @param StyleType string|null * The media type of the default stylesheet language; if given as null, * this defaults to "text/css". * * @return void */ public function DeclareDefaultStyleLanguage($StyleType=null); /** * Declares the default scripting language of the document so that it does * not need to be specified for any inline scripts. * * This must be called while the document-head element is open. * * @param ScriptType string|null * The media type of the default scripting language; if given as null, * this defaults to "text/javascript". * * @return void */ public function DeclareDefaultScriptingLanguage($ScriptType=null); /** * Writes a document-title element. * * This must be called while the document-head element is open. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * * @return void */ public function WriteTitle($Text, $EscapeText=true); /** * Writes a LINK element, which may only occur in the document head. * * This must be called while the document-head element is open. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHeadLink(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an element in the document head that declares a link to an icon * image, commonly known as a "favicon". * * This must be called while the document-head element is open. * * @param URI string * The URI of the icon. * @param MediaType string * The media type of the icon; this defaults to no specification. * * @return void */ public function LinkToIcon($URI, $MediaType=null); /** * Writes an element in the document head that includes an external CSS * file. * * This must be called while the document-head element is open. * * @param URI string * The URI of the stylesheet. * @param Media string * The target media of the stylesheet; this defaults to no * specification. * @param StylesheetTitle string * The descriptive title of the stylehseet. * @param IsAlternateStylesheet bool * Dictates whether an attribute will be written that indicates that * this is an alternate stylesheet. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function IncludeCSS($URI, $Media=null, $StylesheetTitle=null, $IsAlternateStylesheet=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an element in the document head that includes an external * JavaScript file. * * @param URI string * The URI of the script. * @param WriteScriptType bool * Dictates whether the script's media type ("text/javascript") will be * written as an attribute; this might not be necessary if the default * script type of the document has been declared. * @param DeferExecution bool * Dictates whether an attribute will be written which signals the * browser to defer the execution of the script, which would help the * rendering time. This is likely ignored by the browser. * * @return void */ public function IncludeJavaScript($URI, $WriteScriptType=true, $DeferExecution=false); /** * Writes an element in the document head that declares a link to an RSS * feed. * * This must be called while the document-head element is open. * * @param URI string * The URI of the feed. * @param Title string * The title of the feed. * * @return void */ public function LinkToRSSFeed($URI, $Title=null); /** * Writes an element in the document head that declares a link to an Atom * feed. * * This must be called while the document-head element is open. * * @param URI string * The URI of the feed. * @param Title string * The title of the feed. * * @return void */ public function LinkToAtomFeed($URI, $Title=null); /** * Writes an element in the document head that declares the base URI of * any relative URIs in the document. * * This must be called while the document-head element is open. * * @param URI string * The base URI. * * @return void */ public function WriteURIBasePath($URI); /** * Opens a document-body element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens the body area of the document, including writing its head and * opening its body, according to common usage patterns. * * @param Title string * The title of the document. * @param IconURI string|null * The URI of the icon used for the page, known as the "favicon", or * null, in which case no icon will be linked. * @param CSSURIs array|null * Array of strings; the URIs of the CSS files to include, which will * be included in the order given and whose tags will not have any * attributes other than the URI. If this is null or an empty array, no * CSS files will be included. * @param HeadJavaScriptURIs array|null * Array of strings; the URIs of the JavaScript files to include, which * will be included after any CSS files and which will be included in * the order given. The tags will hae a script type of * "text/javascript". * @param FlushTransmissionBeforeBody bool * Dictates whether the data transmission will be flushed after before * the body tag is opened - i.e. after the head is written. * @param BodyAttributes array * The array of attributes which apply to the body; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param BodyOneAttributePerLine bool * Dictates whether the body's attributes will be written with one * attribute per line; if so, they will be aligned flush left. * @param BodyExtraString string * Written inside the body tag after all attributes. If this is given, * it is written following a space, and it is escaped according to the * markup language. * * @return void */ public function WriteHeadAndOpenBody($Title, $IconURI=null, array $CSSURIs=null, array $HeadJavaScriptURIs=null, $FlushTransmissionBeforeBody=true, array $BodyAttributes=array(), $BodyOneAttributePerLine=false, $BodyExtraString=null); //DIV & SPAN FUNCTIONS ////////////////////// /** * Opens a DIV element. * * If EndWithNewline is true, this writes a newline after the tag opening * and increases the level of indentation. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenDiv($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a DIV element, including its text content. * * This function writes a newline after the DIV. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteDiv($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a SPAN element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenSpan(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a SPAN element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteSpan($Text, $EscapeText=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); //STRUCTURED-TEXT FUNCTIONS /////////////////////////// /** * Opens a text-heading element. * * @param HeadingLevel integer|null * If applicable for the markup language, this represents a level of * importance for the heading (e.g. 1 for 'h1', 2 for 'h2', etc.). If * given as null, this reverts to a default value, which may be 1. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHeading($HeadingLevel=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a text-heading element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param HeadingLevel integer|null * If applicable for the markup language, this represents a level of * importance for the heading (e.g. 1 for 'h1', 2 for 'h2', etc.). If * given as null, this reverts to a default value, which may be 1. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHeading($Text, $EscapeText=true, $HeadingLevel=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a horizontal rule. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a line break that appears in the document rendering. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteBR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a number of non-breaking spaces. * * @param Number integer * The number of non-breaking spaces to write. * * @return void */ public function WriteNBSP($Number=1); /** * Opens a strong-text element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenStrong(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a strong-text element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteStrong($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens an emphasized-text element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenEmphasized(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an emphasized-text element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteEmphasized($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a paragraph element. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenParagraph($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a paragraph element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param PrecedeWithNewline bool * Dictates whether a newline will be written after the tag opening, * before the principal content. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteParagraph($Text, $EscapeText=true, $PrecedeWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a subscript-text element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenSubscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a subscript-text element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteSubscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a superscript-text element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenSuperscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a superscript-text element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteSuperscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens an inline-quote element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenQuote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an inline-quote element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteQuote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a blockquote element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenBlockquote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a blockquote element, including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteBlockquote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a computer-code element. * * @param ComputerLanguageName string|null * The name of the computer languge in which the code is written, or * null to provide no indication of language. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenComputerCode($ComputerLanguageName=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a computer-code element, including its text content. * * @param Text string * The text content of the element, which will be escaped according to * the markup language when it is written. * @param ComputerLanguageName string|null * The name of the computer languge in which the code is written, or * null to provide no indication of language. * @param ConvertNewlinesToBRs bool * Dictates whether newlines within the code text will be converted to * newlines visible in the rendering (i.e.
tags). If this is true, * the code will also appear as a properly-indented block within the * document. * @param PrecedeWithNewline bool * Dictates whether a newline will be written after the tag opening, * before the principal content. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteComputerCode($Text, $ComputerLanguageName=null, $ConvertNewlinesToBRs=true, $PrecedeWithNewline=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an acronym. * * @param AbbreviatedText string * The abbreviated text (e.g. the acronym letters), which will be * primarily visible in the rendering. * @param ExpandedText string * The expanded text (e.g. the acronym's full meaning), which the * browser may make available to the user. * @param EscapeAbbreviatedText bool * Dictates whether to escape the abbreviated text according to the * markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteAcronym($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a text abbreviation. * * @param AbbreviatedText string * The abbreviated text, which will be primarily visible in the * rendering. * @param ExpandedText string * The expanded text, which the browser may make available to the user. * @param EscapeAbbreviatedText bool * Dictates whether to escape the abbreviated text according to the * markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteAbbreviation($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); //LINK FUNCTIONS //////////////// /** * Opens an anchor link. * * @param Location string * The location to which the link points. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenLink($Location, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an empty anchor that can serve as a destination for intra-page * links. * * @param ID string * The ID of the anchor within the document. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteAnchor($ID, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an anchor link, including its text content. * * @param Location string * The location to which the link points. * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteLink($Location, $Text, $EscapeText=true, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); //IMAGE FUNCTIONS ///////////////// /** * Writes an image element. * * @param URI string * The URI of the image. * @param AlternateText string * The text to be displayed if the image cannot be. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteImage($URI, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an image element using Base64-encoded data for the image. * * This uses the 'data' URI scheme to inline the data. * * @param Base64Encoding string * The Base64 encoding of the image. * @param MediaType string * The media type of the image, such as "image/jpeg". * @param AlternateText string * The text to be displayed if the image cannot be. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteImageFromBase64($Base64Encoding, $ImageMediaType, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null); //LIST FUNCTIONS //////////////// /** * Opens a list-item element for use with an ordered or unordered list. * * @param EnsureProperContext bool * Dictates whether the function closes any lingering tags before * opening this element. For example, this would close tags until it * reaches an ordered or unordered list. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenListItem($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a list-item element for use with an ordered or unordered list, * including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param EnsureProperContext bool * Dictates whether the function closes any lingering tags before * opening this element. For example, this would close tags until it * reaches an ordered or unordered list. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteListItem($Text, $EscapeText=true, $EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens an unordered-list element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenUnorderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an unordered-list element, including its list items and their * text content. * * @param ListAttributes array * The array of attributes which apply to the list; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param ListOneAttributePerLine bool * Dictates whether the attributes of the list will be written with one * attribute per line; if so, they will be aligned flush left. * @param ListExtraString string * Written inside the list's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param ItemsText array * Array of strings; the text content of the list items. * @param EscapeItemsText bool * Dictates whether to escape the items' text content according to the * markup language. * @param ItemsAttributes array * The array of attributes which apply to each list item (homogeneous); * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param ItemsOneAttributePerLine bool * Dictates whether the attributes of the list items will be written * with one attribute per line; if so, they will be aligned flush left. * @param ItemsExtraString string * Written inside the list items' tags after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function WriteUnorderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null); /** * Opens an ordered-list element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenOrderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an ordered-list element, including its list items and their text * content. * * @param ListAttributes array * The array of attributes which apply to the list; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param ListOneAttributePerLine bool * Dictates whether the attributes of the list will be written with one * attribute per line; if so, they will be aligned flush left. * @param ListExtraString string * Written inside the list's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param ItemsText array * Array of strings; the text content of the list items. * @param EscapeItemsText bool * Dictates whether to escape the items' text content according to the * markup language. * @param ItemsAttributes array * The array of attributes which apply to each list item (homogeneous); * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param ItemsOneAttributePerLine bool * Dictates whether the attributes of the list items will be written * with one attribute per line; if so, they will be aligned flush left. * @param ItemsExtraString string * Written inside the list items' tags after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function WriteOrderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null); /** * Opens a definition-term element for use with a definition list. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenDefinitionListTerm(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a definition-term element for use with a definition list, * including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteDefinitionListTerm($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a definition-definition element for use with a definition list. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenDefinitionListDefinition(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a definition-definition element for use with a definition list, * including its text content. * * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteDefinitionListDefinition($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a definition-list element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenDefinitionList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a definition-list element, including its term elements, * definition elements, and their text content. * * @param ListAttributes array * The array of attributes which apply to the list; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param ListOneAttributePerLine bool * Dictates whether the attributes of the list will be written with one * attribute per line; if so, they will be aligned flush left. * @param ListExtraString string * Written inside the list's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param TermsToDefinitionsText array * Associative array of strings; the mapping of terms to their * definitions. This assumes a one-to-one mapping between terms and * definitions. * @param EscapeTermsText bool * Dictates whether to escape the terms' text content according to the * markup language. * @param TermsAttributes array * The array of attributes which apply to each term (homogeneous); * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param TermsOneAttributePerLine bool * Dictates whether the attributes of the terms will be written with * one attribute per line; if so, they will be aligned flush left. * @param TermsExtraString string * Written inside the terms' tags after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param EscapeDefinitionsText bool * Dictates whether to escape the definitions' text content according * to the markup language. * @param DefinitionsAttributes array * The array of attributes which apply to each term (homogeneous); * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param DefinitionsOneAttributePerLine bool * Dictates whether the attributes of the definitions will be written * with one attribute per line; if so, they will be aligned flush left. * @param DefinitionsExtraString string * Written inside the definitions' tags after all attributes. If this * is given, it is written following a space, and it is escaped * according to the markup language. * * @return void */ public function WriteDefinitionList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $TermsToDefinitionsText=array(), $EscapeTermsText=true, array $TermsAttributes=array(), $TermsOneAttributePerLine=false, $TermsExtraString=null, $EscapeDefinitionsText=true, array $DefinitionsAttributes=array(), $DefinitionsOneAttributePerLine=false, $DefinitionsExtraString=null); //TABLE FUNCTIONS ///////////////// /** * Opens a table element, optionally with a caption. * * @param TableAttributes array * The array of attributes which apply to the table; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param TableOneAttributePerLine bool * Dictates whether the table's attributes will be written with one * attribute per line; if so, they will be aligned flush left. * @param TableExtraString string * Written inside the table's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param CaptionText string * The text content of the caption element. * @param EscapeCaptionText bool * Dictates whether to escape the caption's text content according to * the markup language. * @param CaptionAttributes array * The array of attributes which apply to the caption; associative, * with the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param CaptionOneAttributePerLine bool * Dictates whether the caption's attributes will be written with one * attribute per line; if so, they will be aligned flush left. * @param CaptionExtraString string * Written inside the caption's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void * * @see HTPPS_iWebPagePP::CloseTable() */ public function OpenTable(array $TableAttributes=array(), $TableOneAttributePerLine=false, $TableExtraString=null, $CaptionText=null, $EscapeCaptionText=true, array $CaptionAttributes=array(), $CaptionOneAttributePerLine=false, $CaptionExtraString=null); /** * Opens a table-head element. * * Note that this must occur before the table body to assist in rendering, * as specified by the standard. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTableHead(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-foot element. * * Note that this must occur before the table body to assist in rendering, * as specified by the standard. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTableFoot(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-body element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTableBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-column-group element. * * Note that this only assists in semantic grouping for formatting purposes * and does not contain text content, directly or indirectly. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTableColumnGroup($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a table-column element. * * Note that this only assists in formatting and does not contain text * content, directly or indirectly. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteTableColumn($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-row element. * * @param EnsureProperContext bool * Dictates whether the function closes any lingering tags before * opening this element. For example, this would close tags until it * reaches a table body or table. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void * * @see HTPPS_iWebPagePP::CloseTableRow() */ public function OpenTableRow($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-cell element. * * @param ColumnSpan integer * The number of columns which this cell spans. * @param RowSpan integer * The number of rows which this cell spans. * @param EnsureProperContext bool * Dictates whether the function closes any lingering tags before * opening this element. For example, this would close tags until it * reaches a table row. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void * * @see HTPPS_iWebPagePP::CloseTableCell() */ public function OpenTableCell($ColumnSpan=null, $RowSpan=null, $EnsureProperContext=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a table-heading element. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenTableHeading($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Closes a table element, including all child elements. * * This function is a convenience and is not necessary to correctly close * the element. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * * @return void */ public function CloseTable($EndWithNewline=true); /** * Closes a table-row element, including all child elements. * * This function is a convenience and is not necessary to correctly close * the element. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * * @return void */ public function CloseTableRow($EndWithNewline=true); /** * Closes a table-cell element, including all child elements. * * This function is a convenience and is not necessary to correctly close * the element. * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * * @return void */ public function CloseTableCell($EndWithNewline=true); //FORM FUNCTIONS //////////////// /** * Opens an HTML-form element. * * @param ProcessingPageLocation string * The URI of the page which will process the form submission. * @param RequestMethod string * The method of sending the form data to the processing page; either * "GET" or "POST", case-insensitive. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm($ProcessingPageLocation, $RequestMethod, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a field-set element of an HTML form, optionally with descriptive * text. * * This can help group form controls into sets so that they may be rendered * accordingly; thus, it encompasses form controls. * * @param LegendText string * The text content of the legend element which describes the set. * @param EscapeLegendText bool * Dictates whether to escape the legend's text content according to * the markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm_FieldSet($LegendText=null, $EscapeLegendText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a text-field element of an HTML form, optionally with default * text. * * @param Name string * The name of the form control. * @param Value string * The initial text in the form control. It will be escaped according * to the markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_TextBox($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a password-text-field element of an HTML form, optionally with * default text. * * @param Name string * The name of the form control. * @param Value string * The initial text in the form control. It will be escaped according * to the markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_Password($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a multi-line-text-area element of an HTML form, optionally with * default text. * * @param Name string * The name of the form control. * @param Value string * The initial text in the form control. It will be escaped according * to the markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_TextArea($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a checkbox element of an HTML form. * * @param Name string * The name of the form control. * @param Value string * The value of the form control if it is checked. * @param Checked bool * Dictates whether the form control starts as checked. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_CheckBox($Name, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a radio-button element of an HTML form. * * @param GroupName string * The name that groups all associated radio-button controls. * @param Value string * The value of the form control if it is selected. * @param Checked bool * Dictates whether the form control starts as the selected one of its * group. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_RadioButton($GroupName, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a group of radio-button elements of an HTML form. * * @param GroupName string * The name that groups all associated radio-button controls. * @param ValuesAndLabelTexts array * Array of strings; associative, with the form-control values mapping * to their corresponding label texts. * @param CheckedValue string|null * Which value corresponds to the control that is initially checked; if * this is null, none are initially checked. * @param EscapeLabelTexts bool * Dictates whether to escape the labels' text content according to the * markup language. * @param SeparateWithLineBreaks bool * Dictates whether to separate the controls with line breaks that * appear in the rendering. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_RadioButtons($GroupName, array $ValuesAndLabelTexts, $CheckedValue=null, $EscapeLabelTexts=true, $SeparateWithLineBreaks=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a drop-down-menu element of an HTML form. * * This may not be rendered as a drop-down menu, but that is virtually * always the case. * * @param Name string * The name of the form control. * @param IsMultipleSelector bool * Determines whether the menu allows selection of multiple items. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a drop-down-menu-item-group element of an HTML form, which * includes a text label. * * This can help group form controls into sets so that they may be rendered * accordingly; thus, it encompasses form controls. * * @param LabelText string * The name of the menu-item grouping, which will be escaped according * to the markup language when it is written. * @param EscapeLabelText bool * Dictates whether to escape the label's text content according to the * markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm_DropDownMenuItemGroup($LabelText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a drop-down-menu-item element of an HTML form, which writes its * value but does write its text content. * * @param Value string * The value of the form control if it is selected. * @param Selected bool * Dictates whether the form control starts as the selected one. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm_DropDownMenuItem($Value, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a drop-down-menu-item element of an HTML form, including its * value and its text content. * * @param Value string * The value of the form control if it is selected. * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Selected bool * Dictates whether the form control starts as the selected one. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_DropDownMenuItem($Value, $Text, $EscapeText=true, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a drop-down-menu element of an HTML form, including its menu * items. * * This may not be rendered as a drop-down menu, but that is virtually * always the case. * * @param Name string * The name of the form control. * @param IsMultipleSelector bool * Determines whether the menu allows selection of multiple items. * @param ValuesAndLabelTexts array * Array of strings; associative, with the form-control values mapping * to their corresponding label texts. * @param SelectedValues string|array|null * Which value corresponds to the control that is initially selected; * if this is null, none are initially checked. If this is an array, * then all of the form-control values which occur in the array are * initially selected. * @param EscapeLabelTexts bool * Dictates whether to escape the labels' text content according to the * markup language. * @param SeparateWithLineBreaks bool * Dictates whether to separate the controls with line breaks that * appear in the rendering. * @param MenuAttributes array * The array of attributes which apply to the menu; associative, with * the keys as the attribute names and the values as the attribute * values. The values will be escaped according to the markup language * when they are written. * @param MenuOneAttributePerLine bool * Dictates whether the menu's attributes will be written with one * attribute per line; if so, they will be aligned flush left. * @param MenuExtraString string * Written inside the menu's tag after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * @param ItemsAttributes array * The array of attributes which apply to all menu items (homogenous); * associative, with the keys as the attribute names and the values as * the attribute values. The values will be escaped according to the * markup language when they are written. * @param ItemsOneAttributePerLine bool * Dictates whether the items' attributes will be written with one * attribute per line; if so, they will be aligned flush left. * @param ItemsExtraString string * Written inside the items' tags after all attributes. If this is * given, it is written following a space, and it is escaped according * to the markup language. * * @return void */ public function WriteHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $ValuesAndLabelTexts, $SelectedValue=null, $EscapeLabelTexts=true, array $MenuAttributes=array(), $MenuOneAttributePerLine=false, $MenuExtraString=null, array $ItemAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null); /** * Writes a drop-down-menu element of an HTML form, including its menu * items. * * @param Name string * The name of the form control. * @param DefaultPath string * The initial value of the file path. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_File($Name, $DefaultPath=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens a label element of an HTML form. * * @param FormControlID string|null * The ID of the form element to which this label corresponds, or null, * in which case no correspondence is indicated and the label is opened * anonymously. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenHTMLForm_Label($FormControlID=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a label element of an HTML form, including its text content. * * @param FormControlID string * The ID of the form element to which this label corresponds. * @param Text string * The text content of the element. * @param EscapeText bool * Dictates whether to escape the text content according to the markup * language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_Label($FormControlID, $Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a hidden element of an HTML form, which carries a value to the * processing page but is not evident in the rendering. * * @param Name string * The name of the data. * @param Value string * The value of the data. * * @return void */ public function WriteHTMLForm_Hidden($Name, $Value); /** * Writes a button element of an HTML form. * * @param Text string * The text content of the element. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_Button($Text, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an image-button element of an HTML form. * * @param Name string * The name of the form control. * @param ImageURI string * The URI of the image. * @param AlternateText string * The text to be displayed if the image cannot be. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_ImageButton($Name, $ImageURI, $AlternateText=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a reset-button element of an HTML form. * * @param Text string * The text to be displayed in the form control. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_Reset($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes a submit-button element of an HTML form. * * @param Text string * The text to be displayed in the form control. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteHTMLForm_Submit($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Closes the most-recently-opened HTML form and any open child elements. * * @return void */ public function CloseHTMLForm(); //EMBEDDED-CONTENT FUNCTIONS //////////////////////////// /** * Opens an object element. * * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenObject(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes parameter-to-an-object element, which should occur within an * object element. * * @param Name string * The name of the parameter. * @param Value string * The value of the parameter. * @param ValueType string|null * The "type of the value", as described by the standard, or null for * no indication of value type. * @param ContentType string * The content type of the resource indicated by Value, or null for no * indication of content type. * * @return void */ public function WriteObjectParameter($Name, $Value, $ValueType=null, $ContentType=null); /** * Embeds an external document as an object rather than an frame. * * @param URI string * The URI of the document to embed. * @param ContentType string * The media type of the document. If omitted, no indication of content * type is given. * @param AlternateText string * The text to be displayed if the document cannot be. * @param EscapeAlternateText bool * Dictates whether to escape the alternate text according to the * markup language. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function EmbedDocument($URI, $ContentType=null, $AlternateText=null, $EscapeAlternateText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Writes an iframe element. * * @param URI string * The URI of the document. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function WriteIFrame($URI, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null); /** * Opens an object element which embeds a Flash movie. * * The "movie" parameter will already be written, using the URI as a value. * * @param URI string * The URI of the Flash movie. * @param Width string * The width of the Flash movie. * @param Height string * The height of the Flash movie. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function OpenFlashEmbed($URI, $Width=null, $Height=null, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null); /** * Writes parameter-to-a-Flash-movie element, which should occur within an * object element that embeds a Flash movie. * * @param Name string * The name of the parameter. * @param Value string * The value of the parameter. * * @return void */ public function WriteFlashParameter($Name, $Value); /** * Writes an object element which embeds a Flash movie, including * parameters for the movie. * * The "movie" parameter will already be written, using the URI as a value. * * @param URI string * The URI of the Flash movie. * @param Width string * The width of the Flash movie. * @param Height string * The height of the Flash movie. * @param SWFParameters array * Array of strings; associative, with the keys as the parameter names * and the values as hte attribute values. The values will be escaped * according to the markup language when they are written. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * * @return void */ public function EmbedFlash($URI, $Width=null, $Height=null, array $SWFParameters=array(), array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null); //JAVASCRIPT FUNCTIONS ////////////////////// /** * Opens a JavaScript element, which may occur in the head or the body. * * The script will be specially escaped within the markup language if it is * prudent. Consequently, this must be closed with CloseJavaScript(). * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. If * this is true, the level of indentation will increase. * @param WriteScriptType bool * Dictates whether to write the script type as an attribute. * * @return void * * @see HTPPS_iWebPagePP::CloseJavaScript() */ public function OpenJavaScript($EndWithNewline=true, $WriteScriptType=true); /** * Closes a JavaScript element opened with OpenJavaScript(). * * @param EndWithNewline bool * Dictates whether a newline will be written after the tag closing. * * @return void * * @see HTPPS_iWebPagePP::OpenJavaScript() */ public function CloseJavaScript($EndWithNewline=true); /** * Loads JavaScript from a URI, which may occur in the head or the body. * * @param URI string * The URI of the script. * @param EndWithNewline bool * Dictates whether a newline will be written after the tag opening. If * this is true, the level of indentation will increase. * @param WriteScriptType bool * Dictates whether the script's media type ("text/javascript") will be * written as an attribute; this might not be necessary if the default * script type of the document has been declared. * @param DeferExecution bool * Dictates whether an attribute will be written which signals the * browser to defer the execution of the script, which would help the * rendering time. This is likely ignored by the browser. * * @return void */ public function LoadJavaScriptFile($URI, $EndWithNewline=true, $WriteScriptType=true, $DeferExecution=false); /** * At the end of the documenet, this loads JavaScript from a URI. * * This may be called from the head or the body, and it may be called * multiple times, in which case it will add the URI to a list of URIs to * be loaded. * * This does not use events; it writes the script tag just before the body * closes. * * The given script is only loaded if the CloseDocument() function is * called; it may not be loaded if CloseAllTags() is called or CloseTag() * is called repeatedly in order to close the document. This is an * optimization for CloseTag(). Note that in the destructor, * CloseDocument() is called. * * @param URI string * The URI of the script. * @param WriteScriptType bool * Dictates whether the script's media type ("text/javascript") will be * written as an attribute; this might not be necessary if the default * script type of the document has been declared. * @param DeferExecution bool * Dictates whether an attribute will be written which signals the * browser to defer the execution of the script, which would help the * rendering time. This is likely ignored by the browser. * * @return void */ public function LoadJavaScriptFileAtEnd($URI, $WriteScriptType=true, $DeferExecution=false); //CSS FUNCTIONS /////////////// /** * Opens a CSS element, which may only occur in the document head. * * The code will be specially escaped within the markup language if it is * prudent. Consequently, this must be closed with CloseCSS(). * * @param WriteStyleType bool * Dictates whether to write the style type as an attribute. * * @return void * * @see HTPPS_iWebPagePP::CloseCSS() */ public function OpenCSS($WriteStyleType=true); /** * Closes a CSS element. * * @return void * * @see HTPPS_iWebPagePP::OpenCSS() */ public function CloseCSS(); //NAVIGATION FUNCTIONS ////////////////////// /** * Writes JavaScript that redirects the user to the previous page in the * browsing history, optionally with a delay. * * @param DelayInSeconds double * The delay in seconds before the action. * * @return void */ public function JavaScript_GoBack($DelayInSeconds=null); /** * Writes JavaScript that redirects the user to a given location, * browsing history, optionally with a delay. * * @param DelayInSeconds double * The delay in seconds before the action. * * @return void */ public function JavaScript_Redirect($Location, $DelayInSeconds=null); //TRANSMISSION FUNCTIONS //////////////////////// /** * Flush the buffer of content; e.g. transmit all pending content to the * client. * * @return void */ public function FlushTransmission(); } // End interface HTPPS_iWebPagePP /** * The abstract base class of all Web-page pretty printers. * * The pretty printer interacts directly with the application. Web-page pretty * printers write HTML or XHTML documents. * * @package HTPPS * @subpackage PrettyPrinters */ abstract class HTPPS_WebPagePP extends HTPPS_PrettyPrinter implements HTPPS_iWebPagePP { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The dialect of the markup language in a printable format, which should * be based on the schemata; e.g. "Strict", "Basic". * * @var string */ protected $MarkupLanguageDialect; /** * The array of arrays of information for JavaScript files which shall be * loaded just before the end of the document. * * Each entry is an associative array which has the following keys: "URI", * "WriteScriptType", and "DeferExecution". * * @var array * Array of strings. */ protected $JavaScriptFilesForDocumentEnd; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Determines the tag to be used for the given heading level. * * The tag may vary between markup languages or versions thereof, so this * function is nontrivial. * * @param HeadingLevel integer|null * The heading level. If this is null, the default is used. * * @return string * The tag. */ protected function DetermineHeadingTag($HeadingLevel=null) { // If the heading level is null, assign it a default number. if ($HeadingLevel === null) { $HeadingLevel = 1; } // Coerce the heading level to a positive integer. $HeadingLevel = max(intval($HeadingLevel), 1); // Ensure the heading level is in [1,6]. $HeadingLevel = min($HeadingLevel, 6); // Return the tag. return 'h'.$HeadingLevel; } /** * Writes an input element of an HTML form. * * @param InputType string * The type of the input element, such as "text" or "radio". * @param Name string|null * The name of the form data, or null if there is no name. * @param Value string|null * The (initial) value of the form data. * @param Attributes array * The array of attributes; associative, with the keys as the attribute * names and the values as the attribute values. The values will be * escaped according to the markup language when they are written. * @param OneAttributePerLine bool * Dictates whether the attributes will be written with one attribute * per line; if so, they will be aligned flush left. * @param ExtraString string * Written inside the tag after all attributes. If this is given, it is * written following a space, and it is escaped according to the markup * language. * @param MinimizedAttributes array * The array of minimized attributes, which are written after the * attributes and before the extra string. * * @return void */ protected function WriteHTMLForm_Input($InputType, $Name=null, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null, array $MinimizedAttributes=array()) { // Build a second attributes array so that the attributes in this // function get written first. $attributes = array(); // Build an attribute for the input type. $attributes['type'] = $InputType; // Build an attribute for the input name if it is given. if ($Name) { $attributes['name'] = $Name; } // Build an attribute for the value if it is given. if ($Value) { $attributes['value'] = $Value; } // Build an extra string for the minimized attributes. $extraString = null; if ($MinimizedAttributes && (sizeof($MinimizedAttributes) > 0)) { $extraString = ''; $extraString = implode(' ', $MinimizedAttributes); } // Add a given extra string to the above one. if ($ExtraString) { // Check if an extra string has already been built. if ($extraString) { $extraString .= ' '.$ExtraString; } // Else use the given extra string as the final one. else { $extraString = $ExtraString; } } // Merge the produced attributes with those given. $attributes = array_merge($attributes, $Attributes); // Write the tag. $this->WriteEmptyTag('input', true, $attributes, $OneAttributePerLine, $extraString); } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param TagManager HTPPS_iTagManager * The tag manager to use in initialization. The tag manager will not * be initialized. * * @uses HTPPS_PrettyPrinter::__construct() * @uses HTPPS_WebPagePP::$MarkupLanguageDialect * @uses HTPPS_WebPagePP::$JavaScriptFilesForDocumentEnd */ public function __construct(HTPPS_iTagManager $TagManager) { // Call the parent constructor. parent::__construct($TagManager); // Initialize object-scope data. $this->MarkupLanguageDialect = ''; $this->JavaScriptFilesForDocumentEnd = array(); } /** * Destructor. * * @uses HTPPS_PrettyPrinter::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponseCode() */ public function WriteHTTPResponseCode($StatusCode, $ReasonPhrase=null) { // Build the status line, starting with the protocol and code. $statusLine = 'HTTP/1.1 '.$StatusCode; // If a custom reason phrase is given, add it. if ($ReasonPhrase) { $statusLine .= ' '.$ReasonPhrase; } // Else try to use a standard resason phrase. else { switch ($ReasonPhrase) { case 100: $statusLine .= ' Continue'; break; case 101: $statusLine .= ' Switching Protocols'; break; case 200: $statusLine .= ' OK'; break; case 201: $statusLine .= ' Created'; break; case 202: $statusLine .= ' Accepted'; break; case 203: $statusLine .= ' Non-Authoritative Information'; break; case 204: $statusLine .= ' No Content'; break; case 205: $statusLine .= ' Reset Content'; break; case 206: $statusLine .= ' Partial Content'; break; case 300: $statusLine .= ' Multiple Choices'; break; case 301: $statusLine .= ' Moved Permanently'; break; case 302: $statusLine .= ' Found'; break; case 303: $statusLine .= ' See Other'; break; case 304: $statusLine .= ' Not Modified'; break; case 305: $statusLine .= ' Use Proxy'; break; case 307: $statusLine .= ' Temporary Redirect'; break; case 400: $statusLine .= ' Bad Request'; break; case 401: $statusLine .= ' Unauthorized'; break; case 402: $statusLine .= ' Payment Required'; break; case 403: $statusLine .= ' Forbidden'; break; case 405: $statusLine .= ' Not Found'; break; case 405: $statusLine .= ' Method Not Allowed'; break; case 406: $statusLine .= ' Not Acceptable'; break; case 407: $statusLine .= ' Proxy Authentication Required'; break; case 408: $statusLine .= ' Request Time-out'; break; case 409: $statusLine .= ' Conflict'; break; case 410: $statusLine .= ' Gone'; break; case 411: $statusLine .= ' Length Required'; break; case 412: $statusLine .= ' Precondition Failed'; break; case 413: $statusLine .= ' Request Entity Too Large'; break; case 414: $statusLine .= ' Request-URI Too Large'; break; case 415: $statusLine .= ' Unsupported Media Type'; break; case 416: $statusLine .= ' Requested range not satisfiable'; break; case 417: $statusLine .= ' Expectation Failed'; break; case 500: $statusLine .= ' Internal Server Error'; break; case 501: $statusLine .= ' Not Implemented'; break; case 502: $statusLine .= ' Bad Gateway'; break; case 503: $statusLine .= ' Service Unavailable'; break; case 504: $statusLine .= ' Gateway Time-out'; break; case 505: $statusLine .= ' HTTP Version not supported'; break; } } // Send the status line using header(). header($statusLine); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponseHeader($Name, $Value, $ReplaceExisting=true, $StatusCode=null) { // Construct the header value; split behavior if the given value is an // array. $value = ''; if (is_array($Value)) { $value = implode("\r\n", $Value); } // Use the value literally. else { $value = strval($Value); } // Write the header; split behavior if a status code is given. if ($StatusCode) { header($Name.': '.$value, $ReplaceExisting, $StatusCode); } else { header($Name.': '.$value, $ReplaceExisting); } } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_CacheControl($Directive) { $this->WriteHTTPResponseHeader('Cache-Control', $Directive); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_Public() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_CacheControl() */ public function WriteHTTPResponse_CacheControl_Public() { $this->WriteHTTPResponse_CacheControl('public'); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_Private() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_CacheControl() */ public function WriteHTTPResponse_CacheControl_Private() { $this->WriteHTTPResponse_CacheControl('private'); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_MustRevalidate() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_CacheControl() */ public function WriteHTTPResponse_CacheControl_MustRevalidate() { $this->WriteHTTPResponse_CacheControl('must-revalidate'); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_NoCache() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_CacheControl() */ public function WriteHTTPResponse_CacheControl_NoCache() { $this->WriteHTTPResponse_CacheControl('no-cache'); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_NoStore() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_CacheControl() */ public function WriteHTTPResponse_CacheControl_NoStore() { $this->WriteHTTPResponse_CacheControl('no-store'); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentType() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentType($Type) { $this->WriteHTTPResponseHeader('Content-Type', $Type); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentEncoding() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentEncoding($Encoding) { $this->WriteHTTPResponseHeader('Content-Encoding', $Encoding); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentLanguage() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentLanguage($LanguageCodes) { $this->WriteHTTPResponseHeader('Content-Language', $LanguageCodes); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentLength() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentLength($LengthInBytes) { $this->WriteHTTPResponseHeader('Content-Length', strval($LengthInBytes)); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDisposition() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentDisposition($Disposition) { $this->WriteHTTPResponseHeader('Content-Disposition', $Disposition); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDisposition_Attachment() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_ContentDisposition() */ public function WriteHTTPResponse_ContentDisposition_Attachment($Filename, $CreationDate=null, $ModificationDate=null, $SizeInBytes=null) { // Build the array of lines for the header, starting with the // 'attachment' value and the filename. $headerLines = array('attachment;', ' filename="'.$Filename.'";'); // If either date is given, build a new line for the date(s). if ($CreationDate || $ModificationDate) { $dateLine = ' '; // If a creation date is given, build a parameter string for it. if ($CreationDate) { // Build the date string. $creationDateParameter = 'creation-date="'.$CreationDate.'";'; // Add the date to the header line. $dateLine .= $creationDateParameter; } // If a modification date is given, build a parameter string for // it. if ($ModificationDate) { // Build the date string. $modificationDateParameter = 'modification-date="'.$ModificationDate.'";'; // Add the date to the header line. $dateLine .= $modificationDateParameter; } // Add the header line of the date(s). $headerLines[] = $dateLine; } // If the file size is given, add it on its own line. if ($SizeInBytes) { $headerLines[] = ' size='.strval(intval($SizeInBytes)).';'; } // Write the header. $this->WriteHTTPResponse_ContentDisposition($headerLines); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDescription() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ContentDescription($Description) { $this->WriteHTTPResponseHeader('Content-Description', $Description); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ETag() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_ETag($ETag) { $this->WriteHTTPResponseHeader('ETag', $ETag); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Expires() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_Expires($Date) { $this->WriteHTTPResponseHeader('Expires', $Date); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Expires_NowPlus() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_Expires() */ public function WriteHTTPResponse_Expires_NowPlus($SecondsFromNow) { // Build a date/time object for the given time in the future. $dateTime = new DateTime(); $dateTime->add(new DateInterval('PT'.intval($SecondsFromNow).'S')); // Write the header by outputting the date/time according to the proper // format. $this->WriteHTTPResponse_Expires($dateTime->format(DATE_RFC1123)); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_LastModified() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_LastModified($Date) { $this->WriteHTTPResponseHeader('Last-Modified', $Date); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_LastModified_NowMinus() * * @uses HTPPS_WebPagePP::WriteHTTPResponse_LastModified() */ public function WriteHTTPResponse_LastModified_NowMinus($SecondsAgo) { // Build a date/time object for the given time in the future. $dateTime = new DateTime(); $dateTime->sub(new DateInterval('PT'.intval($SecondsAgo).'S')); // Write the header by outputting the date/time according to the proper // format. $this->WriteHTTPResponse_LastModified($dateTime->format(DATE_RFC1123)); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Location() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_Location($URI, $HTTPStatusCode=null) { $this->WriteHTTPResponseHeader('Location', $URI, true, $HTTPStatusCode); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Pragma() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_Pragma($Directive) { $this->WriteHTTPResponseHeader('Pragma', $Directive); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Vary() * * @uses HTPPS_WebPagePP::WriteHTTPResponseHeader() */ public function WriteHTTPResponse_Vary($Directive) { $this->WriteHTTPResponseHeader('Vary', $Directive); } /** * @see HTPPS_iWebPagePP::OpenHead() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHead() { $this->OpenTag('head'); } /** * @see HTPPS_iWebPagePP::WriteMeta() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteMeta($Name=null, $Content=null, $HTTPEquiv=null, $Scheme=null) { // Build an array of attributes. $attributes = array(); // Check if the name is given. if ($Name) { $attributes['name'] = $Name; } // Else check if http-equiv is given. else if ($HTTPEquiv) { $attributes['http-equiv'] = $HTTPEquiv; } // Check if the content is given. if ($Content) { $attributes['content'] = $Content; } // Check if the scheme is given. if ($Scheme) { $attributes['scheme'] = $Scheme; } // Write the tag. $this->WriteEmptyTag('meta', true, $attributes); } /** * @see HTPPS_iWebPagePP::WriteMeta_ContentType() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function WriteMeta_ContentType($MediaType, $CharsetEncoding) { $this->WriteMeta(null, $MediaType.'; charset='.$CharsetEncoding, 'Content-Type'); } /** * @see HTPPS_iWebPagePP::WriteMeta_Keywords() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function WriteMeta_Keywords($Keywords) { $this->WriteMeta('keywords', $Keywords); } /** * @see HTPPS_iWebPagePP::WriteMeta_Description() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function WriteMeta_Description($Description) { $this->WriteMeta('description', $Description); } /** * @see HTPPS_iWebPagePP::WriteMeta_Language() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function WriteMeta_Language($LanguageCodes) { $this->WriteMeta(null, $LanguageCodes, 'Content-Language'); } /** * @see HTPPS_iWebPagePP::WriteMeta_Robots() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function WriteMeta_Robots($Directive) { $this->WriteMeta('robots', $Directive); } /** * @see HTPPS_iWebPagePP::DeclareDefaultStyleLanguage() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function DeclareDefaultStyleLanguage($StyleType=null) { // Check if a media type was given. if ($StyleType) { $this->WriteMeta(null, $StyleType, 'Content-Style-Type'); } // Else use the default media type. else { $this->WriteMeta(null, 'text/css', 'Content-Style-Type'); } } /** * @see HTPPS_iWebPagePP::DeclareDefaultScriptingLanguage() * * @uses HTPPS_WebPagePP::WriteMeta() */ public function DeclareDefaultScriptingLanguage($ScriptType=null) { // Check if a media type was given. if ($ScriptType) { $this->WriteMeta(null, $Script, 'Content-Script-Type'); } // Else use the default media type. else { $this->WriteMeta(null, 'text/javascript', 'Content-Script-Type'); } } /** * @see HTPPS_iWebPagePP::WriteTitle() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteTitle($Text, $EscapeText=true) { $this->WriteTagAndContents('title', false, true, $Text, $EscapeText); } /** * @see HTPPS_iWebPagePP::WriteHeadLink() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteHeadLink(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteEmptyTag('link', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::LinkToIcon() * * @uses HTPPS_WebPagePP::WriteHeadLink() */ public function LinkToIcon($URI, $MediaType=null) { //Build an attributes array. $attributes = array('rel'=>'shortcut icon', 'href'=>$URI); // Add a media type if it is given. if ($MediaType) { $attributes['type'] = $MediaType; } // Write the link. $this->WriteHeadLink($attributes); } /** * @see HTPPS_iWebPagePP::IncludeCSS() * * @uses HTPPS_WebPagePP::WriteHeadLink() */ public function IncludeCSS($URI, $Media=null, $StylesheetTitle=null, $IsAlternateStylesheet=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attributes array. $Attributes['rel'] = 'stylesheet'; $Attributes['href'] = $URI; // Add a target media if it is given. if ($Media) { $Attributes['media'] = $Media; } // Add a stylesheet title if it is given. if ($StylesheetTitle) { $Attributes['title'] = $StylesheetTitle; } // Amend the link declaration if this is an alternate stylesheet. if ($IsAlternateStylesheet) { $Attributes['rel'] = 'alternate stylesheet'; } // Write the link. $this->WriteHeadLink($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::IncludeJavaScript() * * @uses HTPPS_WebPagePP::LoadJavaScriptFile() */ public function IncludeJavaScript($URI, $WriteScriptType=true, $DeferExecution=false) { // Write the same element as for in-body script loading. $this->LoadJavaScriptFile($URI, true, $WriteScriptType, $DeferExecution); } /** * @see HTPPS_iWebPagePP::LinkToRSSFeed() * * @uses HTPPS_WebPagePP::WriteHeadLink() */ public function LinkToRSSFeed($URI, $Title=null) { //Build an attributes array. $attributes = array('rel'=>'alternate', 'href'=>$URI, 'type'=>'application/rss+xml'); // Add a title if it is given. if ($Title) { $attributes['title'] = $Title; } // Write the link. $this->WriteHeadLink($attributes); } /** * @see HTPPS_iWebPagePP::LinkToAtomFeed() * * @uses HTPPS_WebPagePP::WriteHeadLink() */ public function LinkToAtomFeed($URI, $Title=null) { //Build an attributes array. $attributes = array('rel'=>'alternate', 'href'=>$URI, 'type'=>'application/atom+xml'); // Add a title if it is given. if ($Title) { $attributes['title'] = $Title; } // Write the link. $this->WriteHeadLink($attributes); } /** * @see HTPPS_iWebPagePP::WriteURIBasePath() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteURIBasePath($URI) { $this->WriteEmptyTag('base', true, array('href'=>$URI)); } /** * @see HTPPS_iWebPagePP::OpenBody() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::BeginDocumentContentTags() */ public function OpenBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenTag('body', true, $Attributes, $OneAttributePerLine, $ExtraString); // Mark that this is the beginning of principal content. $this->BeginDocumentContentTags(); } /** * @see HTPPS_iWebPagePP::WriteHeadAndOpenBody() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenHead() * @uses HTPPS_WebPagePP::WriteTitle() * @uses HTPPS_WebPagePP::LinkToIcon() * @uses HTPPS_WebPagePP::IncludeCSS() * @uses HTPPS_WebPagePP::IncludeJavaScript() * @uses HTPPS_WebPagePP::WriteTitle() * @uses HTPPS_WebPagePP::OpenBody() * @uses HTPPS_WebPagePP::FlushTransmission() */ public function WriteHeadAndOpenBody($Title, $IconURI=null, array $CSSURIs=null, array $HeadJavaScriptURIs=null, $FlushTransmissionBeforeBody=true, array $BodyAttributes=array(), $BodyOneAttributePerLine=false, $BodyExtraString=null) { // Open the document head. $this->OpenHead(); // Write the document title. $this->WriteTitle($Title); // Write the shortcut icon if its URI is given. if ($IconURI) { $this->LinkToIcon($IconURI); } // Include any given CSS files. if ($CSSURIs && (sizeof($CSSURIs) > 0)) { // Iterate through all URIs. foreach ($CSSURIs as $cssURI) { $this->IncludeCSS($cssURI); } } // Include any given JavaScript files. if ($HeadJavaScriptURIs && (sizeof($HeadJavaScriptURIs) > 0)) { // Iterate through all URIs. foreach ($HeadJavaScriptURIs as $javajcriptURI) { $this->IncludeJavaScript($javajcriptURI); } } // Close the document head. $this->CloseTag(); // Flush the transmission if desired. if ($FlushTransmissionBeforeBody) { $this->FlushTransmission(); } // Open the document body. $this->OpenBody($BodyAttributes, $BodyOneAttributePerLine, $BodyExtraString); } /** * @see HTPPS_iWebPagePP::OpenDiv() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenDiv($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('div', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDiv() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteDiv($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('div', false, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSpan() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenSpan(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('span', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSpan() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteSpan($Text, $EscapeText=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('span', false, $EndWithNewline, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHeading() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_WebPagePP::DetermineHeadingTag() */ public function OpenHeading($HeadingLevel=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Determine the tag name for the given heading level. $tag = $this->DetermineHeadingTag($HeadingLevel); // Open the tag. $this->OpenTag($tag, false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHeading() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() * @uses HTPPS_WebPagePP::DetermineHeadingTag() */ public function WriteHeading($Text, $EscapeText=true, $HeadingLevel=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Determine the tag name for the given heading level. $tag = $this->DetermineHeadingTag($HeadingLevel); // Write the tag. $this->WriteTagAndContents($tag, false, $EndWithNewline, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHR() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteHR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteEmptyTag('hr', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteBR() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteBR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteEmptyTag('br', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteNBSP() * * @uses HTPPS_PrettyPrinter::Write() */ public function WriteNBSP($Number=1) { $nbspString = ''; // Build the string iteratively. for ($i = 0; $i < $Number; $i++) { $nbspString .= ' '; } // Write the string. $this->Write($nbspString); } /** * @see HTPPS_iWebPagePP::OpenStrong() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenStrong(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('strong', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteStrong() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteStrong($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('strong', false, false, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenEmphasized() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenEmphasized(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('em', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteEmphasized() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteEmphasized($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('em', false, false, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenParagraph() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenParagraph($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('p', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteParagraph() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteParagraph($Text, $EscapeText=true, $PrecedeWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('p', $PrecedeWithNewline, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSubscript() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenSubscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('sub', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSubscript() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteSubscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('sub', false, false, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSuperscript() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenSuperscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('sup', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSuperscript() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteSuperscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('sup', false, false, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenQuote() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenQuote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('q', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteQuote() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteQuote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('q', false, false, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenBlockquote() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenBlockquote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('blockquote', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteBlockquote() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteBlockquote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('blockquote', true, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenComputerCode() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenComputerCode($ComputerLanguageName=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the language if it is given. if ($ComputerLanguageName) { $Attributes['lang'] = $ComputerLanguageName; } // Open the tag. $this->OpenTag('code', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); // // Close the tag. } /** * @see HTPPS_iWebPagePP::OpenComputerCode() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteAndEscape() * @uses HTPPS_PrettyPrinter::WriteNewline() * @uses HTPPS_WebPagePP::WriteBR() */ public function WriteComputerCode($Text, $ComputerLanguageName=null, $ConvertNewlinesToBRs=true, $PrecedeWithNewline=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenComputerCode($ComputerLanguageName, $PrecedeWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); // If the text is not to be processed for newlines, write it simply. if (!$ConvertNewlinesToBRs) { // Write the computer code. $this->WriteAndEscape($Text); // If the tag opening is to end with a newline, write a newline // after the code as an approximate match of style. if ($PrecedeWithNewline) { $this->WriteNewline(); } } // Else, if the text does not contain a newline, write it simply. else if (strpos($Text, "\n") === false) { // Write the computer code. $this->WriteAndEscape($Text); // If the tag opening is to end with a newline, write a newline // after the code as an approximate match of style. if ($PrecedeWithNewline) { $this->WriteNewline(); } } // Else write the text with smart newline processing. else { // Break the text into individual lines. $textLines = explode("\n", $Text); // Iterate through each line. foreach ($textLines as $textLine) { // Write the line of code, followed by a
and an // accompanying line break in the document. $this->WriteAndEscape($textLine); $this->WriteBR(); } } // Close the tag. $this->CloseTag($EndWithNewline); } /** * @see HTPPS_iWebPagePP::WriteAcronym() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteAcronym($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the expanded text. $Attributes['title'] = $ExpandedText; // Write the tag. $this->WriteTagAndContents('acronym', false, false, $AbbreviatedText, $EscapeAbbreviatedText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteAbbreviation() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteAbbreviation($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the expanded text. $Attributes['title'] = $ExpandedText; // Write the tag. $this->WriteTagAndContents('abbr', false, false, $AbbreviatedText, $EscapeAbbreviatedText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenLink() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenLink($Location, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the location. $Attributes['href'] = $Location; // Open the tag. $this->OpenTag('a', false, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHR() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() */ public function WriteAnchor($ID, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the ID. $Attributes['id'] = $ID; // Open the tag. $this->OpenTag('a', false, $Attributes, $OneAttributePerLine, $ExtraString); // Close the tag. $this->CloseTag($EndWithNewline); } /** * @see HTPPS_iWebPagePP::WriteLink() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteLink($Location, $Text, $EscapeText=true, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the location. $Attributes['href'] = $Location; // Write the tag. $this->WriteTagAndContents('a', false, $EndWithNewline, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteImage() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteImage($URI, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the URI. $Attributes['src'] = $URI; // Build an attribute for the alternate text. $Attributes['alt'] = $AlternateText; // Write the tag. $this->WriteEmptyTag('img', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteImageFromBase64() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteImageFromBase64($Base64Encoding, $ImageMediaType, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { // Build an attribute for the data URI. $Attributes['src'] = 'data:'.$ImageMediaType.';base64,'.$Base64Encoding; // Build an attribute for the alternate text. $Attributes['alt'] = $AlternateText; // Write the tag. $this->WriteEmptyTag('img', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenListItem() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::MostRecentTag() */ public function OpenListItem($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Check if the tag context should be enforced. if ($EnsureProperContext) { // Close tags until the most-recently-opened tag is a 'ul' or 'ol'. while (($this->MostRecentTag() != 'ul') && ($this->MostRecentTag() != 'ol')) { $this->CloseTag(); } } // Open the tag. $this->OpenTag('li', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteListItem() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteListItem($Text, $EscapeText=true, $EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Check if the tag context should be enforced. if ($EnsureProperContext) { // Close tags until the most-recently-opened tag is a 'ul' or 'ol'. while (($this->MostRecentTag() != 'ul') && ($this->MostRecentTag() != 'ol')) { $this->CloseTag(); } } // Write the tag. $this->WriteTagAndContents('li', false, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenUnorderedList() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenUnorderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('ul', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteUnorderedList() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenUnorderedList() * @uses HTPPS_WebPagePP::WriteListItem() */ public function WriteUnorderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { // Open the list tag. $this->OpenUnorderedList($ListAttributes, $ListOneAttributePerLine, $ListExtraString); // Iterate through each item. foreach ($ItemsText as $itemText) { // Write the item. $this->WriteListItem($itemText, $EscapeItemsText, false, $ItemsAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } // Close the list tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenOrderedList() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenOrderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('ol', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteUnorderedList() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenOrderedList() * @uses HTPPS_WebPagePP::WriteListItem() */ public function WriteOrderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { // Open the list tag. $this->OpenOrderedList($ListAttributes, $ListOneAttributePerLine, $ListExtraString); // Iterate through each item. foreach ($ItemsText as $itemText) { // Write the item. $this->WriteListItem($itemText, $EscapeItemsText, false, $ItemsAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } // Close the list tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenDefinitionListTerm() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenDefinitionListTerm(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('dt', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDefinitionListTerm() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteDefinitionListTerm($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('dt', false, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenDefinitionListDefinition() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenDefinitionListDefinition(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('dd', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDefinitionListDefinition() * * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function WriteDefinitionListDefinition($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteTagAndContents('dd', false, true, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenDefinitionList() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenDefinitionList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('dl', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteUnorderedList() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenDefinitionList() * @uses HTPPS_WebPagePP::WriteDefinitionListTerm() * @uses HTPPS_WebPagePP::WriteDefinitionListDefinition() */ public function WriteDefinitionList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $TermsToDefinitionsText=array(), $EscapeTermsText=true, array $TermsAttributes=array(), $TermsOneAttributePerLine=false, $TermsExtraString=null, $EscapeDefinitionsText=true, array $DefinitionsAttributes=array(), $DefinitionsOneAttributePerLine=false, $DefinitionsExtraString=null) { // Open the list tag. $this->OpenDefinitionList($ListAttributes, $ListOneAttributePerLine, $ListExtraString); // Iterate through the terms and definitions. foreach ($TermsToDefinitionsText as $termText => $definitionText) { // Write the term. $this->WriteDefinitionListTerm($termText, $EscapeTermsText, $TermsAttributes, $TermsOneAttributePerLine, $TermsExtraString); // Write the definition. $this->WriteDefinitionListDefinition ($definitionText, $EscapeDefinitionsText, $DefinitionsAttributes, $DefinitionsOneAttributePerLine, $DefinitionsExtraString); } // Close the list tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenTable() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function OpenTable(array $TableAttributes=array(), $TableOneAttributePerLine=false, $TableExtraString=null, $CaptionText=null, $EscapeCaptionText=true, array $CaptionAttributes=array(), $CaptionOneAttributePerLine=false, $CaptionExtraString=null) { // Open the table tag. $this->OpenTag('table', true, $TableAttributes, $TableOneAttributePerLine, $TableExtraString); // If a caption is given, write it. if ($CaptionText) { $this->WriteTagAndContents('caption', false, true, $CaptionText, $EscapeCaptionText, $CaptionAttributes, $CaptionOneAttributePerLine, $CaptionExtraString); } } /** * @see HTPPS_iWebPagePP::OpenTableHead() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenTableHead(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('thead', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableFoot() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenTableFoot(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('tfoot', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableBody() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenTableBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('tbody', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableColumnGroup() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenTableColumnGroup($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('colgroup', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteTableColumn() * * @uses HTPPS_PrettyPrinter::WriteEmptyTag() */ public function WriteTableColumn($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteEmptyTag('col', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableRow() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::MostRecentTag() */ public function OpenTableRow($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Check if the tag context should be enforced. if ($EnsureProperContext) { // Close tags until the most-recently-opened tag is a 'table' or // 'tbody'. while (($this->MostRecentTag() != 'table') && ($this->MostRecentTag() != 'tbody')) { $this->CloseTag(); } } // Open the tag. $this->OpenTag('tr', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableCell() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::MostRecentTag() */ public function OpenTableCell($ColumnSpan=null, $RowSpan=null, $EnsureProperContext=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the column span if it is given. if ($ColumnSpan) { $Attributes['colspan'] = $ColumnSpan; } // Build an attribute for the row span if it is given. if ($RowSpan) { $Attributes['rowspan'] = $RowSpan; } // Check if the tag context should be enforced. if ($EnsureProperContext) { // Close tags until the most-recently-opened tag is a 'tr'. while ($this->MostRecentTag() != 'tr') { $this->CloseTag(); } } // Open the tag. $this->OpenTag('td', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableHeading() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenTableHeading($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('th', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::CloseTable() * * @uses HTPPS_PrettyPrinter::CloseTag() */ public function CloseTable($EndWithNewline=true) { $this->CloseTag($EndWithNewline, 'table'); } /** * @see HTPPS_iWebPagePP::CloseTableRow() * * @uses HTPPS_PrettyPrinter::CloseTag() */ public function CloseTableRow($EndWithNewline=true) { $this->CloseTag($EndWithNewline, 'tr'); } /** * @see HTPPS_iWebPagePP::CloseTableCell() * * @uses HTPPS_PrettyPrinter::CloseTag() */ public function CloseTableCell($EndWithNewline=true) { $this->CloseTag($EndWithNewline, 'td'); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHTMLForm($ProcessingPageLocation, $RequestMethod, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the processing page location. $Attributes['action'] = $ProcessingPageLocation; // Convert the request method to uppercase. $RequestMethod = strtoupper($RequestMethod); // Build an attribute for the request method. $Attributes['method'] = $RequestMethod; // Open the tag. $this->OpenTag('form', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_FieldSet() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::WriteTagAndContents() */ public function OpenHTMLForm_FieldSet($LegendText=null, $EscapeLegendText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenTag('fieldset', true, $Attributes, $OneAttributePerLine, $ExtraString); // If desired, write the legend tag. if ($LegendText) { $this->WriteTagAndContents('legend', false, true, $LegendText, $EscapeLegendText); } } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_TextBox() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_TextBox($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('text', $Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_Password() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_Password($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('password', $Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenListItem() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::WriteAndEscape() */ public function WriteHTMLForm_TextArea($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenTag('textarea', true, $Attributes, $OneAttributePerLine, $ExtraString); // Write the initial value if it is given. if ($Value) { $this->WriteAndEscape($Value); } // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_CheckBox() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_CheckBox($Name, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an array of minimized attributes. $minimizedAttributes = array(); // Build a minimized attribute for the checked state if it is given. if ($Checked) { $minimizedAttributes[] = 'checked'; } // Write the tag. $this->WriteHTMLForm_Input('checkbox', $Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString, $minimizedAttributes); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_RadioButton() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_RadioButton($GroupName, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an array of minimized attributes. $minimizedAttributes = array(); // Build a minimized attribute for the checked state if it is given. if ($Checked) { $minimizedAttributes[] = 'checked'; } // Write the tag. $this->WriteHTMLForm_Input('radio', $GroupName, $Value, $Attributes, $OneAttributePerLine, $ExtraString, $minimizedAttributes); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_RadioButtons() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::WriteSpan() * @uses HTPPS_PrettyPrinter::WriteBR() * @uses HTPPS_WebPagePP::OpenHTMLForm_Label() * @uses HTPPS_WebPagePP::WriteHTMLForm_RadioButton() */ public function WriteHTMLForm_RadioButtons($GroupName, array $ValuesAndLabelTexts, $CheckedValue=null, $EscapeLabelTexts=true, $SeparateWithLineBreaks=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Record the size of the array, which helps to write newlines between // elements. $radioButtonCount = sizeof($ValuesAndLabelTexts); // Iterate through the values and corresponding label texts. $radioButtonsWritten = 0; foreach ($ValuesAndLabelTexts as $value => $labelText) { // Open a label for the input. $this->OpenHTMLForm_Label(null, true); // Write the radio button. $this->WriteHTMLForm_RadioButton($GroupName, $value, ($value === $CheckedValue), $Attributes, $OneAttributePerLine, $ExtraString); // Write the label text within a span. $this->WriteSpan($labelText, $EscapeLabelTexts); // Close the label tag. $this->CloseTag(); // Write a newline after this radio button if desired. if ($SeparateWithLineBreaks && ($radioButtonsWritten < $radioButtonCount)) { $this->WriteBR(); } // Increment the count of radio buttons written. $radioButtonsWritten++; } } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenu() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the input name. $Attributes['name'] = $Name; // Build a minimized attribute for the multiple-selector flag if it is // true. $extraString = null; if ($IsMultipleSelector) { $extraString = 'multiple'; } // // Open the tag. $this->OpenTag('select', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenuItemGroup() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHTMLForm_DropDownMenuItemGroup($LabelText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the label. $Attributes['label'] = $LabelText; // Open the tag. $this->OpenTag('optgroup', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenuItem() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHTMLForm_DropDownMenuItem($Value, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the value. $Attributes['value'] = $Value; // Build a minimized attribute for the selected flag if it is true. $extraString = null; if ($Selected) { $extraString = 'selected'; } // Add a given extra string to the above one. if ($ExtraString) { // Check if an extra string has already been built. if ($extraString) { $extraString .= ' '.$ExtraString; } // Else use the given extra string as the final one. else { $extraString = $ExtraString; } } // Open the tag. $this->OpenTag('option', false, $Attributes, $OneAttributePerLine, $extraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_DropDownMenuItem() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteAndEscape() * @uses HTPPS_WebPagePP::OpenHTMLForm_DropDownMenuItem() */ public function WriteHTMLForm_DropDownMenuItem($Value, $Text, $EscapeText=true, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenHTMLForm_DropDownMenuItem($Value, $Selected, $Attributes, $OneAttributePerLine, $ExtraString); // Write the text, optionally escaped. if ($EscapeText) { $this->WriteAndEscape($Text); } else { $this->Write($Text); } // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_DropDownMenu() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenHTMLForm_DropDownMenu() * @uses HTPPS_WebPagePP::WriteHTMLForm_DropDownMenuItem() */ public function WriteHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $ValuesAndLabelTexts, $SelectedValues=null, $EscapeLabelTexts=true, array $MenuAttributes=array(), $MenuOneAttributePerLine=false, $MenuExtraString=null, array $ItemAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { // Open the menu tag. $this->OpenHTMLForm_DropDownMenu($Name, $IsMultipleSelector, $MenuAttributes, $MenuOneAttributePerLine, $MenuExtraString); // Iterate through each option. foreach ($ValuesAndLabelTexts as $value => $labelText) { $this->WriteHTMLForm_DropDownMenuItem($value, $labelText, $EscapeLabelTexts, (array_search ($value, $SelectedValues, true) !== false), $ItemAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } // Close the menu tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_File() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_File($Name, $DefaultPath=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('file', $Name, $DefaultPath, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_Label() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenHTMLForm_Label($FormControlID=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the associated control's ID if it is given. if ($FormControlID) { $Attributes['for'] = $FormControlID; } // Open the tag. $this->OpenTag('label', $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Label() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteAndEscape() * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenHTMLForm_Label() */ public function WriteHTMLForm_Label($FormControlID, $Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Open the tag. $this->OpenHTMLForm_Label($FormControlID, false, $Attributes, $OneAttributePerLine, $ExtraString); // Write the text, optionally escaped. if ($EscapeText) { $this->WriteAndEscape($Text); } else { $this->Write($Text); } // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Hidden() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_Hidden($Name, $Value) { $this->WriteHTMLForm_Input('hidden', $Name, $Value); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Button() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_Button($Text, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('button', $Name, $Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_ImageButton() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_ImageButton($Name, $ImageURI, $AlternateText=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the URI. $Attributes['src'] = $ImageURI; // Build an attribute for the alternate text if it is given. if ($AlternateText) { $Attributes['alt'] = $AlternateText; } // Write the tag. $this->WriteHTMLForm_Input('image', $Name, null, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Reset() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_Reset($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('reset', null, $Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Submit() * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ public function WriteHTMLForm_Submit($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->WriteHTMLForm_Input('submit', null, $Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::CloseHTMLForm() * * @uses HTPPS_PrettyPrinter::CloseTag() */ public function CloseHTMLForm() { $this->CloseTag(true, 'form'); } /** * @see HTPPS_iWebPagePP::OpenObject() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenObject(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { $this->OpenTag('object', true, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteObjectParameter() * * @uses HTPPS_WebPagePP::WriteEmptyTag() */ public function WriteObjectParameter($Name, $Value, $ValueType=null, $ContentType=null) { // Build an attributes array. $attributes = array('name'=>$Name, 'value'=>$Value); // Build an attribute for the value type if it is given. if ($ValueType) { $attributes['valuetype'] = $ValueType; } // Build an attribute for the content type if it is given. if ($ContentType) { $attributes['type'] = $ContentType; } // Write the tag. $this->WriteEmptyTag('param', true, $attributes); } /** * @see HTPPS_iWebPagePP::EmbedDocument() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteAndEscape() * @uses HTPPS_WebPagePP::OpenObject() */ public function EmbedDocument($URI, $ContentType=null, $AlternateText=null, $EscapeAlternateText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the URI. $Attributes['data'] = $URI; // Build an attribute for the content type if it is given. if ($ContentType) { $Attributes['type'] = $ContentType; } // Open the tag. $this->OpenObject($Attributes, $OneAttributePerLine, $ExtraString); // Write the alternate text if it is given. if ($AlternateText) { // Escape the alternate text if desired. if ($EscapeAlternateText) { $this->WriteAndEscape($AlternateText); } // Else write it unescaped. else { $this->Write($AlternateText); } } // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::WriteIFrame() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() */ public function WriteIFrame($URI, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Build an attribute for the URI. $Attributes['src'] = $URI; // Open the tag. $this->OpenTag('iframe', true, $Attributes, $OneAttributePerLine, $ExtraString); // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenFlashEmbed() * * @uses HTPPS_WebPagePP::OpenObject() * @uses HTPPS_WebPagePP::WriteFlashParameter() */ public function OpenFlashEmbed($URI, $Width=null, $Height=null, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { // Build an attribute for the media type. $Attributes['type'] = 'application/x-shockwave-flash'; // Build an attribute for the URI. $Attributes['data'] = $URI; // Build an attribute for the width if it is given. if ($Width) { $Attributes['width'] = $Width; } // Build an attribute for the height if it is given. if ($Height) { $Attributes['height'] = $Height; } // Open the tag. $this->OpenObject($Attributes, $OneAttributePerLine, $ExtraString); // Write the "movie" parameter. $this->WriteFlashParameter('movie', $URI); } /** * @see HTPPS_iWebPagePP::WriteFlashParameter() * * @uses HTPPS_WebPagePP::WriteObjectParameter() */ public function WriteFlashParameter($Name, $Value) { $this->WriteObjectParameter($Name, $Value); } /** * @see HTPPS_iWebPagePP::EmbedFlash() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_WebPagePP::OpenFlashEmbed() * @uses HTPPS_WebPagePP::WriteFlashParameter() */ public function EmbedFlash($URI, $Width=null, $Height=null, array $SWFParameters=array(), array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { // Open the tag. $this->OpenFlashEmbed($URI, $Width, $Height, $Attributes, $OneAttributePerLine, $ExtraString); // Iterate through any parameters. foreach ($SWFParameters as $parameterName => $parameterValue) { $this->WriteFlashParameter($parameterName, $parameterValue); } // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::OpenJavaScript() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenJavaScript($EndWithNewline=true, $WriteScriptType=true) { // Build an attributes array. $attributes = array(); // If desired, build an attribute for the media type. if ($WriteScriptType) { $attributes['type'] = 'text/javascript'; } // Open the tag. $this->OpenTag('script', $EndWithNewline, $attributes); } /** * @see HTPPS_iWebPagePP::CloseJavaScript() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::ClearLine() */ public function CloseJavaScript($EndWithNewline=true) { // If the tag closing is to end with a newline, clear a line before the // tag closing as an approximate match of style. if ($EndWithNewline) { $this->ClearLine(); } // Close the tag. $this->CloseTag($EndWithNewline); } /** * @see HTPPS_iWebPagePP::LoadJavaScriptFile() * * @uses HTPPS_PrettyPrinter::OpenTag() * @uses HTPPS_PrettyPrinter::CloseTag() */ public function LoadJavaScriptFile($URI, $EndWithNewline=true, $WriteScriptType=true, $DeferExecution=false) { // Build an attributes array. $attributes = array(); // Build an attribute for the URI. $attributes['src'] = $URI; // If desired, build an attribute for the media type. if ($WriteScriptType) { $attributes['type'] = 'text/javascript'; } // Build an extra string. $extraString = null; // If desired, build a minimized attribute to defer execution. if ($DeferExecution) { $extraString = 'defer'; } // Open the tag. $this->OpenTag('script', false, $attributes, null, $extraString); // Close the tag. $this->CloseTag($EndWithNewline); } /** * @see HTPPS_iWebPagePP::LoadJavaScriptFileAtEnd() * * @uses HTPPS_WebPagePP::$JavaScriptFilesForDocumentEnd() */ public function LoadJavaScriptFileAtEnd($URI, $WriteScriptType=true, $DeferExecution=false) { $this->JavaScriptFilesForDocumentEnd[] = array('URI'=>$URI, 'WriteScriptType'=>$WriteScriptType, 'DeferExecution'=>$DeferExecution); } /** * @see HTPPS_iWebPagePP::OpenCSS() * * @uses HTPPS_PrettyPrinter::OpenTag() */ public function OpenCSS($WriteStyleType=true) { // Build an attributes array. $attributes = array(); // If desired, build an attribute for the media type. if ($WriteStyleType) { $attributes['type'] = 'text/css'; } // Open the tag. $this->OpenTag('style', true, $attributes); } /** * @see HTPPS_iWebPagePP::CloseCSS() * * @uses HTPPS_PrettyPrinter::CloseTag() * @uses HTPPS_PrettyPrinter::ClearLine() */ public function CloseCSS() { // Clear the line before the tag closing. $this->ClearLine(); // Close the tag. $this->CloseTag(); } /** * @see HTPPS_iWebPagePP::JavaScript_GoBack() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_WebPagePP::OpenJavaScript() * @uses HTPPS_WebPagePP::CloseJavaScript() */ public function JavaScript_GoBack($DelayInSeconds=null) { // Open the tag. $this->OpenJavaScript(); // Pause for the given number of seconds, and go back in history. $this->Write('setTimeout("history.back();", ' .($DelayInSeconds * 1000) .');'); // Close the tag. $this->CloseJavaScript(); } /** * @see HTPPS_iWebPagePP::JavaScript_Redirect() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_WebPagePP::OpenJavaScript() * @uses HTPPS_WebPagePP::CloseJavaScript() */ public function JavaScript_Redirect($Location, $DelayInSeconds=null) { // Open the tag. $this->OpenJavaScript(); // Pause for the given number of seconds, and go to the given link. $this->Write('setTimeout("document.location = \'' .$Location .'\';", ' .($DelayInSeconds * 1000) .');'); // Close the tag. $this->CloseJavaScript(); } /** * @see HTPPS_iWebPagePP::FlushTransmission() */ public function FlushTransmission() { flush(); } /** * @see HTPPS_iPrettyPrinter::CloseDocument() */ public function CloseDocument() { // Check if the document is still open. if (!($this->DocumentIsOpen())) { return; } // Close all tags before the body tag. $this->CloseAllTags(false); // Include any necessary JavaScript files. foreach ($this->JavaScriptFilesForDocumentEnd as $javaScriptFile) { $this->LoadJavaScriptFile($javaScriptFile['URI'], true, $javaScriptFile['WriteScriptType'], $javaScriptFile['DeferExecution']); } // Close all remaining tags. $this->CloseAllTags(true); } /** * @see HTPPS_iTagManager::MarkupLanguageDialect * * @return string * The dialect name in a printable format. */ public function MarkupLanguageDialect() { return strval($this->MarkupLanguageDialect); } } // End class HTPPS_WebPagePP /** * Provides access to an XHTML pretty printer. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iXHTMLPP extends HTPPS_iXMLPP, HTPPS_iWebPagePP { } // End interface HTPPS_iXHTMLPP /** * Provides access to an XHTML pretty printer which has a language version of * at least 1.0. * * This is a nominal interface that may be used to enforce version * requirements. Interfaces for XHTML pretty printers with newer language * versions should extend this interface. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iXHTMLPP_v10Plus extends HTPPS_iXHTMLPP { } // End interface HTPPS_iXHTMLPP_v10Plus /** * The abstract base class of all XHTML pretty printers. * * This overrides some methods from the Web-page pretty printer to provide * XHTML-specific functionality. * * @package HTPPS * @subpackage PrettyPrinters */ abstract class HTPPS_XHTMLPP extends HTPPS_WebPagePP implements HTPPS_iXHTMLPP { //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Writes an input element of an HTML form, enforcing XHTML conventions. * * This accounts for minimized attributes. * * @uses HTPPS_WebPagePP::WriteHTMLForm_Input() */ protected function WriteHTMLForm_Input($InputType, $Name=null, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null, array $MinimizedAttributes=array()) { // Create an array that merges the attributes and the minimized // attributes, starting with just the attributes. $attributes = $Attributes; // Build a traditional attribute for each minimized attribute. foreach ($MinimizedAttributes as $minimizedAttribute) { $attributes[$minimizedAttribute] = $minimizedAttribute; } // Relay the call to the parent (HTML) implementation. parent::WriteHTMLForm_Input($InputType, $Name, $Value, $attributes, $OneAttributePerLine, $ExtraString); } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param TagManager HTPPS_iTagManager * The tag manager to use in initialization. The tag manager will not * be initialized. * * @uses HTPPS_WebPagePP::__construct() * @uses HTPPS_PrettyPrinter::$Tags */ public function __construct(HTPPS_iTagManager $TagManager) { // Call the parent constructor. parent::__construct($TagManager); // Set the markup-escape mapping to change ' to ', since // ' is not an HTML character entity reference and may confuse // some browsers. This is a recommendation from the W3C XHTML // compatibility guide. $this->Tags->SetMarkupEscapeTranslations(array('/&/'=>'&', '/'<', '/>/'=>'>', '/"/'=>'"', "/'/"=>"'")); } /** * Destructor. * * @uses HTPPS_WebPagePP::__destruct() */ public function __destruct() { parent::__destruct(); } /** * This does nothing, as it seals off access to the potentially dangerous * implementation. * * @see HTPPS_iXMLTagManager::SetMarkupEscapeTranslations() */ public function SetMarkupEscapeTranslations(array $SearchesAndReplacements) { } /** * @see HTPPS_iXMLTagManager::WriteProcessingInstruction() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteProcessingInstruction($Target, array $PseudoAttributes=array(), $OnePseudoAttributePerLine=false, $ExtraString=null) { return $this->Tags ->WriteProcessingInstruction($Target, $PseudoAttributes, $OnePseudoAttributePerLine, $ExtraString); } /** * @see HTPPS_iXMLTagManager::OpenCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function OpenCDATA($EndWithNewline=true) { return $this->Tags->OpenCDATA($EndWithNewline); } /** * @see HTPPS_iXMLTagManager::CloseCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function CloseCDATA($EndWithNewline=true) { return $this->Tags->CloseCDATA($EndWithNewline); } /** * @see HTPPS_iXMLTagManager::WriteCDATA() * * @uses HTPPS_PrettyPrinter::$Tags */ public function WriteCDATA($Text, $EndWithNewline=false) { return $this->Tags->WriteCDATA($Text, $EndWithNewline); } /** * Opens a tag, enforcing XHTML conventions. * * This adds the 'xml:lang' attribute if the 'lang' attribute is given. * * @see HTPPS_iTagManager::OpenTag() * * @uses HTPPS_WebPagePP::OpenTag() */ public function OpenTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Add an 'xml:lang' attribute if 'lang' is given. if ($Attributes['lang']) { $Attributes['xml:lang'] = $Attributes['lang']; } // Open the tag. parent::OpenTag($Tag, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * Handles the writing of an iframe by converting it to an embedded * document. * * @see HTPPS_iWebPagePP::WriteIFrame() * * @uses HTPPS_WebPagePP::EmbedDocument() */ public function WriteIFrame($URI, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { // Convert the iframe to an embedded documente for the most familiar // behavior. return $this->EmbedDocument($URI, null, null, null, $Attributes, $OneAttributePerLine, $ExtraString); } /** * Opens a JavaScript tag, enforcing XHTML conventions. * * This adds a CDATA opening, which is enclosed in JavaScript comments. * * @see HTPPS_iWebPagePP::OpenJavaScript() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteNewline() * @uses HTPPS_WebPagePP::OpenCSS() * @uses HTPPS_XHTMLPP::OpenCDATA() */ public function OpenJavaScript($EndWithNewline=true, $WriteScriptType=true) { // Open the tag plainly. parent::OpenJavaScript($EndWithNewline, $WriteScriptType); // Add a CDATA opening within JavaScript comments. $this->Write('/*'); $this->OpenCDATA(false); $this->Write('*/'); // If the tag opening is to end with a newline, clear a line before the // JavaScript as an approximate match of style. if ($EndWithNewline) { $this->WriteNewline(); } } /** * Closes a JavaScript tag, enforcing XHTML conventions. * * This adds a CDATA closing, which is enclosed in JavaScript comments. * * @see HTPPS_iWebPagePP::CloseJavaScript() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::ClearLine() * @uses HTPPS_WebPagePP::CloseCSS() * @uses HTPPS_XHTMLPP::CloseCDATA() */ public function CloseJavaScript($EndWithNewline=true) { // If the tag closing is to end with a newline, clear a line before the // CDATA closing as an approximate match of style. if ($EndWithNewline) { $this->Clearline(); } // Add a CDATA closing within CSS comments. $this->Write('/*'); $this->CloseCDATA(false); $this->Write('*/'); // If the tag closing is to end with a newline, clear a line before the // tag closing as an approximate match of style. if ($EndWithNewline) { $this->WriteNewline(); } // Close the tag plainly. parent::CloseJavaScript($EndWithNewline); } /** * Loads a JavaScript file, enforcing XHTML conventions. * * This accounts for the 'defer' minimized attribute. * * @see HTPPS_iWebPagePP::LoadJavaScriptFile() */ public function LoadJavaScriptFile($URI, $EndWithNewline=true, $WriteScriptType=true, $DeferExecution=false) { // Build an attributes array. $attributes = array(); // Build an attribute for the URI. $attributes['src'] = $URI; // If desired, build an attribute for the media type. if ($WriteScriptType) { $attributes['type'] = 'text/javascript'; } // Build an extra string. $extraString = null; // If desired, build a minimized attribute to defer execution. if ($DeferExecution) { $attributes['defer'] = 'defer'; } // Open the tag. $this->OpenTag('script', false, $attributes, null, $extraString); // Close the tag. $this->CloseTag($EndWithNewline); } /** * Opens a CSS tag, enforcing XHTML conventions. * * This adds a CDATA opening, which is enclosed in CSS comments. * * @see HTPPS_iWebPagePP::OpenCSS() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::WriteNewline() * @uses HTPPS_WebPagePP::OpenCSS() * @uses HTPPS_XHTMLPP::OpenCDATA() */ public function OpenCSS($WriteStyleType=true) { // Open the tag plainly. parent::OpenCSS($WriteStyleType); // Add a CDATA opening within CSS comments. $this->Write('/*'); $this->OpenCDATA(false); $this->Write('*/'); // Write a newline before the CSS code. $this->WriteNewline(); } /** * Closes a CSS tag, enforcing XHTML conventions. * * This adds a CDATA closing, which is enclosed in JavaScript comments. * * @see HTPPS_iWebPagePP::CloseCSS() * * @uses HTPPS_PrettyPrinter::Write() * @uses HTPPS_PrettyPrinter::ClearLine() * @uses HTPPS_WebPagePP::CloseCSS() * @uses HTPPS_XHTMLPP::CloseCDATA() */ public function CloseCSS() { // Clear the line before the CDATA closing. $this->ClearLine(); // Add a CDATA closing within CSS comments. $this->Write('/*'); $this->CloseCDATA(false); $this->Write('*/'); // Close the tag plainly. parent::CloseCSS(); } } // End class HTPPS_XHTMLPP /** * An XHTML 1.0 Strict pretty printer. * * @package HTPPS * @subpackage PrettyPrinters */ class HTPPS_XHTMLv10PP extends HTPPS_XHTMLPP implements HTPPS_iXHTMLPP_v10Plus { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_XHTMLPP::__construct() */ public function __construct() { parent::__construct(new HTPPS_XMLv10TagManager()); } /** * Destructor. * * @uses HTPPS_XHTMLPP::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion * * @return string * The version number in a printable format. */ public function MarkupLanguageVersion() { return '1.0'; } /** * @see HTPPS_iWebPagePP::OpenDocumentWithDefaultSchemata() * * @uses HTPPS_WebPagePP::OpenDocument() */ public function OpenDocumentWithDefaultSchemata(array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { //TODO do $this->OpenDocument(new HTPPS_DocumentSchemata(), 'html', $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } } // End class HTPPS_XHTMLv10PP /** * An XHTML 1.0 Basic pretty printer. * * @package HTPPS * @subpackage PrettyPrinters */ class HTPPS_XHTMLv10BasicPP extends HTPPS_XHTMLPP implements HTPPS_iXHTMLPP_v10Plus { //PUBLIC FUNCTIONS ////////////////// //TODO much more specific behavior /** * Constructor. * * @uses HTPPS_XHTMLPP::__construct() */ public function __construct() { parent::__construct(new HTPPS_XMLv10TagManager()); } /** * Destructor. * * @uses HTPPS_XHTMLPP::__destruct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion */ public function MarkupLanguageVersion() { return '1.0'; } /** * @see HTPPS_iTagManager::MarkupLanguageDialect */ public function MarkupLanguageDialect() { return 'Basic'; } /** * @see HTPPS_iWebPagePP::OpenDocumentWithDefaultSchemata() * * @uses HTPPS_WebPagePP::OpenDocument() */ public function OpenDocumentWithDefaultSchemata(array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { //TODO do $this->OpenDocument(new HTPPS_DocumentSchemata(), 'html', $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } } // End class HTPPS_XHTMLv10BasicPP /** * The abstract base class of all HTML pretty printers. * * @package HTPPS * @subpackage PrettyPrinters */ abstract class HTPPS_HTMLPP extends HTPPS_WebPagePP { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_WebPagePP::__construct() */ public function __construct(HTPPS_iHTMLTagManager $TagManager) { parent::__construct($TagManager); } /** * Destructor. * * @uses HTPPS_WebPagePP::__destruct() */ public function __destruct() { parent::__destruct(); } } // End class HTPPS_HTMLPP /** * Provides access to an HTML pretty printer. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iHTMLPP extends HTPPS_iWebPagePP { } // End interface HTPPS_iHTMLPP /** * Provides access to an HTML pretty printer which has a language version of * at least 4.01. * * This is a nominal interface that may be used to enforce version * requirements. Interfaces for HTML pretty printers with newer language * versions should extend this interface. * * @package HTPPS * @subpackage PrettyPrinters */ interface HTPPS_iHTMLPP_v401Plus extends HTPPS_iHTMLPP { } // End interface HTPPS_iHTMLPP_v401Plus /** * An HTML 4.01 Strict pretty printer. * * @package HTPPS * @subpackage PrettyPrinters */ class HTPPS_HTMLv401PP extends HTPPS_HTMLPP implements HTPPS_iHTMLPP_v401Plus { //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @uses HTPPS_HTMLPP::__construct() */ public function __construct() { parent::__construct(new HTPPS_HTMLv401TagManager()); } /** * Destructor. * * @uses HTPPS_HTMLPP::__construct() */ public function __destruct() { parent::__destruct(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion */ public function MarkupLanguageVersion() { return '4.01'; } /** * @see HTPPS_iWebPagePP::OpenDocumentWithDefaultSchemata() * * @uses HTPPS_WebPagePP::OpenDocument() */ public function OpenDocumentWithDefaultSchemata(array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { //TODO do $this->OpenDocument(new HTPPS_DocumentSchemata(), 'html', $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } } // End class HTPPS_HTMLv401PP /** * A pretty printer whose markup language is interchangeable among those which * write Web pages; the markup language can be automatically chosen to best fit * the client. * * This acts as a proxy for a Web-page pretty printer, which may be chosen and * replaced easily by derived classes. * * @package HTPPS * @subpackage PrettyPrinters */ class HTPPS_VariableMarkupPP implements HTPPS_iWebPagePP { //PRIVATE & PROTECTED DATA ////////////////////////// /** * The Web-page pretty printer for which this object acts as a proxy. * * @var HTPPS_iWebPagePP */ protected $PrettyPrinter; /** * If the pretty printer was computed as a best fit, then this is the * best-fit schemata, else it is null. * * @var HTPPS_DocumentSchemata */ private $BestFitSchemata; //PRIVATE & PROTECTED FUNCTIONS /////////////////////////////// /** * Sets the object-scope pretty printer to the one given. * * The reference to the old pretty printer will be unset, and the new * pretty manager will be used immediately. * * @param PrettyPrinter HTPPS_iWebPagePP * The pretty printer for which this object will act as a proxy. * * @return void */ protected function SetPrettyPrinter(HTPPS_iWebPagePP $PrettyPrinter) { $this->PrettyPrinter = $PrettyPrinter; } /** * Automatically sets the pretty printer and schemata to the ones most * appropriate for the current HTTP request, as determined by * HTPPS_PrettyPrinterCatalogue, and opens the document for writing. * * @return void * * @uses HTPPS_VariableMarkupPP::OpenDocument() * @uses HTPPS_VariableMarkupPP::SetPrettyPrinter() */ protected function AutoSetPrettyPrinter() { //TODO do // Set the pretty printer. $this->SetPrettyPrinter(new HTPPS_XHTMLv10PP()); // Store the most appropriate schemata. $this->BestFitSchemata = new HTPPS_DocumentSchemata(); } //PUBLIC FUNCTIONS ////////////////// /** * Constructor. * * @param PrettyPrinter HTPPS_iWebPagePP * The pretty printer to be used. If this is null, then a pretty * printer will be automatically selected. This behavior will change in * future versions. * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter * @uses HTPPS_VariableMarkupPP::$BestFitSchemata * @uses HTPPS_VariableMarkupPP::SetPrettyPrinter() * @uses HTPPS_VariableMarkupPP::AutoSetPrettyPrinter() */ public function __construct(HTPPS_iWebPagePP $PrettyPrinter=null) { // Initialize object-scope data. $this->PrettyPrinter = null; $this->BestFitSchemata = null; // If a pretty printer is given, set the object-scope reference to it. if ($PrettyPrinter) { $this->SetPrettyPrinter($PrettyPrinter); } // Else automatically select a pretty printer. else { $this->AutoSetPrettyPrinter(); } } /** * Destructor. */ public function __destruct() { } //Magic methods /////////////// /** * Relay function, magically invoked; returns a string representation of * the pretty printer if such a representation exists. * * @return string * The string representation of the object. */ public function __toString() { return $this->PrettyPrinter->__toString(); } /** * Relay function, magically invoked; handles a method call for a method * which is not explicitly defined by this proxy. * * @return mixed * The return value of the call when applied to the proxied object. */ public function __call($MethodName, array $Arguments) { return call_user_func_array(array($this->PrettyPrinter, $MethodName), $Arguments); } /** * Relay function, magically invoked; propety accessor for a property which * is not explicitly defined by this proxy. * * @return mixed * The value of the property. */ public function __get($PropertyName) { return $this->PrettyPrinter->$PropertyName; } /** * Relay function, magically invoked; propety mutator for a property which * is not explicitly defined by this proxy. * * @return void */ public function __set($PropertyName, $PropertyValue) { $this->PrettyPrinter->$PropertyName = $PropertyValue; } //Relay functions ///////////////// /** * @see HTPPS_iTagManager::SetScribe() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function SetScribe(HTPPS_iScribe $Scribe) { return $this->PrettyPrinter->SetScribe($Scribe); } /** * @see HTPPS_iTagManager::ResetScribe() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function ResetScribe() { return $this->PrettyPrinter->ResetScribe(); } /** * @see HTPPS_iTagManager::EscapeForMarkup() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function EscapeForMarkup($Text) { return $this->PrettyPrinter->EscapeForMarkup($Text); } /** * @see HTPPS_iTagManager::EscapeForQuotes() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function EscapeForQuotes($Text, $QuoteCharacter='"') { return $this->PrettyPrinter->EscapeForQuotes($Text, $QuoteCharacter); } /** * @see HTPPS_iTagManager::OpenTag() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTag($Tag, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iTagManager::WriteEmptyTag() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteEmptyTag($Tag, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteEmptyTag($Tag, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iTagManager::MostRecentTag() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MostRecentTag() { return $this->PrettyPrinter->MostRecentTag(); } /** * @see HTPPS_iTagManager::TagDepth() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function TagDepth() { return $this->PrettyPrinter->TagDepth(); } /** * @see HTPPS_iTagManager::IncreaseIndentationLevel() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IncreaseIndentationLevel($Amount=1) { return $this->PrettyPrinter->IncreaseIndentationLevel($Amount); } /** * @see HTPPS_iTagManager::DecreaseIndentationLevel() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function DecreaseIndentationLevel($Amount=1) { return $this->PrettyPrinter->DecreaseIndentationLevel($Amount); } /** * @see HTPPS_iTagManager::SetIndentationLevel() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function SetIndentationLevel($IndentationLevel) { return $this->PrettyPrinter->SetIndentationLevel($IndentationLevel); } /** * @see HTPPS_iTagManager::CloseTag() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTag($EndWithNewlines=true, $SearchTag=null, $StopBeforeSearchTag=null) { return $this->PrettyPrinter->CloseTag($EndWithNewlines, $SearchTag, $StopBeforeSearchTag); } /** * @see HTPPS_iTagManager::CloseTags() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTags($Number, $EndWithNewlines=true) { return $this->PrettyPrinter->CloseTags($Number, $EndWithNewlines); } /** * @see HTPPS_iTagManager::CloseTagsToDepth() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTagsToDepth($TagDepth, $EndWithNewlines=true) { return $this->PrettyPrinter->CloseTagsToDepth($Number, $EndWithNewlines); } /** * @see HTPPS_iTagManager::CloseAllTags() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseAllTags($CloseSystemTags=false) { return $this->PrettyPrinter->CloseAllTags($CloseSystemTags); } /** * @see HTPPS_iTagManager::OpenComment() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenComment() { return $this->PrettyPrinter->OpenComment(); } /** * @see HTPPS_iTagManager::CloseComment() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseComment($EndWithNewline=true) { return $this->PrettyPrinter->CloseComment($EndWithNewline); } /** * @see HTPPS_iTagManager::WriteComment() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteComment($Text, $EndWithNewline=true) { return $this->PrettyPrinter->WriteComment($Text, $EndWithNewline); } /** * @see HTPPS_iTagManager::Write() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function Write($Text) { return $this->PrettyPrinter->Write($Text); } /** * @see HTPPS_iTagManager::WriteUnindented() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteUnindented($Text) { return $this->PrettyPrinter->WriteUnindented($Text); } /** * @see HTPPS_iTagManager::WriteNewline() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteNewline() { return $this->PrettyPrinter->WriteNewline(); } /** * @see HTPPS_iTagManager::ClearLine() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function ClearLine() { return $this->PrettyPrinter->ClearLine(); } /** * @see HTPPS_iTagManager::SkipLine() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function SkipLine($Number=1) { return $this->PrettyPrinter->SkipLine($Number); } /** * @see HTPPS_iTagManager::WriteAndEscape() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteAndEscape($Text) { return $this->PrettyPrinter->WriteAndEscape($Text); } /** * @see HTPPS_iTagManager::WriteBlock() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteBlock($Text) { return $this->PrettyPrinter->WriteBlock($Text); } /** * @see HTPPS_iTagManager::WriteBlockIndented() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteBlockIndented(array $TextLines) { return $this->PrettyPrinter->WriteBlockIndented($TextLines); } /** * @see HTPPS_iTagManager::BeginDocumentContentTags() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function BeginDocumentContentTags() { return $this->PrettyPrinter->BeginDocumentContentTags(); } /** * @see HTPPS_iTagManager::OpenDocumentTags() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDocumentTags($RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { return $this->PrettyPrinter ->OpenDocumentTags($RootElementTag, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } /** * @see HTPPS_iTagManager::CloseDocumentTags() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseDocumentTags() { return $this->PrettyPrinter->CloseDocumentTags(); } /** * @see HTPPS_iTagManager::MarkupLanguageCode() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MarkupLanguageCode() { return $this->PrettyPrinter->MarkupLanguageCode(); } /** * @see HTPPS_iTagManager::MarkupLanguageName() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MarkupLanguageName() { return $this->PrettyPrinter->MarkupLanguageName(); } /** * @see HTPPS_iTagManager::MarkupLanguageVersion() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MarkupLanguageVersion() { return $this->PrettyPrinter->MarkupLanguageVersion(); } /** * @see HTPPS_iTagManager::MarkupLanguageDialect() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MarkupLanguageDialect() { return $this->PrettyPrinter->MarkupLanguageDialect(); } /** * @see HTPPS_iTagManager::MarkupLanguage() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function MarkupLanguage() { return $this->PrettyPrinter->MarkupLanguage(); } /** * @see HTPPS_iTagManager::IsXML() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IsXML() { return $this->PrettyPrinter->IsXML(); } /** * @see HTPPS_iTagManager::IsHTML() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IsHTML() { return $this->PrettyPrinter->IsHTML(); } /** * @see HTPPS_iPrettyPrinter::TagManager() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function TagManager(HTPPS_iTagManager $TagManager=null) { return $this->PrettyPrinter->TagManager($TagManager); } /** * @see HTPPS_iPrettyPrinter::SetTagManager() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function SetTagManager(HTPPS_iTagManager $TagManager) { return $this->PrettyPrinter->SetTagManager($TagManager); } /** * @see HTPPS_iPrettyPrinter::WriteTagAndContents() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteTagAndContents($Tag, $WriteNewlineAfterOpening, $WriteNewlineAfterClosing, $Text, $EscapeText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteTagAndContents($Tag, $WriteNewlineAfterOpening, $WriteNewlineAfterClosing, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iPrettyPrinter::OpenDocument() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDocument(HTPPS_DocumentSchemata $Schemata, $RootElementTag, array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { return $this->PrettyPrinter ->OpenDocument($Schemata, $RootElementTag, $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } /** * @see HTPPS_iPrettyPrinter::OpenDocumentWithDefaultSchemata() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDocumentWithDefaultSchemata(array $RootElementAttributes=array(), $RootElementOneAttributePerLine=false, $RootElementExtraString=null) { // If a best-fit schemata of a best-fit pretty printer was computed, // use it. if ($this->BestFitSchemata) { return $this->PrettyPrinter ->OpenDocument($this->BestFitSchemata, 'html', $RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } // Else use the default schemata of the pretty printer. else { return $this->PrettyPrinter ->OpenDocumentWithDefaultSchemata ($RootElementAttributes, $RootElementOneAttributePerLine, $RootElementExtraString); } } /** * @see HTPPS_iPrettyPrinter::CloseDocument() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseDocument() { return $this->PrettyPrinter->CloseDocument(); } /** * @see HTPPS_iPrettyPrinter::DocumentIsOpen() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function DocumentIsOpen() { return $this->PrettyPrinter->DocumentIsOpen(); } /** * @see HTPPS_iPrettyPrinter::IsXHTML() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IsXHTML() { return $this->PrettyPrinter->IsXHTML(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponseCode() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponseCode($StatusCode, $ReasonPhrase=null) { return $this->PrettyPrinter->WriteHTTPResponseCode($StatusCode, $ReasonPhrase); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponseHeader() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponseHeader($Name, $Value, $ReplaceExisting=true, $StatusCode=null) { return $this->PrettyPrinter->WriteHTTPResponseHeader($Name, $Value, $ReplaceExisting, $StatusCode); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl($Directive) { return $this->PrettyPrinter ->WriteHTTPResponse_CacheControl($Directive); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_Public() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl_Public() { return $this->PrettyPrinter->WriteHTTPResponse_CacheControl_Public(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_Private() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl_Private() { return $this->PrettyPrinter->WriteHTTPResponse_CacheControl_Private(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_MustRevalidate() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl_MustRevalidate() { return $this->PrettyPrinter ->WriteHTTPResponse_CacheControl_MustRevalidate(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_NoCache() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl_NoCache() { return $this->PrettyPrinter->WriteHTTPResponse_CacheControl_NoCache(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_CacheControl_NoStore() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_CacheControl_NoStore() { return $this->PrettyPrinter->WriteHTTPResponse_CacheControl_NoStore(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentType() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentType($Type) { return $this->PrettyPrinter->WriteHTTPResponse_ContentType(); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentEncoding() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentEncoding($Encoding) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentEncoding($Encoding); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentLanguage() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentLanguage($LanguageCodes) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentLanguage($LanguageCodes); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentLength() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentLength($LengthInBytes) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentLength($LengthInBytes); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDisposition() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentDisposition($Disposition) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentDisposition($Disposition); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDisposition_Attachment() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentDisposition_Attachment($Filename, $CreationDate=null, $ModificationDate=null, $SizeInBytes=null) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentDisposition_Attachment ($Filename, $CreationDate, $ModificationDate, $SizeInBytes); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ContentDescription() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ContentDescription($Description) { return $this->PrettyPrinter ->WriteHTTPResponse_ContentDescription($Description); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_ETag() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_ETag($ETag) { return $this->PrettyPrinter->WriteHTTPResponse_ETag($ETag); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Expires() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_Expires($Date) { return $this->PrettyPrinter->WriteHTTPResponse_Expires($Date); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Expires_NowPlus() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_Expires_NowPlus($SecondsFromNow) { return $this->PrettyPrinter->WriteHTTPResponse_Expires_NowPlus ($SecondsFromNow); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_LastModified() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_LastModified($Date) { return $this->PrettyPrinter->WriteHTTPResponse_LastModified($Date); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_LastModified_NowMinus() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_LastModified_NowMinus($SecondsAgo) { return $this->PrettyPrinter->WriteHTTPResponse_LastModified_NowMinus ($SecondsAgo); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Location() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_Location($URI, $HTTPStatusCode=null) { return $this->PrettyPrinter->WriteHTTPResponse_Location ($URI, $HTTPStatusCode=null); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Pragma() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_Pragma($Directive) { return $this->PrettyPrinter->WriteHTTPResponse_Pragma($Directive); } /** * @see HTPPS_iWebPagePP::WriteHTTPResponse_Vary() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTTPResponse_Vary($Directive) { return $this->PrettyPrinter->WriteHTTPResponse_Vary($Directive); } /** * @see HTPPS_iWebPagePP::OpenHead() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHead() { return $this->PrettyPrinter->OpenHead(); } /** * @see HTPPS_iWebPagePP::WriteMeta() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta($Name=null, $Content=null, $HTTPEquiv=null, $Scheme=null) { return $this->PrettyPrinter->WriteMeta($Name, $Content, $HTTPEquiv, $Scheme); } /** * @see HTPPS_iWebPagePP::WriteMeta_ContentType() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta_ContentType($MediaType, $CharsetEncoding) { return $this->PrettyPrinter->WriteMeta_ContentType($MediaType, $CharsetEncoding); } /** * @see HTPPS_iWebPagePP::WriteMeta_Keywords() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta_Keywords($Keywords) { return $this->PrettyPrinter->WriteMeta_Keywords($Keywords); } /** * @see HTPPS_iWebPagePP::WriteMeta_Description() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta_Description($Description) { return $this->PrettyPrinter->WriteMeta_Description($Description); } /** * @see HTPPS_iWebPagePP::WriteMeta_Language() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta_Language($LanguageCodes) { return $this->PrettyPrinter->WriteMeta_Language($LanguageCodes); } /** * @see HTPPS_iWebPagePP::WriteMeta_Robots() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteMeta_Robots($Directive) { return $this->PrettyPrinter->WriteMeta_Robots($Directive); } /** * @see HTPPS_iWebPagePP::DeclareDefaultStyleLanguage() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function DeclareDefaultStyleLanguage($StyleType=null) { return $this->PrettyPrinter->DeclareDefaultStyleLanguage($StyleType); } /** * @see HTPPS_iWebPagePP::DeclareDefaultScriptingLanguage() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function DeclareDefaultScriptingLanguage($ScriptType=null) { return $this->PrettyPrinter ->DeclareDefaultScriptingLanguage($ScriptType); } /** * @see HTPPS_iWebPagePP::WriteTitle() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteTitle($Text, $EscapeText=true) { return $this->PrettyPrinter->WriteTitle($Text, $EscapeText); } /** * @see HTPPS_iWebPagePP::WriteHeadLink() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHeadLink(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHeadLink($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::LinkToIcon() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function LinkToIcon($URI, $MediaType=null) { return $this->PrettyPrinter->LinkToIcon($URI, $MediaType); } /** * @see HTPPS_iWebPagePP::IncludeCSS() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IncludeCSS($URI, $Media=null, $StylesheetTitle=null, $IsAlternateStylesheet=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->IncludeCSS($URI, $Media, $StylesheetTitle, $IsAlternateStylesheet, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::IncludeJavaScript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function IncludeJavaScript($URI, $WriteScriptType=true, $DeferExecution=false) { return $this->PrettyPrinter->IncludeJavaScript($URI, $WriteScriptType, $DeferExecution); } /** * @see HTPPS_iWebPagePP::LinkToRSSFeed() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function LinkToRSSFeed($URI, $Title=null) { return $this->PrettyPrinter->LinkToRSSFeed($URI, $Title); } /** * @see HTPPS_iWebPagePP::LinkToAtomFeed() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function LinkToAtomFeed($URI, $Title=null) { return $this->PrettyPrinter->LinkToAtomFeed($URI, $Title); } /** * @see HTPPS_iWebPagePP::WriteURIBasePath() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteURIBasePath($URI) { return $this->PrettyPrinter->WriteURIBasePath($URI); } /** * @see HTPPS_iWebPagePP::OpenBody() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenBody($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHeadAndOpenBody() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHeadAndOpenBody($Title, $IconURI=null, array $CSSURIs=null, array $HeadJavaScriptURIs=null, $FlushTransmissionBeforeBody=true, array $BodyAttributes=array(), $BodyOneAttributePerLine=false, $BodyExtraString=null) { return $this->PrettyPrinter ->WriteHeadAndOpenBody($Title, $IconURI, $CSSURIs, $HeadJavaScriptURIs, $FlushTransmissionBeforeBody, $BodyAttributes, $BodyOneAttributePerLine, $BodyExtraString); } /** * @see HTPPS_iWebPagePP::OpenDiv() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDiv($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenDiv($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDiv() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteDiv($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteDiv($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSpan() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenSpan(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenSpan($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSpan() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteSpan($Text, $EscapeText=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteSpan($Text, $EscapeText, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHeading() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHeading($HeadingLevel=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenHeading($HeadingLevel, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHeading() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHeading($Text, $EscapeText=true, $HeadingLevel=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHeading($Text, $EscapeText, $HeadingLevel, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHR() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHR($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteBR() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteBR($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteBR($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteNBSP() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteNBSP($Number=1) { return $this->PrettyPrinter->WriteNBSP($Number); } /** * @see HTPPS_iWebPagePP::OpenStrong() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenStrong(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenStrong($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteStrong() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteStrong($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteStrong($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenEmphasized() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenEmphasized(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenEmphasized($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteEmphasized() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteEmphasized($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteEmphasized($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenParagraph() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenParagraph($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenParagraph($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteParagraph() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteParagraph($Text, $EscapeText=true, $PrecedeWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteParagraph($Text, $EscapeText, $PrecedeWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSubscript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenSubscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenSubscript($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSubscript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteSubscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteSubscript($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenSuperscript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenSuperscript(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenSuperscript($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteSuperscript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteSuperscript($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteSuperscript($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenQuote() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenQuote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenQuote($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteQuote() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteQuote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteQuote($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenBlockquote() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenBlockquote(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenBlockquote($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteBlockquote() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteBlockquote($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteBlockquote($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenComputerCode() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenComputerCode($ComputerLanguageName=null, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenComputerCode($ComputerLanguageName, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteComputerCode() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteComputerCode($Text, $ComputerLanguageName=null, $ConvertNewlinesToBRs=true, $PrecedeWithNewline=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteComputerCode($Text, $ComputerLanguageName, $ConvertNewlinesToBRs, $PrecedeWithNewline, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteAcronym() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteAcronym($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteAcronym($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteAbbreviation() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteAbbreviation($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteAbbreviation($AbbreviatedText, $ExpandedText, $EscapeAbbreviatedText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenLink() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenLink($Location, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenLink($Location, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteAnchor() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteAnchor($ID, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteAnchor($ID, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteLink() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteLink($Location, $Text, $EscapeText=true, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteLink($Location, $Text, $EscapeText, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteImage() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteImage($URI, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteImage($URI, $AlternateText, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteImageFromBase64() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteImageFromBase64($Base64Encoding, $ImageMediaType, $AlternateText=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { return $this->PrettyPrinter->WriteImageFromBase64($Base64Encoding, $ImageMediaType, $AlternateText, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenListItem() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenListItem($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenListItem($EnsureProperContext, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteListItem() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteListItem($Text, $EscapeText=true, $EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteListItem($Text, $EscapeText, $EnsureProperContext, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenUnorderedList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenUnorderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenUnorderedList($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteUnorderedList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteUnorderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { return $this->PrettyPrinter ->WriteUnorderedList($ListAttributes, $ListOneAttributePerLine, $ListExtraString, $ItemsText, $EscapeItemsText, $ItemsAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } /** * @see HTPPS_iWebPagePP::OpenOrderedList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenOrderedList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenOrderedList($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteOrderedList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteOrderedList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $ItemsText=array(), $EscapeItemsText=true, array $ItemsAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { return $this->PrettyPrinter ->WriteOrderedList($ListAttributes, $ListOneAttributePerLine, $ListExtraString, $ItemsText, $EscapeItemsText, $ItemsAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } /** * @see HTPPS_iWebPagePP::OpenDefinitionListTerm() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDefinitionListTerm(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenDefinitionListTerm($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDefinitionListTerm() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteDefinitionListTerm($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteDefinitionListTerm($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenDefinitionListDefinition() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDefinitionListDefinition(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenDefinitionListDefinition($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDefinitionListDefinition() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteDefinitionListDefinition($Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteDefinitionListDefinition($Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenDefinitionList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenDefinitionList(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenDefinitionList($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteDefinitionList() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteDefinitionList(array $ListAttributes=array(), $ListOneAttributePerLine=false, $ListExtraString=null, array $TermsToDefinitionsText=array(), $EscapeTermsText=true, array $TermsAttributes=array(), $TermsOneAttributePerLine=false, $TermsExtraString=null, $EscapeDefinitionsText=true, array $DefinitionsAttributes=array(), $DefinitionsOneAttributePerLine=false, $DefinitionsExtraString=null) { return $this->PrettyPrinter ->WriteDefinitionList($ListAttributes, $ListOneAttributePerLine, $ListExtraString, $TermsToDefinitionsText, $EscapeTermsText, $TermsAttributes, $TermsOneAttributePerLine, $TermsExtraString, $EscapeDefinitionsText, $DefinitionsAttributes, $DefinitionsOneAttributePerLine, $DefinitionsExtraString); } /** * @see HTPPS_iWebPagePP::OpenTable() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTable(array $TableAttributes=array(), $TableOneAttributePerLine=false, $TableExtraString=null, $CaptionText=null, $EscapeCaptionText=true, array $CaptionAttributes=array(), $CaptionOneAttributePerLine=false, $CaptionExtraString=null) { return $this->PrettyPrinter->OpenTable($TableAttributes, $TableOneAttributePerLine, $TableExtraString, $CaptionText, $EscapeCaptionText, $CaptionAttributes, $CaptionOneAttributePerLine, $CaptionExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableHead() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableHead(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableHead($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableFoot() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableFoot(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableFoot($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableBody() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableBody(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableBody($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableColumnGroup() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableColumnGroup($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableColumnGroup($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteTableColumn() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteTableColumn($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteTableColumn($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableRow() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableRow($EnsureProperContext=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableRow($EnsureProperContext, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableCell() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableCell($ColumnSpan=null, $RowSpan=null, $EnsureProperContext=true, $EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableCell($ColumnSpan, $RowSpan, $EnsureProperContext, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenTableHeading() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenTableHeading($EndWithNewline=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenTableHeading($EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::CloseTable() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTable($EndWithNewline=true) { return $this->PrettyPrinter->CloseTable($EndWithNewline); } /** * @see HTPPS_iWebPagePP::CloseTableRow() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTableRow($EndWithNewline=true) { return $this->PrettyPrinter->CloseTableRow($EndWithNewline); } /** * @see HTPPS_iWebPagePP::CloseTableCell() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseTableCell($EndWithNewline=true) { return $this->PrettyPrinter->CloseTableCell($EndWithNewline); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm($ProcessingPageLocation, $RequestMethod, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenHTMLForm($ProcessingPageLocation, $RequestMethod, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_FieldSet() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm_FieldSet($LegendText=null, $EscapeLegendText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenHTMLForm_FieldSet($LegendText, $EscapeLegendText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_TextBox() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_TextBox($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_TextBox($Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Password() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Password($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_Password($Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_TextArea() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_TextArea($Name, $Value=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_TextArea($Name, $Value, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_CheckBox() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_CheckBox($Name, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_CheckBox($Name, $Value, $Checked, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_RadioButton() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_RadioButton($GroupName, $Value, $Checked=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_RadioButton($GroupName, $Value, $Checked, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_RadioButtons() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_RadioButtons($GroupName, array $ValuesAndLabelTexts, $CheckedValue=null, $EscapeLabelTexts=true, $SeparateWithLineBreaks=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_RadioButtons($GroupName, $ValuesAndLabelTexts, $CheckedValue, $EscapeLabelTexts, $SeparateWithLineBreaks, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenu() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenHTMLForm_DropDownMenu($Name, $IsMultipleSelector, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenuItemGroup() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm_DropDownMenuItemGroup($LabelText, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenHTMLForm_DropDownMenuItemGroup($LabelText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_DropDownMenuItem() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm_DropDownMenuItem($Value, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->OpenHTMLForm_DropDownMenuItem($Value, $Selected, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_DropDownMenuItem() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_DropDownMenuItem($Value, $Text, $EscapeText=true, $Selected=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_DropDownMenuItem($Value, $Text, $EscapeText, $Selected, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_DropDownMenu() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_DropDownMenu($Name, $IsMultipleSelector=false, array $ValuesAndLabelTexts, $SelectedValue=null, $EscapeLabelTexts=true, array $MenuAttributes=array(), $MenuOneAttributePerLine=false, $MenuExtraString=null, array $ItemAttributes=array(), $ItemsOneAttributePerLine=false, $ItemsExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_DropDownMenu($Name, $IsMultipleSelector, $ValuesAndLabelTexts, $SelectedValue, $EscapeLabelTexts, $MenuAttributes, $MenuOneAttributePerLine, $MenuExtraString, $ItemAttributes, $ItemsOneAttributePerLine, $ItemsExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_File() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_File($Name, $DefaultPath=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHTMLForm_File($Name, $DefaultPath, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenHTMLForm_Label() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenHTMLForm_Label($FormControlID=null, $EndWithNewline=false, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenHTMLForm_Label($FormControlID, $EndWithNewline, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Label() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Label($FormControlID, $Text, $EscapeText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHTMLForm_Label($FormControlID, $Text, $EscapeText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Hidden() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Hidden($Name, $Value) { return $this->PrettyPrinter->WriteHTMLForm_Hidden($Name, $Value); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Button() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Button($Text, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHTMLForm_Button($Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_ImageButton() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_ImageButton($Name, $ImageURI, $AlternateText=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter ->WriteHTMLForm_ImageButton($Name, $ImageURI, $AlternateText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Reset() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Reset($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHTMLForm_Reset($Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteHTMLForm_Submit() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteHTMLForm_Submit($Text=null, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteHTMLForm_Submit($Text, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::CloseHTMLForm() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseHTMLForm() { return $this->PrettyPrinter->CloseHTMLForm(); } /** * @see HTPPS_iWebPagePP::OpenObject() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenObject(array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->OpenObject($Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteObjectParameter() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteObjectParameter($Name, $Value, $ValueType=null, $ContentType=null) { return $this->PrettyPrinter->WriteObjectParameter($Name, $Value, $ValueType, $ContentType); } /** * @see HTPPS_iWebPagePP::EmbedDocument() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function EmbedDocument($URI, $ContentType=null, $AlternateText=null, $EscapeAlternateText=true, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->EmbedDocument($URI, $ContentType, $AlternateText, $EscapeAlternateText, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteIFrame() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteIFrame($URI, array $Attributes=array(), $OneAttributePerLine=false, $ExtraString=null) { return $this->PrettyPrinter->WriteIFrame($URI, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenFlashEmbed() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenFlashEmbed($URI, $Width=null, $Height=null, array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { return $this->PrettyPrinter->OpenFlashEmbed($URI, $Width, $Height, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::WriteFlashParameter() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function WriteFlashParameter($Name, $Value) { return $this->PrettyPrinter->WriteFlashParameter($Name, $Value); } /** * @see HTPPS_iWebPagePP::EmbedFlash() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function EmbedFlash($URI, $Width=null, $Height=null, array $SWFParameters=array(), array $Attributes=array(), $OneAttributePerLine=true, $ExtraString=null) { return $this->PrettyPrinter->EmbedFlash($URI, $Width, $Height, $SWFParameters, $Attributes, $OneAttributePerLine, $ExtraString); } /** * @see HTPPS_iWebPagePP::OpenJavaScript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenJavaScript($EndWithNewline=true, $WriteScriptType=true) { return $this->PrettyPrinter->OpenJavaScript($EndWithNewline, $WriteScriptType); } /** * @see HTPPS_iWebPagePP::CloseJavaScript() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseJavaScript($EndWithNewline=true) { return $this->PrettyPrinter->CloseJavaScript($EndWithNewline); } /** * @see HTPPS_iWebPagePP::LoadJavaScriptFile() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function LoadJavaScriptFile($URI, $EndWithNewline=true, $WriteScriptType=true, $DeferExecution=false) { return $this->PrettyPrinter->LoadJavaScriptFile($URI, $EndWithNewline, $WriteScriptType, $DeferExecution); } /** * @see HTPPS_iWebPagePP::LoadJavaScriptFileAtEnd() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function LoadJavaScriptFileAtEnd($URI, $WriteScriptType=true, $DeferExecution=false) { return $this->PrettyPrinter->LoadJavaScriptFileAtEnd($URI, $WriteScriptType, $DeferExecution); } /** * @see HTPPS_iWebPagePP::OpenCSS() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function OpenCSS($WriteStyleType=true) { return $this->PrettyPrinter->OpenCSS($WriteStyleType); } /** * @see HTPPS_iWebPagePP::CloseCSS() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function CloseCSS() { return $this->PrettyPrinter->CloseCSS(); } /** * @see HTPPS_iWebPagePP::JavaScript_GoBack() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function JavaScript_GoBack($DelayInSeconds=null) { return $this->PrettyPrinter->JavaScript_GoBack($DelayInSeconds); } /** * @see HTPPS_iWebPagePP::JavaScript_Redirect() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function JavaScript_Redirect($Location, $DelayInSeconds=null) { return $this->PrettyPrinter->JavaScript_Redirect($Location, $DelayInSeconds); } /** * @see HTPPS_iWebPagePP::FlushTransmission() * * @uses HTPPS_VariableMarkupPP::$PrettyPrinter */ public function FlushTransmission() { return $this->PrettyPrinter->FlushTransmission(); } } // End class HTPPS_VariableMarkupPP //TODO Remove. // Use any one of these by building it and setting $page equal to it: //$htmlPP = new HTPPS_HTMLv401PP(); //$xhtmlPP = new HTPPS_XHTMLv10PP(); //$varPP = new HTPPS_VariableMarkupPP(); // Example scribe use: //$htmlPP->SetScribe(new HTPPS_CompactFileScribe('testPage.html')); // Use $page by uncommenting these lines. //$page = $htmlPP; //$page->OpenDocumentWithDefaultSchemata(); ?>