<?xml version="1.0"?><phpdoc><class name="IntegratedTemplate" extends="" undoc="false" access="public" package="PHPDoc"><file>c:/www/apache/doc2//redist/IT.php</file><doc><author email="uw@netuse.de">Ulf Wendel</author><description>Well there&amp;apos;s not much to say about it. I needed a template class thatsupports a single template file with multiple (nested) blocks inside.Usage:$tpl = new IntegratedTemplate( [string filerootdir] );// load a template or set it with setTemplate()$tpl-&amp;gt;loadTemplatefile( string filename [, boolean removeUnknownVariables, boolean removeEmptyBlocks] )// set &amp;quot;global&amp;quot; Variables meaning variables not beeing within a (inner) block$tpl-&amp;gt;setVariable( string variablename, mixed value );// like with the Isotopp Templates there&amp;apos;s a second way to use setVariable()$tpl-&amp;gt;setVariable( array ( string varname =&amp;gt; mixed value ) );// Let&amp;apos;s use any block, even a deeply nested one$tpl-&amp;gt;setCurrentBlock( string blockname );// repeat this as often as you neer.$tpl-&amp;gt;setVariable( array ( string varname =&amp;gt; mixed value ) );$tpl-&amp;gt;parseCurrentBlock();// get the parsed template or print it: $tpl-&amp;gt;show()$tpl-&amp;gt;get();</description><shortdescription>Integrated Template - IT</shortdescription><version>$Id: $</version></doc><function name="IntegratedTemplate" undoc="false" access="public"><doc><see type="function">setRoot()</see><parameter name="$root" default="&amp;quot;&amp;quot;" type="string">root directory, prefix for all filenames given to the object.</parameter><return type="void"/><description>Make sure that you call this constructor if you derive your templateclass from this one.</description><shortdescription>Builds some complex regular expressions and optinally sets the file root directory.</shortdescription></doc></function><function name="show" undoc="false" access="private"><doc><see type="function">show()</see><parameter name="$block" default="&amp;quot;__global__&amp;quot;" type="string">of the block</parameter><return type="void"/><description/><shortdescription>Print a certain block with all replacements done.</shortdescription><brother>get</brother></doc></function><function name="get" undoc="false" access="public"><doc><see type="function">show()</see><parameter name="$block" default="&amp;quot;__global__&amp;quot;" type="string">of the block</parameter><return name="" type="string"/><description/><shortdescription>Returns a block with all replacements done.</shortdescription></doc></function><function name="parse" undoc="false" access="public"><doc><see type="function">parseCurrentBlock()</see><parameter name="$block" default="&amp;quot;__global__&amp;quot;" type="string">of the block to be parsed</parameter><parameter name="$flag_recursion" type="boolean" undoc="true"/><return type="void"/><description/><shortdescription>Parses the given block.</shortdescription></doc></function><function name="parseCurrentBlock" undoc="false" access="public"><doc><see type="function">parse()</see><see type="function">setCurrentBlock()</see><see type="var">$currentBlock</see><return type="void"/><description/><shortdescription>Parses the current block</shortdescription></doc></function><function name="setVariable" undoc="false" access="public"><doc><parameter name="$variable" type="mixed">with the variable name or an array %variables[&amp;quot;varname&amp;quot;] = &amp;quot;value&amp;quot;</parameter><return type="void"/><description>The function can be used eighter like setVariable( &amp;quot;varname&amp;quot;, &amp;quot;value&amp;quot;)or with one array $variables[&amp;quot;varname&amp;quot;] = &amp;quot;value&amp;quot; given setVariable($variables)quite like phplib templates set_var().</description><shortdescription>Sets a variable value.</shortdescription></doc></function><function name="setCurrentBlock" undoc="false" access="public"><doc><parameter name="$block" default="&amp;quot;__global__&amp;quot;" type="string">of the block</parameter><return name="" type="boolean">false on failure otherwise true</return><description/><shortdescription>Sets the name of the current block that is the block where variables are added.</shortdescription></doc></function><function name="init" undoc="false" access="public"><doc><see type="function">free()</see><return type="void"/><description>LoadTemplatefile() and setTemplate() automatically call this functionwhen a new template is given. Don&amp;apos;t use this functionunless you know what you&amp;apos;re doing.</description><shortdescription>Clears all datafields of the object and rebuild the internal blocklist</shortdescription></doc></function><function name="free" undoc="false" access="public"><doc><see type="function">init()</see><return type="void"/><description>Don&amp;apos;t use this function unless you know what you&amp;apos;re doing.</description><shortdescription>Clears all datafields of the object.</shortdescription></doc></function><function name="setTemplate" undoc="false" access="public"><doc><see type="function">LoadTemplatefile()</see><see type="var">$template</see><parameter name="$template" type="string">content</parameter><return type="void"/><description>You can eighter load a template file from disk with LoadTemplatefile() or set thetemplate manually using this function.</description><shortdescription>Sets the template.</shortdescription></doc></function><function name="loadTemplatefile" undoc="false" access="public"><doc><see type="var">$template</see><see type="function">setTemplate()</see><parameter name="$filename" type="string">of the template file, full path!</parameter><parameter name="$removeUnknownVariables" default="true" type="boolean">unknown/unused variables?</parameter><parameter name="$removeEmptyBlocks" default="true" type="boolean">empty blocks?</parameter><return name="" type="boolean">false on failure, otherwise true</return><description/><shortdescription>Reads a template file from the disk.</shortdescription></doc></function><function name="setRoot" undoc="false" access="public"><doc><see type="function">IntegratedTemplate()</see><parameter name="$root" type="string"/><return type="void"/><description>Make sure that you override this function when using the classon windows.</description><shortdescription>Sets the file root. The file root gets prefixed to all filenames passed to the object.</shortdescription></doc></function><function name="buildBlockvariablelist" undoc="false" access="private"><doc><return type="void"/><description/><shortdescription>Build a list of all variables within a block</shortdescription></doc></function><function name="getGlobalvariables" undoc="false" access="private"><doc><return type="void"/><description/><shortdescription>Returns a list of all</shortdescription></doc></function><function name="findBlocks" undoc="false" access="private"><doc><see type="var">$blocklist</see><parameter name="$string" type="string">that gets scanned</parameter><return type="void"/><description/><shortdescription>Recusively builds a list of all blocks within the template.</shortdescription></doc></function><function name="getFile" undoc="false" access="private"><doc><parameter name="$filename" type="string"/><return name="" type="string">Filecontent </return><description/><shortdescription>Reads a file from disk and returns its content.</shortdescription></doc></function><function name="halt" undoc="false" access="private"><doc><see type="var">$err</see><parameter name="$message" type="string">message</parameter><parameter name="$file" default="&amp;quot;&amp;quot;" type="mixed">where the error occured</parameter><parameter name="$line" default="0" type="integer">where the error occured</parameter><return type="void"/><description/><shortdescription>Error Handling function.</shortdescription></doc></function><variable name="$err" access="public" type="array">array()<doc><see type="function">halt()</see><see type="var">$printError</see><see type="var">$haltOnError</see><description/><shortdescription>Contains the error objects</shortdescription></doc></variable><variable name="$printError" access="public" type="boolean">false<doc><see type="function">halt()</see><see type="var">$haltOnError</see><see type="var">$err</see><description/><shortdescription>Print error messages?</shortdescription></doc></variable><variable name="$haltOnError" access="public" type="boolean">false<doc><see type="function">halt()</see><see type="var">$printError</see><see type="var">$err</see><description/><shortdescription>Call die() on error?</shortdescription></doc></variable><variable name="$clearCache" access="private" type="boolean">false<doc><description/><shortdescription>Clear cache on get()?</shortdescription></doc></variable><variable name="$openingDelimiter" access="public" type="string">&amp;quot;{&amp;quot;<doc><see type="var">$closingDelimiter</see><see type="var">$blocknameRegExp</see><see type="var">$variablenameRegExp</see><description/><shortdescription>First character of a variable placeholder ( _{_VARIABLE} ).</shortdescription></doc></variable><variable name="$closingDelimiter" access="public" type="string">&amp;quot;}&amp;quot;<doc><see type="var">$openingDelimiter</see><see type="var">$blocknameRegExp</see><see type="var">$variablenameRegExp</see><description/><shortdescription>Last character of a variable placeholder ( {VARIABLE_}_ ).</shortdescription></doc></variable><variable name="$blocknameRegExp" access="public" type="string">&amp;quot;[0-9A-Za-z_-]+&amp;quot;<doc><see type="var">$variablenameRegExp</see><see type="var">$openingDelimiter</see><see type="var">$closingDelimiter</see><description>Per default &amp;quot;sm&amp;quot; is used as the regexp modifier, &amp;quot;i&amp;quot; is missing.That means a case sensitive search is done.</description><shortdescription>RegExp matching a block in the template.</shortdescription></doc></variable><variable name="$variablenameRegExp" access="public" type="string">&amp;quot;[0-9A-Za-z_-]+&amp;quot;<doc><see type="var">$blocknameRegExp</see><see type="var">$openingDelimiter</see><see type="var">$closingDelimiter</see><description>Per default &amp;quot;sm&amp;quot; is used as the regexp modifier, &amp;quot;i&amp;quot; is missing.That means a case sensitive search is done.</description><shortdescription>RegExp matching a variable placeholder in the template.</shortdescription></doc></variable><variable name="$variablesRegExp" access="private" type="string">&amp;quot;&amp;quot;<doc><see type="function">IntegratedTemplate()</see><description/><shortdescription>Full RegExp used to find variable placeholder, filled by the constructor.</shortdescription></doc></variable><variable name="$blockRegExp" access="private" type="string">&amp;quot;&amp;quot;<doc><see type="function">IntegratedTemplate()</see><description/><shortdescription>Full RegExp used to find blocks an their content, filled by the constructor.</shortdescription></doc></variable><variable name="$currentBlock" access="private" type="string">&amp;quot;__global__&amp;quot;<doc><description/><shortdescription>Name of the current block.</shortdescription></doc></variable><variable name="$template" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>Content of the template.</shortdescription></doc></variable><variable name="$blocklist" access="private" type="array">array()<doc><see type="function">findBlocks()</see><description/><shortdescription>Array of all blocks and their content.</shortdescription></doc></variable><variable name="$blockdata" access="private" type="array">array()<doc><description/><shortdescription>Array with the parsed content of a block.</shortdescription></doc></variable><variable name="$blockvariables" access="private" type="array">array()<doc><description/><shortdescription>Array of variables in a block.</shortdescription></doc></variable><variable name="$blockinner" access="private" type="array">array()<doc><description/><shortdescription>Array of inner blocks of a block.</shortdescription></doc></variable><variable name="$blocktypes" access="private" type="array">array()<doc><description/><shortdescription>Future versions will use this...</shortdescription></doc></variable><variable name="$variableCache" access="private" type="array">array()<doc><see type="function">setVariable()</see><see type="var">$clearCacheOnParse</see><description>Variables get cached before any replacement is done.Advantage: empty blocks can be removed automatically.Disadvantage: might take some more memory</description><shortdescription>Variable cache.</shortdescription></doc></variable><variable name="$clearCacheOnParse" access="private" type="boolean">true<doc><description/><shortdescription/></doc></variable><variable name="$removeUnknownVariables" access="private" type="boolean">true<doc><description/><shortdescription>Controls the handling of unknown variables, default is remove.</shortdescription></doc></variable><variable name="$removeEmptyBlocks" access="private" type="boolean">true<doc><description/><shortdescription>Controls the handling of empty blocks, default is remove.</shortdescription></doc></variable><variable name="$fileRoot" access="private" type="string">&amp;quot;&amp;quot;<doc><see type="function">IntegratedTemplate()</see><see type="function">setRoot()</see><description>The string gets prefixed to all filenames given.</description><shortdescription>Root directory for all file operations.</shortdescription></doc></variable><variable name="$flagBlocktrouble" access="private" type="boolean">false<doc><description/><shortdescription>Internal flag indicating that a blockname was used multiple times.</shortdescription></doc></variable><variable name="$flagGlobalParsed" access="private" type="boolean">false<doc><description/><shortdescription>Flag indicating that the global block was parsed.</shortdescription></doc></variable><subclasses><subclass>IntegratedTemplateExtension</subclass></subclasses></class></phpdoc>
