• | New method PlugIn(). | ||||||||||||||
See chapter below. | |||||||||||||||
• | New parameter 'bmagnet' : | ||||||||||||||
This is a parameter for blocks. It defines a surrounding block to delete when there is no data to merge. Example: [b1;block=tr;bmagnet=table] In this example, the entire Html table will be deleted if the merged query has no data. |
|||||||||||||||
• | New parameter 'getbody' : | ||||||||||||||
This parameter works with both parameters 'file' and 'script'. It indicates to search and keep the body part of the inserted file. By default, it searches for the couple of tags <body> and </body> but you can precise other tags. Examples: [onload;file=header.html;getbody] In this example, only the contents between tags <body> and </body> of the file 'header.html' will be inserted. [onload;file=header.html;getbody=table] In this example, only the contents between tags <table> and </table> of the file 'header.html' will be inserted. |
|||||||||||||||
• | New parameter 'ope' : | ||||||||||||||
This parameter enables you to make some basic operations on the value before the field is merged. Examples:
You can also define your own 'ope' features using the OnOperation plug-in event. |
|||||||||||||||
• | New property NoErr : | ||||||||||||||
It enables you to avoid all TBS error messages. Example : $TBS->NoErr = true; |
|||||||||||||||
• | Parameter 'comm' enhancement : | ||||||||||||||
Parameter 'comm' without any value still extends the bounds of a TBS fields up to the surrounding Html Comment tag. But you can now precise a couple of tags instead. Example : <span>[var.x;comm=span]</span> |
|||||||||||||||
• | Parameter 'frm' enhancement : | ||||||||||||||
Parameter 'frm' allow keywords ampm, AMPM and hm to display an hour with the AM/PM format. Example : <span>[var.datex;frm='hm:mm:ss ampm'] |
|||||||||||||||
• | Method GetBlockSource() enhancement : | ||||||||||||||
By default, this method returns the source of a block in the current template, including the definition tags. This could be a problem when the block is defined with an explicit syntax (block=begin/block=end). A new extra argument enables you to precise if you want to delete definition tags from the returned block's source. Example : $def_tags = false; $x = $TBS->GetBlockSource('b1',false,$def_tags); |
|||||||||||||||
• | Method MergeBlock() enhancement : | ||||||||||||||
|
|||||||||||||||
• | Method MergeField() enhancement : | ||||||||||||||
|
|||||||||||||||
• | OOP enhancement (Oriented Object Programming) : | ||||||||||||||
The syntax to refers to an object under property ->RefObject allow now to have a path like for Var Fields. Example : [var.x;onformat=~item1.item2.my_method] In the example above, onformat function refers to $TBS->ObjectRef['item1']['item2']->my_method(); |
|||||||||||||||
• | Sub item syntax enhancement : | ||||||||||||||
The syntax to refers to a sub item for fields can now have a reference to a method with arguments. Examples : [var.obj1.my_method(144,aaa)] [var.obj1.my_method(222,bbb).item4] Note : this syntax does not allow string delimitors. |
• | New syntax to define a block relatively ot Html tags. | ||||||||||||||
This new syntax is compatible with the old syntax. This syntax applies for paramaters 'block', 'magnet', 'selbounds', 'comm', and new parameter 'bmagnet'. It also makes parameters 'extend' and 'encaps' deprecated.
The interest of this new syntax is double : you can extend the block's bounds over different tags which follow each other (example : block=div+span+table). And you can extend bounds not only for parameter block, but also other parameters magnet, bmagnet, selbounds and comm. Please note that parameters 'extend' and 'encaps' are no more supported. |
|||||||||||||||
• | Parameter 'if' : | ||||||||||||||
|
|||||||||||||||
• | Parameters 'file' : | ||||||||||||||
By default the file is inserted as is. TBS does not search and keep the body part of the inserted contents automatically anymore. You have to use the new parameter 'getbody' to get this feature. | |||||||||||||||
• | Parameters 'script' : | ||||||||||||||
|
|||||||||||||||
• | Parameter 'frm' : | ||||||||||||||
When a multiformat is defined, then an empty format will display an empty string. It used to be different: in TBS version 2.x, empty format was taken as equal to the previously defined format. |
• | Parameter 'htmlconv=look'. Was used to check the contents to decide if it is Html yet, or to be converted to Html. No more supported. | |
• | Parameter 'block=row'. This was a deprecated alias. Now you have to use 'block=tr' instead. | |
• | Paremeter 'block=opt'. This was a deprecated alias. Now you have to use 'block=option' instead. | |
• | Parameter 'max'. No more supported, you have to use new parameter 'ope' instead. Example : [var.x;ope=max:10] |
|
• | Parameter 'getob'. Fully supported by parameter 'subtpl'. | |
• | Parameter 'once'. Was used with parameter 'script' to run the script only once. No more supported. | |
• | Parameter 'extend'. No more supported. Now you have to use the new syntax for parameter 'block' instead. | |
• | Parameter 'encaps'. No more supported. Now you have to use the new syntax for parameter 'block' instead | |
• | Parameter 'onsection'. Deprecated, no more supported. Use parameter 'ondata' instead. | |
• | Parameter 'selected'. No more supported. It is replaced by a plug-in which has a syntax closed to the old one. (see demo examples) Example : [var.x;ope=html;select=tagname] |
|
• | Method MergeNavigationBar() is no more supported. It is replaced by a plug-in which has quite the same syntax. Parameter 'navdel' for navigation bars has to be replaced by new parameter 'bmagnet' for blocks. Replace : TBS->MergeNavigationBar('nav1',,$page,$rec_nbr,$page_size); With : include_once('tbs_plugin_navbar.php'); ... TBS->PlugIn(TBS_NAVBAR,'nav1',,$page,$rec_nbr,$page_size); |
|
• | Method CacheAction() is no more supported. It is replaced by a plug-in which has quite the same syntax. (plug-in not yet available) |
|
• | Method MergeSpecial() is no more supported. It is replaced by a MergeField() enhancement. Replace : $TBS->MergeSpecial('var'); With : $TBS->MergeField('var'); |
|
• | Method MergeBlock() extra arguments for ByPage Mode are no more suported. ByPage Mode is replaced by a plug-in. Replace : $TBS->MergeBlock('b1',$id,$Sql,$PageSize,$PageNum,$RecCnt) With : include_once('tbs_plugin_bypage.php'); ... $TBS->PlugIn(TBS_BYPAGE,$PageSize,$PageNum,$RecCnt); $TBS->MergeBlock('b1',$id,$Sql); |
Plug-in Events | Description | |
• | OnInstall | Executed automatically when the plug-in is called for the first time, or when PlugIn() method is called with the specific argument for installing. |
• | OnCommand | Executed when PlugIn() method is called. This is a way to execute any user command specific to the plug-in. |
• | BeforeLoadTemplate |
Executed when LoadTemplate() method is called. Can cancel TBS basic process. |
• | AfterLoadTemplate | Executed at the end of LoadTemplate(). |
• | BeforeShow | Executed when Show() method is called. Can cancel TBS basic process. |
• | AfterShow | Executed at the end of Show(). |
• | OnData | Executed each time a record of data is retrieved for a MergeBlock() process. (similar to parameter 'ondata' but for every block) |
• | OnFormat | Executed each time a fields is being merged. (similar to parameter 'onformat' but for every fields) |
• | OnOperation | Executed each time parameter 'ope' is defined with an unsupported keyword. |
• | BeforeMergeBlock | Executed when bounds of a block are founded. Can cancel TBS basic process. |
• | OnMergeSection | Executed when a section is merged, and before it is added to other sections. |
• | AfterMergeBlock | Executed just before a merged block is inserted into the template. |
• | OnSpecialVar | Executed when a non native Special Var Field (like [var..now]) is met. |
• | OnMergeField | Executed on each field met when using the MergeField() method. |