Categories > TinyButStrong general >

PHPLayerMenu with TBS

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Cleiver
Date: 2006-11-08
Time: 22:53

PHPLayerMenu with TBS

hi,

I have a system online that uses the PHPLayerMenu (http://phplayersmenu.sourceforge.net/). Now I have to rewrite the ystemusing TBS... but it seems that this menu doesn't work here.

Does anyone have a solution for his? The owner of the system really want this menu... hewill just change it in last case...
By: Skrol29
Date: 2006-11-11
Time: 03:12

Re: PHPLayerMenu with TBS

Hi,

You can make work PHPLayerMenu within your TBS application.

I don't know the PHPLayerMenu class very well, but the synopsis I've read is quote simple. You use methods to load the parameters of your menu, and then other methods can be called when you have to output the Javascript in the page. Some Javascript may have to be put at different places.

You can do this with TBS by using few [onload] tag with "onformat" the parameter.
I give you the idea :
In the PHP template:
[onload;onformat=f_mid;htmlconv=no;act=header]
...
[onload;onformat=f_mid;htmlconv=no;act=menu]
...
[onload;onformat=f_mid;htmlconv=no;act=header]

PHP:
...
function f_menu($Name,&$Value,&$PrmLst) {

  global $mid;
 
  if ($isset($mid)) {
     $mid = new LayersMenu();
     ... // All initialization for the menu
  }

  if ($PrmLst['act']=='header') $Value = $mid->getHeader();
  if ($PrmLst['act']=='footer') $Value = $mid->getFooter();
  if ($PrmLst['act']=='menu') $Value = $mid->getMenu();

}