Class TPLN

Description

***************** Structure d'un bloc ***************************************

************************************************************************************ @author H2LSOFT

Located in /TPLN.php (line 70)

DB
   |
   --TPLN
Variable Summary
Method Summary
 TPLN TPLN ()
 void addBlocException (string $str)
 string applySpecialFunction ([string $replace = ''], [string $functions = ''])
 void arr2HtmlTab ()
 string arr2List ([string $text = ''], string $arr, [string $bng = ''], [string $end = ''])
 string array2json (array $arr)
 boolean blocExists (string $bloc_name)
 boolean cacheDirExists ()
 string captureAllBlocs ([string $subject = ''])
 string captureBloc (string $name, string $subject)
 boolean captureIncludeCmd ()
 string captureItems ([string $subject = ''], [string $type = ''])
 void changeTemplate (string $key)
 void cleanBlocs ()
 string clickable (string $ret)
 boolean createCache ()
 boolean createVirtualTemplate (string $countain)
 void defineBloc (string $path)
 void defineTemplate (array $arr)
 string directIoOutput ([string $file = ''])
 void directIOSave ([string $file = ''], string $path)
 void directIoWrite ([string $file = ''])
 void directParseInBloc (array $fathers_arr, int $item, int $replace)
 void directParseInFile (int $item, int $replace)
 void dualBlocVerify ()
 string dump ([string $label = 'Debug'], string $data, [boolean $return = 0])
 void encapsuleBlocs (array $bloc_arr, array $child_blocs)
 void eraseBloc (string $path, [string $msg = ''])
 void eraseItem (string $item)
 void error ( $err_no, [ $file = ''], [ $bloc = ''], [ $item = ''])
 string evalHtml (string $string)
 string extractStr (string $str, string $start, string $end, [bool $inc_markup = 0])
 void fastParse (string $path, [string $functions = ''])
 void fileStructMode ()
 string getAjaxBloc (string $bloc_name, [string $out = ''])
 array getAllBlocs (string $subject)
 string getBigBlocs ()
 string getBlocInFile (string $path)
 void getCachedFile ()
 string getFather (string $path)
 string getFathers (string $path, [string $type = ''], [int $with_item = 1])
 string getFile (string $filename, [string $blocname = ''])
 string getIP ()
 string getItem (string $path)
 array getNextGenerationBlocs (array $bloc_arr)
 int getTemplateID ()
 int getTime ()
 void htmlCompress (boolean $bool)
 boolean inCachePeriod ()
 void includeFile (string $item, string $file)
 array initialiazeBloc ( $bloc)
 boolean isBlocDesired (string $path)
 boolean isDefined (string $path, [string $type = ''])
 boolean isPhpFile (string $filename)
 boolean itemExists (string $item_name, [string $bloc = ''])
 boolean itemVerify (string $item, [string $bloc = ''])
 void loadArrayInBloc (string $path, array $arr, [string $msg = ''], [boolean $looped = false])
 void loadPlugin (string $name)
 void loop (string $path)
 void mailAlert ()
 boolean open ([string $file = ''], [CACHED $cached = ''], [int $cached_time = ''])
 void out ()
 string output ()
 void outPutMessage ([ $exit = true])
 void parse (string $path, string $replace, [string $functions = ''])
 boolean parseAllIncludeCmd ()
 void parseBigFathers ()
 void parseBloc (string $path, string $replace)
 void parseChrono ()
 void parseConstants ()
 void parseEncapsuledBlocs (array $bloc)
 void parseGlobals ()
 void parseIncludeCmd (string $file)
 void parseLogo ()
 void parseQueryCount ()
 boolean parseSubBlocs (int $level, array $bloc_arr)
 void parseVersion ()
 boolean pathVerify (string $path)
 void redirect (string $uri, [int $timer = 0])
 void reloadBlocVars (string $path)
 boolean replaceBloc (string $name, string $replace, string $subject)
 boolean replaceItem (string $name, string $replace, string $subject)
 void savePath (string $fathers_path)
 void saveTemplate (string $path)
 void setChrono ([string $type = 'this'])
 void setTemplate (string $key)
 void setTemplateID (string $key)
 void structBlocs ()
 void structFile ()
 void structItems ()
 void structOpen ()
 string str_replace_count (string $search, string $replace, string $subject, int $times)
 void traceMode ()
 void write ()
 string xssProtect (string $string)
Variables
mixed $blocs_double_exceptions = array('start', 'end', 'pager', 'in', 'out', 'previous', 'next') (line 90)
  • access: protected
mixed $chrono_type = array() (line 88)
  • access: protected
mixed $def_tpl = array() (line 72)
  • access: protected
mixed $error_msg = '' (line 93)
  • access: public
mixed $error_signaled = array() (line 94)
  • access: protected
mixed $error_user_level (line 484)

this method displays error message

  • author: H2LSOFT
  • access: protected
array $f = array() (line 85)
  • var: template properties
  • access: public
int $f_no = -1 (line 77)
  • var: index of template
  • access: public
mixed $HTMLCompress = 0 (line 89)
  • access: protected
mixed $struct_mode = 0 (line 97)
  • access: protected
mixed $struct_tab = array() (line 98)
  • access: protected
int $vf_no = -1 (line 81)
  • var: index of virtual template
  • access: public
Methods
Constructor TPLN (line 104)

TPLN constructor

  • author: H2LSOFT
  • access: public
TPLN TPLN ()
addBlocException (line 1972)

This method allows to rise an exception for blocks defined twice or more times in the template.

  • author: H2LSOFT
  • since: 2.7
  • access: public
void addBlocException (string $str)
  • string $str
applySpecialFunction (line 1502)

this method applays special function in item

  • author: H2LSOFT
  • since: 2.9
  • access: protected
string applySpecialFunction ([string $replace = ''], [string $functions = ''])
  • string $replace
  • string $functions
arr2HtmlTab (line 374)

this method changes array to html table

  • author: H2LSOFT
  • access: protected
void arr2HtmlTab ()
arr2List (line 335)

this method changes array to list

  • author: H2LSOFT
  • access: protected
string arr2List ([string $text = ''], string $arr, [string $bng = ''], [string $end = ''])
  • string $text
  • string $arr
  • string $bng
  • string $end
array2json (line 2625)

This method allows to convert a php array to a javascript array, it is useful for Ajax.

  • author: H2LSOFT
  • access: public
string array2json (array $arr)
  • array $arr
blocExists (line 1921)

method allows to know if a block exists in the template file.

  • author: H2LSOFT
  • access: public
boolean blocExists (string $bloc_name)
  • string $bloc_name
cacheDirExists (line 2535)

this method verifies if cach directory exists

  • author: H2LSOFT
  • access: protected
boolean cacheDirExists ()
captureAllBlocs (line 1780)

this method captures all blocks

  • author: H2LSOFT
  • access: protected
string captureAllBlocs ([string $subject = ''])
  • string $subject
captureBloc (line 1751)

this method captures block

  • author: H2LSOFT
  • access: protected
string captureBloc (string $name, string $subject)
  • string $name
  • string $subject
captureIncludeCmd (line 1826)

this method captures include commands in the template

  • author: H2LSOFT
  • access: protected
boolean captureIncludeCmd ()
captureItems (line 1702)

this method captures items

  • author: H2LSOFT
  • access: protected
string captureItems ([string $subject = ''], [string $type = ''])
  • string $subject
  • string $type
captureItemsInEachBloc (line 1798)

this method captures items in each block

  • author: H2LSOFT
  • access: protected
boolean captureItemsInEachBloc ()
changeTemplate (line 932)

this method allows to select a template opened by Open()

or DefineTemplate() methods either by name or by number.

  • author: H2LSOFT
  • access: public
void changeTemplate (string $key)
  • string $key
cleanBlocs (line 726)

this method allows to delete the blocks.

  • author: H2LSOFT
  • see: EraseBloc(), EraseItem().
  • since: 2.2
  • access: public
void cleanBlocs ()
clickable (line 2714)

This method allows to convert http, www, ftp, mailto into clickable element

  • author: H2LSOFT
  • access: public
string clickable (string $ret)
  • string $ret
createCache (line 2477)

this method creates file cache

  • author: H2LSOFT
  • access: protected
boolean createCache ()
createVirtualTemplate (line 744)

this method allows to create a virtual template.

  • author: H2LSOFT
  • access: public
boolean createVirtualTemplate (string $countain)
  • string $countain
defineBloc (line 2246)

this method

  • author: H2LSOFT
  • access: protected
void defineBloc (string $path)
  • string $path
defineTemplate (line 869)

this method allows to open and to name various templates.

  • author: H2LSOFT
  • access: public
void defineTemplate (array $arr)
  • array $arr
directIoOutput (line 839)

this method is a macro wich allows to open and to return a template.

  • author: H2LSOFT
  • access: public
string directIoOutput ([string $file = ''])
  • string $file
directIOSave (line 855)

this method is a macro which allows to open and to save a template.

  • author: H2LSOFT
  • access: public
void directIOSave ([string $file = ''], string $path)
  • string $file
  • string $path
directIoWrite (line 824)

this method is a macro which allows to open and to write a template.

  • author: H2LSOFT
  • access: public
void directIoWrite ([string $file = ''])
  • string $file
directParseInBloc (line 1046)

this method

  • author: H2LSOFT
  • access: protected
void directParseInBloc (array $fathers_arr, int $item, int $replace)
  • array $fathers_arr
  • int $item
  • int $replace
directParseInFile (line 1034)

this method

  • author: H2LSOFT
  • access: protected
void directParseInFile (int $item, int $replace)
  • int $item
  • int $replace
dualBlocVerify (line 1951)

this method verifies if block is not in double

  • author: H2LSOFT
  • access: protected
void dualBlocVerify ()
dump (line 175)

This method allows to display the countain of a php variable to facilite debugging

  • author: H2LSOFT
  • since: 2.6
  • access: public
string dump ([string $label = 'Debug'], string $data, [boolean $return = 0])
  • string $label
  • string $data
  • boolean $return
encapsuleBlocs (line 1216)

this method

  • author: H2LSOFT
  • access: protected
void encapsuleBlocs (array $bloc_arr, array $child_blocs)
  • array $bloc_arr
  • array $child_blocs
endBlocVerify (line 1934)

this method verifies if end block is not in double

  • author: H2LSOFT
  • access: protected
endBlocVerify ()
eraseBloc (line 1285)

this method allows you to delete a block.

But if the bolck is one, the substitution will be done in the template.

  • author: H2LSOFT
  • since: 2.9
  • access: public
void eraseBloc (string $path, [string $msg = ''])
  • string $path
  • string $msg
eraseItem (line 1264)

this method allows to delete a variable.

  • author: H2LSOFT
  • since: 2.9
  • access: public
void eraseItem (string $item)
  • string $item
error (line 397)
  • access: protected
void error ( $err_no, [ $file = ''], [ $bloc = ''], [ $item = ''])
  • $err_no
  • $file
  • $bloc
  • $item
evalHtml (line 2118)

this method evals template file

  • author: H2LSOFT
  • access: protected
string evalHtml (string $string)
  • string $string
extractStr (line 2560)

this method extracts string

  • author: H2LSOFT
  • access: public
string extractStr (string $str, string $start, string $end, [bool $inc_markup = 0])
  • string $str
  • string $start
  • string $end
  • bool $inc_markup
fastParse (line 1069)

this method is like Parse() method but it avoids to rewrite definied variables.

  • author: H2LSOFT
  • access: public
void fastParse (string $path, [string $functions = ''])
  • string $path
  • string $functions
fileStructMode (line 218)

this method activates template structure

  • author: H2LSOFT
  • access: public
void fileStructMode ()
getAjaxBloc (line 2690)

This method allows to recover the contents of the text of the block,

useful to recover the text after an exit of template

  • author: H2LSOFT
  • since: 2.9
  • access: public
string getAjaxBloc (string $bloc_name, [string $out = ''])
  • string $bloc_name
  • string $out
getAllBlocs (line 1814)

this method gets all blocks

  • author: H2LSOFT
  • access: protected
array getAllBlocs (string $subject)
  • string $subject
getBigBlocs (line 1651)

this method

  • author: H2LSOFT
  • access: protected
string getBigBlocs ()
getBlocInFile (line 1417)

this method allows to return a whole block from the template file.

  • author: H2LSOFT
  • since: IncludeFile()
  • access: public
string getBlocInFile (string $path)
  • string $path
getCachedFile (line 2519)

this method returns cached file

  • author: H2LSOFT
  • access: protected
void getCachedFile ()
getExecutionTime (line 2422)

this method

  • author: H2LSOFT
  • access: protected
void getExecutionTime ()
getFather (line 2205)

this method returns the last father

  • author: H2LSOFT
  • access: protected
string getFather (string $path)
  • string $path
getFathers (line 2222)

this method returns all fathers in array

  • author: H2LSOFT
  • access: protected
string getFathers (string $path, [string $type = ''], [int $with_item = 1])
  • string $path
  • string $type
  • int $with_item
getFile (line 1308)

this method allows you to return the contents of file.

If the block name optional parameter is specified the method will return

the contents of the block defined in the file.

  • author: H2LSOFT
  • access: public
string getFile (string $filename, [string $blocname = ''])
  • string $filename
  • string $blocname
getIP (line 201)

This method returns ip used.

  • author: H2LSOFT
  • access: public
string getIP ()
getItem (line 2191)

this method returns the last item

  • author: H2LSOFT
  • access: protected
string getItem (string $path)
  • string $path
getNextGenerationBlocs (line 1190)

this method

  • author: H2LSOFT
  • access: protected
array getNextGenerationBlocs (array $bloc_arr)
  • array $bloc_arr
getTemplateID (line 918)

This method returns curent template index

  • return: template index
  • access: public
int getTemplateID ()
getTime (line 2460)

this method gets current time

  • author: H2LSOFT
  • access: protected
int getTime ()
htmlCompress (line 159)

This method allows to compress the template.

  • author: H2LSOFT
  • since: 2.4
  • access: public
void htmlCompress (boolean $bool)
  • boolean $bool
inCachePeriod (line 2439)

this method verifies if template is expired

  • author: H2LSOFT
  • access: protected
boolean inCachePeriod ()
includeFile (line 1401)

this method allows to substitute a variable from the template file by the contents of a file.

  • author: H2LSOFT
  • see: GetBlocInFile()
  • access: public
void includeFile (string $item, string $file)
  • string $item
  • string $file
initialiazeBloc (line 2289)

this method inisializes path in TPLN memory manager

  • author: H2LSOFT
  • access: protected
array initialiazeBloc ( $bloc)
  • $bloc
initTemplateVars (line 558)

this method initializes template variables

  • author: H2LSOFT
  • access: protected
void initTemplateVars ()
isBlocDesired (line 2152)

this method returns if it is a block

  • author: H2LSOFT
  • access: protected
boolean isBlocDesired (string $path)
  • string $path
isDefined (line 2168)

this method verifies if all the block are defined

  • author: H2LSOFT
  • access: protected
boolean isDefined (string $path, [string $type = ''])
  • string $path
  • string $type
isPhpFile (line 2135)

this method returns if template is a PHP file

  • author: H2LSOFT
  • access: protected
boolean isPhpFile (string $filename)
  • string $filename
itemExists (line 1847)

this method allows to know if a variable exists in the template file.

  • author: H2LSOFT
  • see: BlocExists()
  • access: public
boolean itemExists (string $item_name, [string $bloc = ''])
  • string $item_name
  • string $bloc
itemVerify (line 1874)

this method verifies item

  • author: H2LSOFT
  • access: protected
boolean itemVerify (string $item, [string $bloc = ''])
  • string $item
  • string $bloc
loadArrayInBloc (line 1091)

this method allows to substitute the items by the pairs keys of an array in a whole block.

The 3rd parameters allows to replace entire block if no data foud in array.

  • author: H2LSOFT
  • since: 2.3
  • access: public
void loadArrayInBloc (string $path, array $arr, [string $msg = ''], [boolean $looped = false])
  • string $path
  • array $arr
  • string $msg
  • boolean $looped
loadPlugin (line 133)

this method allows to use plugin for TPLN.

  • author: H2LSOFT
  • see: Plugin form
  • deprecated:
  • since: 2.8
  • access: public
void loadPlugin (string $name)
  • string $name
loop (line 1145)

this method is applied to a block to report is looping.

  • author: H2LSOFT
  • access: public
void loop (string $path)
  • string $path
mailAlert (line 424)

this method sends mail admin alert

  • author: H2LSOFT
  • access: protected
void mailAlert ()
open (line 600)

this method allows to open template file which can to support any extensions of file (.htm, .html, .tpl, .php ... ).

if none name of file has been defined, it will open the file which have the same name

as the script with extension per defect.

  • author: H2LSOFT
  • access: public
boolean open ([string $file = ''], [CACHED $cached = ''], [int $cached_time = ''])
  • string $file
  • CACHED $cached
  • int $cached_time
out (line 1663)

this method

  • author: H2LSOFT
  • access: protected
void out ()
output (line 1444)

this method allows to return the contents of the template file parsed.

  • author: H2LSOFT
  • access: public
string output ()
outPutMessage (line 485)
  • access: public
void outPutMessage ([ $exit = true])
  • $exit
parse (line 999)

this method allows to substitute a variable defined inside the template file.

TPLN use a style javascript pseudo object language to access to the variable by the separator ".".

  • author: H2LSOFT
  • see: ParseBloc()
  • access: public
void parse (string $path, string $replace, [string $functions = ''])
  • string $path
  • string $replace
  • string $functions
parseAllIncludeCmd (line 2102)

this method replaces all include commands

  • author: H2LSOFT
  • access: protected
boolean parseAllIncludeCmd ()
parseBigFathers (line 1619)

this method

  • author: H2LSOFT
  • access: protected
void parseBigFathers ()
parseBloc (line 1332)

this method allows to substitute a whole bloc and markers also.

void parseBloc (string $path, string $replace)
  • string $path
  • string $replace
parseChrono (line 2407)

this method replaces { _Chrono} by the time clock of the template

  • author: H2LSOFT
  • access: protected
void parseChrono ()
parseConstants (line 707)

this method replaces all php constants in template

  • author: H2LSOFT
  • access: public
void parseConstants ()
parseEncapsuledBlocs (line 1531)

this method

  • author: H2LSOFT
  • access: protected
void parseEncapsuledBlocs (array $bloc)
  • array $bloc
parseGlobals (line 962)

this method allows to parse a variable Php by a variable contained in the template.

  • author: H2LSOFT
  • see: Parse(), FastParse().
  • since: 2.1, 2.4
  • access: public
void parseGlobals ()
parseIncludeCmd (line 2041)

this method replaces include command

  • author: H2LSOFT
  • access: protected
void parseIncludeCmd (string $file)
  • string $file
parseLogo (line 2381)

this method replaces { _Logo} by TPLN Logo

  • author: H2LSOFT
  • access: protected
void parseLogo ()
parsePhpCommands (line 2064)

this method replaces all PHP commands

  • author: H2LSOFT
  • access: protected
void parsePhpCommands ()
parseQueryCount (line 2371)

this method replaces { _QueryCount} by the numbre of queries executed.

  • author: H2LSOFT
  • access: protected
void parseQueryCount ()
parseSubBlocs (line 1586)

this method

  • author: H2LSOFT
  • access: protected
boolean parseSubBlocs (int $level, array $bloc_arr)
  • int $level
  • array $bloc_arr
parseVersion (line 2361)

this method replaces { _Version} by TPLN current version

  • author: H2LSOFT
  • access: protected
void parseVersion ()
pathVerify (line 1900)

this method verifies path

  • author: H2LSOFT
  • access: public
boolean pathVerify (string $path)
  • string $path
redirect (line 536)

This method allows to redirect to a new web page

  • author: H2LSOFT
  • since: 2.9
  • access: public
void redirect (string $uri, [int $timer = 0])
  • string $uri
  • int $timer: default 0
reloadBlocVars (line 1385)

this method allows to reload variables of a block contained in the template.

  • author: H2LSOFT
  • since: 1.5
  • access: public
void reloadBlocVars (string $path)
  • string $path
replaceBloc (line 2016)

this method replaces block

  • author: H2LSOFT
  • access: protected
boolean replaceBloc (string $name, string $replace, string $subject)
  • string $name
  • string $replace
  • string $subject
replaceItem (line 1995)

this method replaces item

  • author: H2LSOFT
  • access: protected
boolean replaceItem (string $name, string $replace, string $subject)
  • string $name
  • string $replace
  • string $subject
savePath (line 2304)

this method registers path in TPLN memory manager

  • author: H2LSOFT
  • access: protected
void savePath (string $fathers_path)
  • string $fathers_path
saveTemplate (line 1460)

this method allows to save the contents of the template file parsed.

void saveTemplate (string $path)
  • string $path
setChrono (line 2398)

this method allows to know template total time execution.

The variable { _Chrono} must be imperatively replaced inside your template file.

void setChrono ([string $type = 'this'])
  • string $type
setTemplate (line 894)

this method allows to select a template which has been opened by the Open()

or DefineTemplate() methods is by a name or a number.

  • author: H2LSOFT
  • deprecated:
  • since: 1.4
  • access: public
void setTemplate (string $key)
  • string $key
setTemplateID (line 908)

this method allows you to select a template opened by Open()

or DefineTemplate() methods either by name or by number.

void setTemplateID (string $key)
  • string $key
structBlocs (line 320)

this method returns block structure

  • author: H2LSOFT
  • access: protected
void structBlocs ()
structFile (line 257)

this method returns file structure

  • author: H2LSOFT
  • access: protected
void structFile ()
structItems (line 267)

this method returns item structure

  • author: H2LSOFT
  • access: protected
void structItems ()
structOpen (line 239)

this method gets opened template

  • author: H2LSOFT
  • access: protected
void structOpen ()
str_replace_count (line 2596)

PHP str replace with count parameter

  • author: H2LSOFT
  • access: public
string str_replace_count (string $search, string $replace, string $subject, int $times)
  • string $search
  • string $replace
  • string $subject
  • int $times
traceMode (line 228)

this method

  • author: H2LSOFT
  • access: public
void traceMode ()
write (line 1431)

this method allows to print file the template parsed.

  • author: H2LSOFT
  • see: Parse(), Output()
  • access: public
void write ()
xssProtect (line 2319)

This method allows to protect data against XSS attack,

this method is used before insetring records in a database.

  • author: H2LSOFT
  • since: 2.5, 2.2.5
  • access: public
string xssProtect (string $string)
  • string $string

Documentation generated on Sat, 06 Mar 2010 21:34:08 +0100 by phpDocumentor 1.4.3