Categories > TinyButStrong general >

TBS 3.5.0-beta-RC available

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Skrol29
Date: 2009-05-18
Time: 17:19

TBS 3.5.0-beta-RC available

Hello,

TBS 3.5.0 is available for download here:
http://www.tinybutstrong.com/download/download.php?file=tbs_beta.zip&sid=2

The new features for PHP 5 are available for both packages "PHP 4 or
Feel free to send report and comments.

On the menu of this next version:
--------------------------------------

- New parameter 'att' which move a TBS field into a XML/HTML attribute before to be merged.
  Examples:
  [var.x;att=class] moves into attribute 'class' of the first tag on the left.
  [var.x;att=div#class] moves into attribute 'class' of the first <div> on the left.
  [var.x;att=+div#class] moves into attribute 'class' of the first <div> on the right.
  [var.x;att=((div))#class] moves into attribute 'class' of the second embedding <div> on the left.
  [var.x;att=table+div#class] moves into attribute 'class' of the first <div> after the first <table> on the left.
    Restriction for MergeBlock() : a TBS error occurs when move on the right over another TBS fields.
   
    If parameter 'att' is defined, then 'magnet=#' works to delete the attribute in case the value is empty string ('').
    If parameter 'att' is defined, then parameter 'attadd' can be  used to tell that the value must be added to the    current value of the attribute instead of replacing it.
   
- MergeBlock() allows automatic sub-blocks. Works with new parameters 'sub1', 'sub2', 'sub3', ...
  (Idea given by Olivier)
  Example: [bl1.ParentName;block=tr+tr;sub1=Childs] ... [bl1_sub1.ChildName;block=tr]
  This example assumes that block 'bl1' is merged with a data source which is an array, an object, or a string.
  And that this data source has a column Childs which is itself an array or an object.
  Block 'bl1_sub1' must be embedded into 'bl1'.
    If the data source is a string, then it will be split using coma (,) as delimiter. This is useful for ENUM values coming from a database (Idea given by TomH).
 
- Property Assigned has a new syntax.
    Property Assigned enables you to prepare data information before the merging and also to define automatic merges.
    $TBS->Assigned is an array that you can feed with data information.
    Each new entry must be an array containing numeric keys corresponding to arguments of MergeBlock() MergeField().
    To define an automatic merge, add a key 'auto'=>'onload' or 'auto'=>'onshow'.
    To specify which method the arguments are for, add a key 'auto'=>'mergeblock' or 'auto'=>'mergefield'. Default is 'mergeblock'.
    Examples:
  $TBS->Assigned['ass1'] = array('b1', &$data); // will be merged when call $TBS->MergeBlock('ass1')
  $TBS->Assigned['ass2'] = array('b2', 'mysql', 'SELECT * FROM table1'); // will be merged when call $TBS->MergeBlock('ass2')
  $TBS->Assigned['ass3'] = array('b3', &$data, 'auto'=>'onload'); // will be merged automatically using MergeBlock with other [onload].
  $TBS->Assigned['ass4'] = array('f4', date('Ymd'), 'auto'=>'onload', 'type'='mergefield'); // will be merged automatically using MergeField with other [onload].

- MergeField() allows to define a set of default parameters.
  (Idea given by Gasper)
  Example: $TBS->MergeField('mf',date('Ymd'),false,array('frm'=>'dd/mm/yyyy'));

- Parameter 'getbody' now allows to get multiparts, and to take tags or not.
  Example: [onload;file=;getbody=(script)+(style)+body]
  The main goal of this feature is to include Javascript and styles from subtemplates.

- MergeBlock() natively supports Iterator, ArrayObject and IteratorAggregate.
  (Idea given by Olivier)

- MergeBlock() allows columns names with spaces.

- Public and Static are defined when appropriate.
  Some methods are leaved public because they are a hook for some plugins.

Fixed bugs:
-----------
- Fatal error: Call to undefined method clsTbsDataSource::f_Misc_CheckArgLst().
- Warning of 2 undefined variables. http://tinybutstrong.com/forum.php?msg_id=9265
- http://www.tinybutstrong.com/forum.php?msg_id=9508 (fixed but not yet tested)

Enjoy, and have a nice day
Skrol29
By: Skrol29
Date: 2009-05-18
Time: 17:30

Re: TBS 3.5.0-beta-RC available

I have to say that this new version has been benched for both PHP 5.2.9 and PHP 4.4.9. The class has the same speed for merging than previously. The new features has not been benched specifically.
By: TomH
Date: 2009-05-18
Time: 19:59

Re: TBS 3.5.0-beta-RC available

Skrol29,
Looks good.

Have tested with  all of my working apps and dev code.

Thanks for TBS - every day,
TomH